Creates a new mapper for the organization. The transform, headerMapping, and valueMapping fields must be base64-encoded strings. The name field is required.
Security
sessionAuth
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"
Base64-encoded JSON object. After decoding, must be valid JSON. Accessible in the transform script via ctx.getHeaderMapping().
Example:"e30="
- AIPIM Production Serverhttps://api.aipim.fynd.com/service/panel/webhook/v1.0/org/{orgId}/mapper
curl -i -X POST \
'https://api.aipim.fynd.com/service/panel/webhook/v1.0/org/{orgId}/mapper' \
-H 'Content-Type: application/json' \
-b cc.session=YOUR_API_KEY_HERE \
-d '{
"name": "product-transform-v1",
"transform": "ZnVuY3Rpb24gdHJhbnNmb3JtKGV2ZW50RGF0YSkgeyByZXR1cm4gZXZlbnREYXRhOyB9",
"headerMapping": "e30=",
"valueMapping": "e30="
}'Mapper created successfully
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" }