Enterprisesku: an existing condiment is updated, otherwise a new one is created. Condiments that are not in items are not changed.GET /imports/:id) using import_id.price is created without item definitions, so it is not on sale.| Field | Default | Required | Description |
|---|---|---|---|
| target_ids | enterprise, all properties and revenue centers | valid resource ids: enterprise, property or revenue center | |
| items | REQUIRED | ||
| items[].sku | REQUIRED | Unique within the request and across menu items and condiments | |
| items[].condiment_group_id | REQUIRED | An active condiment group of the enterprise | |
| items[].name | REQUIRED for a new sku | ||
| items[].price | |||
| items[].active | |||
| items[].printable | true | ||
| items[].tax_id | null removes the tax | ||
| items[].price_list_id | null removes the price list | ||
| items[].report_tag_ids | When sent, replaces the report tags of the condiment | ||
| items[].translations | [] | ||
| items[].extra_fields | [] | REQUIRED | Shared with menu items. The requirement varies depending on the system configuration |
422, returned before the request is queued)| Message | Reason |
|---|---|
items required | items is missing or empty |
sku required | An item has no sku |
condiment_group_id required | An item has no condiment_group_id |
Duplicated sku: <skus> | The same sku is sent more than once |
Invalid condiment_group_id | Not an active condiment group of the enterprise |
Invalid tax_id | Not an active tax of the enterprise |
Invalid price_list_id | Not a price list of the enterprise |
Invalid report_tag_ids | At least one id is not a report tag of the enterprise |
Invalid extra field keys | An extra field has no key or no value |
Invalid extra field values | An extra field has an empty key or value |
Invalid extra fields: <names> | No extra field with these names is defined for the enterprise |
Condiment API is not enabled | The endpoint is not enabled for this environment |
sku that is already used by a menu item) are not returned here; the import is marked failed with the error message.curl --location 'https://api.simpra.app/apps/api/v1/condiments/upsert' \
--header 'Simpra-Access-Token: <api-key>' \
--header 'Content-Type: application\json' \
--data '{
"target_ids": [
"3f8a1d26-9b47-4e53-8c10-5d29a6f73b81"
],
"items": [
{
"sku": "CND-001",
"name": "Ekstra Peynir",
"condiment_group_id": "6f3b2c10-8d4e-4a19-9f21-0b7c5e3a1d44",
"price": 25,
"active": true,
"printable": true,
"tax_id": "b1e7a904-3c62-4f88-8d15-7a92c4e60b33",
"price_list_id": "0d5f1a77-2b83-4c90-a6e4-9f31d8b02c56",
"report_tag_ids": [
"e4c8b210-59a3-4d77-b8f1-2c60a9e34d85"
],
"translations": [
{
"locale": "tr",
"text": "Ekstra Peynir"
},
{
"locale": "en",
"text": "Extra Cheese"
}
],
"extra_fields": [
{
"key": "ErpKodu",
"value": "10045"
}
]
},
{
"sku": "CND-002",
"name": "Acı Sos",
"condiment_group_id": "6f3b2c10-8d4e-4a19-9f21-0b7c5e3a1d44",
"price": 0,
"active": true,
"printable": false
},
{
"sku": "CND-003",
"name": "Ekstra Sos",
"condiment_group_id": "6f3b2c10-8d4e-4a19-9f21-0b7c5e3a1d44",
"active": false
}
]
}'{
"success": true,
"import_id": "f28c6b40-1e95-4a73-b0d6-8c47e29f51a3"
}