Skip to content

Update a Mapper

Request

Partially updates a mapper by its numeric ID. Only fields provided in the request body are updated. The same base64 encoding requirement applies to transform, headerMapping, and valueMapping.

Security
sessionAuth
Path
orgIdstringrequired
idinteger, (int32)required
Bodyapplication/jsonrequired
namestringrequired

Human-readable name for the mapper

Example:"product-transform-v1"
transformstring

Base64-encoded JavaScript source. Must define a function named transform(eventData). The ctx object is available with helpers: ctx.getHeaderMapping(), ctx.getValueMapping(), ctx.getProducts(skus), ctx.getCategoryMapping(code). Available libraries: jsonata, axios (get/post only), _ (lodash), CryptoJS.

Example:"ZnVuY3Rpb24gdHJhbnNmb3JtKGV2ZW50RGF0YSkgeyByZXR1cm4gZXZlbnREYXRhOyB9"
headerMappingstring

Base64-encoded JSON object. After decoding, must be valid JSON. Accessible in the transform script via ctx.getHeaderMapping().

Example:"e30="
valueMappingstring

Base64-encoded JSON object. After decoding, must be valid JSON. Accessible in the transform script via ctx.getValueMapping().

Example:"e30="
curl -i -X PATCH \
  'https://api.aipim.fynd.com/service/panel/webhook/v1.0/org/{orgId}/mapper/{id}' \
  -H 'Content-Type: application/json' \
  -b cc.session=YOUR_API_KEY_HERE \
  -d '{
    "name": "product-transform-v1",
    "transform": "ZnVuY3Rpb24gdHJhbnNmb3JtKGV2ZW50RGF0YSkgeyByZXR1cm4gZXZlbnREYXRhOyB9",
    "headerMapping": "e30=",
    "valueMapping": "e30="
  }'

Responses

Mapper updated successfully

Bodyapplication/json
idinteger, (int32)

Auto-incremented primary key

namestring
transformstring

Stored transform script (base64-encoded)

headerMappingstring

Stored header mapping (base64-encoded)

valueMappingstring

Stored value mapping (base64-encoded)

orgstring

Organization identifier that owns this mapper

created_atstring, (date-time)
updated_atstring, (date-time)
created_bystring
modified_bystring
Response
{ "id": 0, "name": "string", "transform": "string", "headerMapping": "string", "valueMapping": "string", "org": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "created_by": "string", "modified_by": "string" }