Create Order Type Config
Adopt an existing order type or mint a new one for the caller market. A target=PRODUCT config may carry a products[] batch of per-product charge overrides (sync/replace, keyed by modifier_id).
Authorization
API-TOKEN Your partner API key. Send it in the API-TOKEN header on every request.
In: header
Header Parameters
API contract version to target. See the Changelog for what changed in each version.
"2.0.0""2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"Request Body
application/json
Market the config belongs to. Auto-filled from the caller for a subscriber; required in the body for an admin/merchant acting on a market. Must match an existing stored value.
Registry key of an existing order type to adopt. Omit to mint a brand-new type (key derived from name_en). Must match an existing stored value.
Order type name (English). Required when minting (no type_key); an override when adopting. This field is required when type_key is not present. Must not be greater than 255 characters.
Order type name (Arabic). Must not be greater than 255 characters.
Order type image override: an uploaded image URL (custom image). Use icon_id to pick a catalog icon instead. Must be a valid URL.
Icon override — a reference into the shared icon catalog (GET /v2/icons). Must match an existing stored value.
Whether split payment is allowed for this order type.
Whether this order type is shown in the customer digital menu. Defaults to false when omitted; enable to surface it in the digital menu.
Charge amount for this order type.
Charge amount type, required when value is present. This field is required when value is present.
"PERCENT" | "NOMINAL"Charge level, required when value is present. This field is required when value is present.
"ORDER" | "PRODUCT"Charge tax-interaction method (AFTER_TAX/EXCLUSIVE/INCLUSIVE). Only for target=ORDER; required then. Hidden for target=PRODUCT. This field is required when target is ORDER.
"AFTER_TAX" | "EXCLUSIVE" | "INCLUSIVE"Per-product charge mode (ENTIRELY/SPECIFIC). Only for target=PRODUCT; required then. Hidden for target=ORDER. This field is required when target is PRODUCT.
"ENTIRELY" | "SPECIFIC"Allowed payment methods for this order type. At most one item may have is_preset true. Empty/absent allows all methods.
Per-product charge overrides, keyed by modifier_id (sync/replace). Only allowed when target is PRODUCT; absent leaves overrides untouched, an empty array clears them all.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.flavours.sa/dev/api/v2/orders/types/configs" \ -H "X-API-Version: 2.3.0" \ -H "Content-Type: application/json" \ -d '{ "market_id": null }'{
"meta": {
"code": 200,
"status": "success",
"message": "Order type config created successfully."
},
"data": {
"id": "09a9f9a4-cfaa-4739-b0cb-a71d24bb26f4",
"market_id": "eef0da10-dd19-4a4c-ab3d-23dd1b548801",
"type_key": "CURBSIDE_PICKUP",
"target": "ORDER",
"method": "EXCLUSIVE",
"name_en": null,
"name_ar": null,
"image_url": null,
"value": 5,
"value_type": "NOMINAL",
"sort": 3,
"settings": [
"WITH_CUSTOMER"
],
"is_split": false,
"is_active": true,
"created_at": 1792593341103,
"updated_at": 1792593341103,
"icon_id": null,
"is_digital": false,
"type": {
"key": "CURBSIDE_PICKUP",
"name_en": "Curbside Pickup",
"name_ar": "استلام بالسيارة",
"image_url": null,
"created_at": 1792593341102,
"updated_at": 1792593341102,
"icon_id": null
},
"methods": [],
"products": []
}
}{
"meta": {
"code": 401,
"status": "error",
"message": "Unauthenticated."
},
"data": null
}{
"meta": {
"code": 403,
"status": "error",
"message": "Unauthorized."
},
"data": null
}{
"meta": {
"code": 404,
"status": "error",
"message": "Resource not found."
},
"data": null
}{
"meta": {
"code": 422,
"status": "error",
"message": "The Name (English) field is required when type key is not present."
},
"data": [
{
"code": 0,
"message": "The Name (English) field is required when type key is not present.",
"field": "name_en"
}
]
}{
"meta": {
"code": 500,
"status": "error",
"message": "Internal server error."
},
"data": null
}