Create or update items
PUT /v1/items/{id}
Creates or updates a menu item in the FoodStorm OMS. You must include all item properties and values in the request. After you use this endpoint to create or update an item, all future updates to that item must be done by using this API; you can't use the FoodStorm user interface to update the item.
danger
When updating an existing item, specify all properties. An unspecified property is interpreted as having an empty value and any pre-existing value for that property is deleted.
For more information and best practices about items, see Items.
Security
Name | In | Description |
---|---|---|
Authorization | header | Standard Authorization header using the Bearer scheme. Example: "bearer {token}" |
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | A unique identifier for this menu item, defined by the retailer. |
Request
Field | Type | Required | Description |
---|---|---|---|
name | string | The name of the item, as displayed on the storefront. Must be unique. | |
code | string | The code for this item. The code can be the same as or different from the item_id. The code can be used for barcode scanning. | |
description | string | Description of the item in Markdown format. HTML is not supported. | |
category | string | The storefront category to display this item in. The value must match the name of an existing category in FoodStorm, e.g. Turkeys. | |
alias_categories | Array(string) | Optionally display this item in other categories in the storefront. | |
department | string | The department of the item within the site (e.g. Deli). The value must match the name of an existing department in FoodStorm. | |
visibility | string | Default visibility of the item, but can be overridden at the site level. One of "VisibleShoppingCart" (visible within the OMS and on the storefront), "Visible" (visible within the OMS only), or "Hidden" (hidden for the OMS and the storefront). | |
unit_type | string | The unit type of the item, such as “each”, “oz”, or “lb”. When weight.type is "Open" or "Approx", the unit type must be a valid weight type (e.g. “lb”). | |
min_units | number | Minimum units when ordered. When weight.type is "Approx", this field is not supported. | |
max_units | number | Maximum units when ordered. When weight.type is "Approx", this field is not supported. | |
alcohol | boolean | When the item is alcoholic, set to true. Default is false. | |
images | Array(string) | Array of URLs to publicly accessible images. Provide the highest resolution available. FoodStorm will autoscale the images for web display. | |
tags | Array(string) | Array of dietary tag strings. For the list of valid values, see the "Tags values" table at the end of this section. | |
ingredients | string | List of ingredients in Markdown format. HTML is not supported. | |
warnings | string | List of warnings for the item in Markdown format. HTML is not supported. | |
cut_off | Cut_Off | The cutoff time details. | |
availability | Availability | The availability details for the item. | |
weight | Weight | The weight details for the item. | |
selections | Selections | The selections details for the item. |
Cut_Off Object
Field | Type | Required | Description |
---|---|---|---|
type | string | One of "Default" (the system default cutoff), "FixedTime" (a fixed time of day cutoff), or "Rolling" (cut off based on a rolling lead time in minutes). | |
time | string | When cut_off.type = "FixedTime", the cut-off time at the site. Format is HH:mm. | |
days_before | integer | When cut_off.type = "FixedTime", the lead time in days. | |
minutes | integer | When cut_off.type = "Rolling", the lead time in minutes. |
Availability Object
Field | Type | Required | Description |
---|---|---|---|
days_of_week | Array(integer) | Array of days when the item can be ordered. Integer values are: 0 (Sunday), 1 (Monday), 2 (Tuesday), and so on. By default, the item can be ordered on any day. | |
from_time | string | Restrict ordering before the specified time of day. Format is HH:mm. By default, the item can be ordered whenever the site opens. | |
to_time | string | Restrict ordering after the specified time of day. Format is HH:mm. By default, the item can be ordered until the site closes. | |
date_range_type | string | One of "Available" (the item is available during this date range) or "Unavailable" (the item is not available during this date range). Note: To enable quantity limits to be applied, set to "Available" and set the availability dates. | |
from_date | string | The available/unavailable from date. This is a calendar date in the site's time zone, not UTC. | |
to_date | string | The available/unavailable to date. This is a calendar date in the site's time zone, not UTC. |
Weight Object
Field | Type | Required | Description |
---|---|---|---|
type | string | One of "Fixed" (for items sold by unit/each), "Open" (for open weighted items, e.g. deli meats), or "Approx" (for items with an approx weight, e.g. turkeys). | |
approx | number | Required when weight.type is "Approx". The approximate weight. | |
approx_to | number | Optional when weight.type is "Approx". The upper approximate weight range. |
Selections Object
Field | Type | Required | Description |
---|---|---|---|
template | string | The selection template to use. The value must match the name of an existing selection template in FoodStorm. | |
selections | Array(Selection) | When a selection template is not in use, specify the available selections for this item. |
Selection Object
Field | Type | Required | Description |
---|---|---|---|
name | string | The name of the selection. Letters and numbers only. Special characters are not supported, including colons (:) and ampersands (&). | |
type | string | One of "SingleSelection" (the user must select a single option) or "MultipleSelection" (the user can select multiple options). | |
description | string | Descriptive text for the selection. The text is displayed on the storefront. | |
max_selections | integer | When type = "MultipleSelection", an optional limit on the maximum number of options that can be selected. Omit value for no maximum. | |
options | Array(Option) | The options that can be selected. |
Option Object
Field | Type | Required | Description |
---|---|---|---|
name | string | The name of the option. | |
image | string | An image for the option. Provide the highest resolution available. FoodStorm will autoscale the images for web display. | |
surcharge | number | The surcharge for this option. By default, there is no surcharge. | |
default | boolean | Set to true to have this option selected by default. |
tags
values
Tag | Description |
---|---|
cel | Celery |
df | Dairy Free |
e | Eggs |
f | Fish |
g | Gluten |
gf | Gluten Free |
h | Halal |
k | Kosher |
kd | Kosher Dairy |
km | Kosher Meat |
kp | Kosher Pareve |
l | Lupin |
lg | Low Gluten |
low_fat | Low Fat |
m | Milk |
mol | Mollusks |
mu | Mustard |
n | Nuts |
organic | Organic |
p | Peanuts |
s | Soy |
sd | Sulphur Dioxide |
se | Sesame |
sh | Shellfish |
sugar_free | Sugar Free |
v | Vegetarian |
vg | Vegan |
Request Examples
- cURL
- Java
- Python
- Go
curl --request PUT \
--url 'https://connect.instacart.com/v1/items/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: string' \
--header 'Content-Type: application/json' \
--data '{
"name": "string",
"code": "string",
"description": "string",
"category": "string",
"alias_categories": [
"string"
],
"department": "string",
"visibility": "Visible",
"unit_type": "string",
"min_units": 1,
"max_units": 1,
"alcohol": true,
"images": [
"string"
],
"tags": [
"string"
],
"ingredients": "string",
"warnings": "string",
"cut_off": {
"type": "Default",
"time": "23:00",
"days_before": 1,
"minutes": 1
},
"availability": {
"days_of_week": [
1
],
"from_time": "09:00",
"to_time": "19:00",
"date_range_type": "Available",
"from_date": "2023-01-01",
"to_date": "2023-01-02"
},
"weight": {
"type": "Fixed",
"approx": 1,
"approx_to": 1
},
"selections": {
"template": "string",
"selections": [
{
"name": "string",
"type": "SingleSelection",
"description": "string",
"max_selections": 1,
"options": [
{
"name": "string",
"image": "string",
"surcharge": 1,
"default": true
}
]
}
]
}
}'
HttpResponse<String> response = Unirest.put("https://connect.instacart.com/v1/items/{id}")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "string")
.body("{\n \"name\": \"string\",\n \"code\": \"string\",\n \"description\": \"string\",\n \"category\": \"string\",\n \"alias_categories\": [\n \"string\"\n ],\n \"department\": \"string\",\n \"visibility\": \"Visible\",\n \"unit_type\": \"string\",\n \"min_units\": 1,\n \"max_units\": 1,\n \"alcohol\": true,\n \"images\": [\n \"string\"\n ],\n \"tags\": [\n \"string\"\n ],\n \"ingredients\": \"string\",\n \"warnings\": \"string\",\n \"cut_off\": {\n \"type\": \"Default\",\n \"time\": \"23:00\",\n \"days_before\": 1,\n \"minutes\": 1\n },\n \"availability\": {\n \"days_of_week\": [\n 1\n ],\n \"from_time\": \"09:00\",\n \"to_time\": \"19:00\",\n \"date_range_type\": \"Available\",\n \"from_date\": \"2023-01-01\",\n \"to_date\": \"2023-01-02\"\n },\n \"weight\": {\n \"type\": \"Fixed\",\n \"approx\": 1,\n \"approx_to\": 1\n },\n \"selections\": {\n \"template\": \"string\",\n \"selections\": [\n {\n \"name\": \"string\",\n \"type\": \"SingleSelection\",\n \"description\": \"string\",\n \"max_selections\": 1,\n \"options\": [\n {\n \"name\": \"string\",\n \"image\": \"string\",\n \"surcharge\": 1,\n \"default\": true\n }\n ]\n }\n ]\n }\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
payload = "{\n \"name\": \"string\",\n \"code\": \"string\",\n \"description\": \"string\",\n \"category\": \"string\",\n \"alias_categories\": [\n \"string\"\n ],\n \"department\": \"string\",\n \"visibility\": \"Visible\",\n \"unit_type\": \"string\",\n \"min_units\": 1,\n \"max_units\": 1,\n \"alcohol\": true,\n \"images\": [\n \"string\"\n ],\n \"tags\": [\n \"string\"\n ],\n \"ingredients\": \"string\",\n \"warnings\": \"string\",\n \"cut_off\": {\n \"type\": \"Default\",\n \"time\": \"23:00\",\n \"days_before\": 1,\n \"minutes\": 1\n },\n \"availability\": {\n \"days_of_week\": [\n 1\n ],\n \"from_time\": \"09:00\",\n \"to_time\": \"19:00\",\n \"date_range_type\": \"Available\",\n \"from_date\": \"2023-01-01\",\n \"to_date\": \"2023-01-02\"\n },\n \"weight\": {\n \"type\": \"Fixed\",\n \"approx\": 1,\n \"approx_to\": 1\n },\n \"selections\": {\n \"template\": \"string\",\n \"selections\": [\n {\n \"name\": \"string\",\n \"type\": \"SingleSelection\",\n \"description\": \"string\",\n \"max_selections\": 1,\n \"options\": [\n {\n \"name\": \"string\",\n \"image\": \"string\",\n \"surcharge\": 1,\n \"default\": true\n }\n ]\n }\n ]\n }\n}"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'Authorization': "string"
}
conn.request("PUT", "/v1/items/{id}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://connect.instacart.com/v1/items/{id}"
payload := strings.NewReader("{\n \"name\": \"string\",\n \"code\": \"string\",\n \"description\": \"string\",\n \"category\": \"string\",\n \"alias_categories\": [\n \"string\"\n ],\n \"department\": \"string\",\n \"visibility\": \"Visible\",\n \"unit_type\": \"string\",\n \"min_units\": 1,\n \"max_units\": 1,\n \"alcohol\": true,\n \"images\": [\n \"string\"\n ],\n \"tags\": [\n \"string\"\n ],\n \"ingredients\": \"string\",\n \"warnings\": \"string\",\n \"cut_off\": {\n \"type\": \"Default\",\n \"time\": \"23:00\",\n \"days_before\": 1,\n \"minutes\": 1\n },\n \"availability\": {\n \"days_of_week\": [\n 1\n ],\n \"from_time\": \"09:00\",\n \"to_time\": \"19:00\",\n \"date_range_type\": \"Available\",\n \"from_date\": \"2023-01-01\",\n \"to_date\": \"2023-01-02\"\n },\n \"weight\": {\n \"type\": \"Fixed\",\n \"approx\": 1,\n \"approx_to\": 1\n },\n \"selections\": {\n \"template\": \"string\",\n \"selections\": [\n {\n \"name\": \"string\",\n \"type\": \"SingleSelection\",\n \"description\": \"string\",\n \"max_selections\": 1,\n \"options\": [\n {\n \"name\": \"string\",\n \"image\": \"string\",\n \"surcharge\": 1,\n \"default\": true\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "string")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Examples
200 Success
200
The item has been updated201
The item has been created
{
// Empty
}
4XX Errors
Error responses return either a single error or multiple errors.
HTTP Code | Cause | Error Message | Error Code | Error Meta |
---|---|---|---|---|
400 | Item Category Not Found | "" | "" | Not applicable |