Product API
Fulfillment guide
Recommendation
POST Find complementary items

POST Find complementary items

For each item in the request body, returns an array of complementary items that are available in the selected store. By default, an item can have up to five complementary items.

POST api.foodin.ai/users/{user_id}/complementary_items

Request

Method Parameters

FieldTypeDescription
user_idstringThe ID of the user.

Request

FieldTypeDescription
location_codestringThe location code of the store to use for inventory. Complementary items are selected from this store.
cart_idstringThe ID of the cart.
max_complementary_itemsintegerThe maximum number of suggested complementary items to be returned. Defaults to 5.
itemsArrayAn array of items. Complementary items are retrieved for each of these items.

Items object

FieldTypeDescription
line_numstringThe line number
itemItemThe item.

Item object

FieldTypeDescription
rrcstringThe item's store reference code (rrc).

Request example

var request = require("request");
 
var options = {
  method: "POST",
  url: "https://api.foodin.ai/users/{user_id}/replacement_items",
  headers: {
    Accept: "application/json",
    Authorization: "Bearer <token>",
    "Content-Type": "application/json",
  },
  body: {
    max_replacement_items: 1,
  },
  json: true,
};

Response

200 Success

{
  "complementary_items": [
    {
      "upc": "11111111111111"
    }
  ]
}

4XX Errors

Error responses return either a single error or multiple errors.

Error codeError Message
400Could not find specified store.
400User Not Found