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
default You can retrieve your token by logging in.
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.
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": "9bd06e25-d57c-425b-b766-4107c7c28e49",
"market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
"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": 1787446696233,
"updated_at": 1787446696233,
"icon_id": null,
"type": {
"key": "CURBSIDE_PICKUP",
"name_en": "Curbside Pickup",
"name_ar": "استلام بالسيارة",
"image_url": null,
"created_at": 1787446696232,
"updated_at": 1787446696232,
"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 en field is required when type key is not present."
},
"data": [
{
"code": 0,
"message": "The name en field is required when type key is not present.",
"field": "name_en"
}
]
}{
"meta": {
"code": 500,
"status": "error",
"message": "Internal server error."
},
"data": null
}