Mixins
Mixins let you extend business resources with custom properties by defining JSON schemas, hosting them, and referencing them in resource metadata for flexible, schema-driven data enrichment.
Last updated
Was this helpful?
Was this helpful?
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Mixin schema for delivery options.",
"properties": {
"packaging": {
"type": ["string", "null"],
"description": "Delivery packaging."
},
"hint": {
"type": ["string", "null"],
"description": "Additional information from the customer."
},
"substituteProduct": {
"type": ["boolean"],
"default": false,
"description": "Flag indicating whether products that are out of stock can be substituted."
}
}
}{
"mixins": {
"deliveryOptions": {
"packaging": "Paper",
"hint": "If we are not home, the package can be left in front of the door.",
"substituteProduct": true
}
},
"metadata": {
"mixinMetadata": {
"mixins": {
"deliveryOptions": "https://res.cloudinary.com/saas-ag/raw/upload/schemata/deliveryOptionsMixIn.v6.json"
}
}
}
}{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Mixin schema for delivery options.",
"properties": {
"packaging": {
"type": ["string", "null"],
"description": "Delivery packaging."
},
"hint": {
"type": ["string", "null"],
"description": "Additional information from the customer."
},
"substituteProduct": {
"type": ["boolean"],
"default": false,
"description": "Flag indicating whether products that are out of stock can be substituted."
}
}
}curl -i -X PATCH \
'https://api.emporix.io/customer/{tenant}/customers/{customerNumber}' \
-H 'Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}' \
-H 'Content-Type: application/json' \
-d '{
"contactEmail": "example@customer.com",
"active": true,
"mixins": {
"deliveryOptions": {
"packaging": "Paper",
"hint": "If we are not home, the package can be left in front of the door.",
"substituteProduct": true
}
},
"metadata": {
"mixins": {
"deliveryOptions": "{{schemaURL}}"
}
}
}