Retail Orders - Item Unavailable Actions
In submitting an order as per Create Order, the customer's preference for actions to take if items are unavailable can be set as below example;
{
"items": [
{
"plu": "COLA1",
"name": "Coca Cola",
"price": 450,
"quantity": 1,
"itemUnavailableActions": [
"ITEM_AMENDMENT",
"ITEM_REMOVE",
"ITEM_SUBSTITUTION",
"CANCEL_ORDER",
"ITEM_SUBSTITUTION_CUSTOMER"
]
}
]
}
Substitution Preference
Action | Meaning |
---|---|
ITEM_AMENDMENT | Change the quantity of the item or remove it |
ITEM_REMOVE | Remove the item from the order |
ITEM_SUBSTITUTION | Replace the item by another item, free of choice |
CANCEL_ORDER | Cancel the entire order |
ITEM_SUBSTITUTION_CUSTOMER | Replace the item by another preselected item by the customer* |
Substitution Preference
WhereITEM_SUBSTITUTION_CUSTOMER
is selected, this should be accompanied by an array substituteCandidate
that is a list of items the customer has selected as appropriate substitutions.
{
"items": [
{
"plu": "COLA1",
"name": "Coca Cola",
"price": 450,
"quantity": 1,
"itemUnavailableActions": [
"ITEM_SUBSTITUTION_CUSTOMER"
],
"substituteCandidate": [
{
"plu": "LEM1",
"name": "Lemonade",
"quantity": 1,
"price": 450
},
{
"plu": "PEP1",
"name": "Pepsi",
"quantity": 1,
"price": 450
},
]
}
]
}
Parameter | Meaning | Type |
---|---|---|
items.plu * | Unique reference for the product | string |
items.name * | Item name | string |
items.price * | Price of the item with 2 decimal digit precision e.g. $1.00 is set as 100 | integer |
items.quantity | Item quantity | integer |
items.itemUnavailableActions | The customer's preference for actions to take if items are unavailable (see Substitution Preference) | enum array |
substituteCandidate.plu | Unique reference for a substituted product | string |
substituteCandidate.name | Name of a substituted product | string |
substituteCandidate.quantity | Specifying the quantity of substituted items accepted is optional | integer |
substituteCandidate.price | The price of the substituted item with 2 decimal digit precision e.g. $1.00 is set as 100 | integer |
Please note that all the fields marked with ( ( * ) ) will be required