POST Reccomendation items from order
For each item in an order, returns an array of suggested replacement items that are available in the selected store. By default, an item can have up to five replacement items
POST api.foodin.ai/users/{user_id}/orders/{order_id}/replacement_items
Request
Method Parameters
Field | Type | Description |
---|---|---|
order_id | String | The ID of the order |
user_id | string | The ID of the user. |
Request parameters
Field | Type | Description |
---|---|---|
max_replacement_items | integer | The maximum number of suggested replacement items to be returned for each item. Defaults to 5. |
Request example
var request = require("request");
var options = {
method: "POST",
url: "https://api.foodin.ai/users/{user_id}/orders/{order_id}/replacement_items",
headers: {
Accept: "application/json",
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: {
max_replacement_items: 1,
},
json: true,
};
Items array
Field | Type | Description |
---|---|---|
items | Array | The items and their suggested replacement items. |
Item object
Field | Type | Description |
---|---|---|
upc | string | The item's universal product code (upc). |
rrc | string | The item's store reference code (rrc). |
stock_level | string | The stock level of the item. One of IN_STOCK, LOW_STOCK, or OUT_OF_STOCK. |
Replacement_items object
Field | Type | Description |
---|---|---|
upc | string | The item's universal product code (upc). |
rrc | string | The item's store reference code (rrc). |
stock_level | string | The stock level of the item. One of IN_STOCK, LOW_STOCK, or OUT_OF_STOCK. |
Response
200 Success
{
"items": [
{
"line_num": "1",
"item": {
"upc": "01111041600",
"stock_level": "in_stock"
},
"replacement_items": [
{
"upc": "01111223440",
"stock_level": "in_stock"
}
]
}
]
}
4XX Errors
Error responses return either a single error or multiple errors.
Error code | Error Message |
---|---|
400 | Could not find specified store. |
400 | User Not Found |