List time slots for delivery
POST /v2/fulfillment/users/{user_id}/service_options/cart/delivery
Lists the available delivery service options for the customer's location and cart items. In this context, service options are time slots, such as Within 5 hours or Friday 9am-11am. Availability is based on current and anticipated shopper availability for the relevant store and delivery location.
By default, the time slots returned are immediate and scheduled time slots. If ETA options are enabled in your retailer configuration, you can retrieve ETA time slots instead of immediate time slots. To get a standard ETA time slot with the scheduled time slots, set the with_eta_options
field to true
. To also retrieve a priority ETA time slot, set the with_priority_eta_options
field to true
. For more information, see Retrieve an ETA time slot.
If the customer address is more than 30 minutes away from the selected store, the long_distance_delivery
flag is set to true
. You can deliver to this address if long distance delivery is enabled for the store. For more information, see Service areas for delivery.
If you’d like more flexibility with your time slots, you can send Instacart your desired windows. Instacart uses your desired windows to map to available service options and returns the available time slots for the desired windows. For more information, see Desired windows.
After a time slot is selected, save the service_option_id
or service_option_reference
.
- To reserve a time slot for a desired window, you specify the
service_option_reference
. - To reserve a time slot without a desired window, you specify the
service_option_id
.
Include all the items in the cart in the request. Connect can surface any errors—such as items missing from the catalog—early in the user flow and also precompute some validations to optimize performance.
Order item limitations
If your request specifies an order containing items that exceed any of the following limitations, the request fails:
- Maximum total quantity of items
- Maximum total weight of beverage items
- Maximum quantity of large or bulky items
For more information, see the returned error message.
Security
Name | In | Description |
---|---|---|
Authorization | header | The Authorization header with the bearer token acquired during authentication. |
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
user_id | path | string | The ID of the user. |
Request
Field | Type | Required | Description |
---|---|---|---|
address | Address | The address for the delivery. | |
items | Array(OrderItem) | The items for delivery. | |
desired_windows | Array(DesiredWindow) | The desired windows for service options. | |
location_code | string | The store location code used to look-up cart items. | |
with_eta_options | boolean | Returns ETA options instead of immediate when true. For more information, contact your Instacart Representative. Defaults to false. | |
with_priority_eta_options | boolean | Returns Priority ETA options instead of immediate when true. For more information, contact your Instacart Representative. Defaults to false. |
Address Object
Field | Type | Required | Description |
---|---|---|---|
address_line_1 | string | The first address line. | |
address_line_2 | string | The second address line. | |
address_type | string | The type of address, e.g., "residential". | |
postal_code | string | The postal/zip code of the address. |
OrderItem Object
Field | Type | Required | Description |
---|---|---|---|
line_num | string | The item's line number in the order. | |
count | integer | The count of the item. Must be a non-negative integer. | |
weight | number | For items sold by weight, the numerical weight of the item. The API interprets this value as whatever unit of measure is defined for the item in the catalog, such as lb or kg. Must be a non-negative number. | |
special_instructions | string | Any special instructions about the item selection. | |
replacement_policy | string | One of "no_replacements", "users_choice" (default if replacement_items specified), or "shoppers_choice" (default otherwise). | |
replacement_items | Array(Replacement_items) | A list of requested replacement items if the original item could not be found. This field needs to be turned on via configuration. Contact your Instacart Connect representative. | |
item | Item | The item's code. |
Replacement_items Object
One of the following:
Field | Type | Required | Description |
---|---|---|---|
upc | string | The item's universal product code (upc). |
or
Field | Type | Required | Description |
---|---|---|---|
rrc | string | The item's retailer reference code (rrc). |
Item Object
One of the following:
Field | Type | Required | Description |
---|---|---|---|
upc | string | The item's universal product code (upc). |
or
Field | Type | Required | Description |
---|---|---|---|
rrc | string | The item's retailer reference code (rrc). |
DesiredWindow Object
Field | Type | Required | Description |
---|---|---|---|
starts_at | string | Start time of the desired window in ISO 8601 format. | |
ends_at | string | End time of the desired window in ISO 8601 format. |
Request examples
- cURL
- Java
- Python
- Go
curl --request POST \
--url 'https://connect.instacart.com/v2/fulfillment/users/{user_id}/service_options/cart/delivery' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"address": {
"address_line_1": "string",
"address_line_2": "string",
"address_type": "string",
"postal_code": "string"
},
"items": [
{
"line_num": "string",
"count": 1,
"weight": 1,
"special_instructions": "string",
"replacement_policy": "no_replacements",
"replacement_items": [
{
"upc": "string"
}
],
"item": {
"upc": "string"
}
}
],
"desired_windows": [
{
"starts_at": "string",
"ends_at": "string"
}
],
"location_code": "string",
"with_eta_options": true,
"with_priority_eta_options": true
}'
HttpResponse<String> response = Unirest.post("https://connect.instacart.com/v2/fulfillment/users/{user_id}/service_options/cart/delivery")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer <token>")
.body("{\n \"address\": {\n \"address_line_1\": \"string\",\n \"address_line_2\": \"string\",\n \"address_type\": \"string\",\n \"postal_code\": \"string\"\n },\n \"items\": [\n {\n \"line_num\": \"string\",\n \"count\": 1,\n \"weight\": 1,\n \"special_instructions\": \"string\",\n \"replacement_policy\": \"no_replacements\",\n \"replacement_items\": [\n {\n \"upc\": \"string\"\n }\n ],\n \"item\": {\n \"upc\": \"string\"\n }\n }\n ],\n \"desired_windows\": [\n {\n \"starts_at\": \"string\",\n \"ends_at\": \"string\"\n }\n ],\n \"location_code\": \"string\",\n \"with_eta_options\": true,\n \"with_priority_eta_options\": true\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
payload = "{\n \"address\": {\n \"address_line_1\": \"string\",\n \"address_line_2\": \"string\",\n \"address_type\": \"string\",\n \"postal_code\": \"string\"\n },\n \"items\": [\n {\n \"line_num\": \"string\",\n \"count\": 1,\n \"weight\": 1,\n \"special_instructions\": \"string\",\n \"replacement_policy\": \"no_replacements\",\n \"replacement_items\": [\n {\n \"upc\": \"string\"\n }\n ],\n \"item\": {\n \"upc\": \"string\"\n }\n }\n ],\n \"desired_windows\": [\n {\n \"starts_at\": \"string\",\n \"ends_at\": \"string\"\n }\n ],\n \"location_code\": \"string\",\n \"with_eta_options\": true,\n \"with_priority_eta_options\": true\n}"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'Authorization': "Bearer <token>"
}
conn.request("POST", "/v2/fulfillment/users/{user_id}/service_options/cart/delivery", 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/v2/fulfillment/users/{user_id}/service_options/cart/delivery"
payload := strings.NewReader("{\n \"address\": {\n \"address_line_1\": \"string\",\n \"address_line_2\": \"string\",\n \"address_type\": \"string\",\n \"postal_code\": \"string\"\n },\n \"items\": [\n {\n \"line_num\": \"string\",\n \"count\": 1,\n \"weight\": 1,\n \"special_instructions\": \"string\",\n \"replacement_policy\": \"no_replacements\",\n \"replacement_items\": [\n {\n \"upc\": \"string\"\n }\n ],\n \"item\": {\n \"upc\": \"string\"\n }\n }\n ],\n \"desired_windows\": [\n {\n \"starts_at\": \"string\",\n \"ends_at\": \"string\"\n }\n ],\n \"location_code\": \"string\",\n \"with_eta_options\": true,\n \"with_priority_eta_options\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response
Field | Type | Required | Description |
---|---|---|---|
service_options | Array(ServiceOption) | The returned service options. | |
warnings | Array(Error) | Any warnings associated with this request. | |
flags | Flags | Additional properties of the address. |
ServiceOption Object
Field | Type | Required | Description |
---|---|---|---|
id | integer | The ID of the service option. | |
service_option_reference | string | The reference of the service option. | |
date | string | The date the service will take place in ISO 8601 format. | |
handoff_time | string | The ETA for shopper to arrive at store. | |
window | Window | The time window when the service will take place. | |
availability | OptionAvailability | The availability of this service option. |
OptionAvailability Object
Field | Type | Required | Description |
---|---|---|---|
available | boolean | Indicates if this service option is available for the user. | |
reasons | Array(string) | The reasons for unavailability of a service option. Currently, the reasons are related to the laws governing the sale of alcohol. For example, restrictions on quantity, delivery time, pickup, and matched city and county of stores and customers. The reasons are subject to change without notice. | |
item_codes | Array(string) | The item codes which caused the option to be unavailable. |
Window Object
One of the following:
Field | Type | Required | Description |
---|---|---|---|
start_at | string | The start of the delivery window in ISO 8601 format. | |
end_at | string | The end of the delivery window in ISO 8601 format. | |
type | string | The type of service option. One of 'scheduled', 'eta' (contact your Instacart Connect representative), or 'asap' (contact your Instacart Connect representative). | |
asap | boolean | Indicates if delivery will happen as soon as possible. Only true when type is asap. |
or
Field | Type | Required | Description |
---|---|---|---|
immediate_hour | integer | Indicates the number of hours after order creation that delivery will occur. | |
type | string | Indicates this is an immediate option. Defaults to immediate. |
Error Object
Field | Type | Required | Description |
---|---|---|---|
error | ErrorDetails | Information relevant to the error. | |
meta | MetaError | The error metadata. |
ErrorDetails Object
Field | Type | Required | Description |
---|---|---|---|
message | string | The error message. | |
error_code | integer | The error code. |
MetaError Object
Field | Type | Required | Description |
---|---|---|---|
items | Array(ItemInfo) | The items that triggered the error. |
ItemInfo Object
Field | Type | Required | Description |
---|---|---|---|
item_code | string | The retailer reference code (RRC) or universal product code (UPC) of an item that triggered the error. |
Flags Object
Field | Type | Required | Description |
---|---|---|---|
long_distance_delivery | boolean | Whether a delivery to the address will be a long distance delivery. |
Reasons for unavailability of a service option
Reason | Description |
---|---|
State law restricts amount of {beer/wine/spirits} to {#} fl oz, cart quantity is: {#} fl oz. | The quantity of this alcohol type exceeds the state law limit. |
Error validating alcohol quantities. Please try again. | The quantity of alcohol can’t be validated. |
Unmatched city and county | The city and county of the store and customer must match. |
Cannot deliver alcohol to this postal code | Instacart can’t deliver alcohol to this postal code. |
State law doesn't allow delivery of alcohol in this window | Instacart can’t deliver alcohol in this delivery window because of state law. |
Response examples
200 Success
200
With unavailability reasons200
With warnings200
Cart service options returned
{
"service_options": [
{
"id": 5,
"service_option_reference": "ezppZD0-NSwgOnR5cGU9PiJTY2hlZHVsZWREZWxpdmVyeU9wdGlvbiIsIDp3aW5kb3c9PjxJbnN0YWNhcnQ6OkVudGVycHJpc2U6OkJvYmE6OkNvcmU6OlR5cGVzOjpWMTo6U2VydmljZU9wdGlvblNjaGVkdWxlZFdpbmRvdzogZGVzY3JpcHRvcjogIiIsIHN0YXJ0X2F0OiA8R29vZ2xlOjpQcm90b2J1Zjo6VGltZXN0YW1wOiBzZWNvbmRzOiAxNTE5MjU3NjAwLCBuYW5vczogMD4sIGVuZF9hdDogPEdvb2dsZTo6UHJvdG9idWY6OlRpbWVzdGFtcDogc2Vjb25kczogMTUxOTI2NDgwMCwgbmFub3M6IDA-Pn0=",
"date": "2018-02-22",
"window": {
"start_at": "2018-02-22T00:00:00Z",
"end_at": "2018-02-22T02:00:00Z",
"type": "scheduled",
"asap": false
},
"availability": {
"available": false,
"reasons": [
"State law doesn't allow delivery of alcohol in this window"
],
"item_codes": [
"000000004011"
]
}
}
],
"warnings": []
}
{
"service_options": [
{
"id": 27,
"service_option_reference": "ezppZD0-MjcsIDp0eXBlPT45LCA6d2luZG93PT48SW5zdGFjYXJ0OjpDdXN0b21lcnM6OkF2YWlsYWJpbGl0eTo6VjE6OlRpbWVzdGFtcFdpbmRvdzogc3RhcnRzX2F0OiA8R29vZ2xlOjpQcm90b2J1Zjo6VGltZXN0YW1wOiBzZWNvbmRzOiAxNTE5MjY0ODAwLCBuYW5vczogMD4sIGVuZHNfYXQ6IDxHb29nbGU6OlByb3RvYnVmOjpUaW1lc3RhbXA6IHNlY29uZHM6IDE1MTkyNzIwMDAsIG5hbm9zOiAwPj59",
"date": "2018-02-21",
"window": {
"start_at": "2018-02-22T02:00:00Z",
"end_at": "2018-02-22T04:00:00Z",
"type": "scheduled",
"asap": false
},
"availability": {
"available": true,
"reasons": [],
"item_codes": []
}
},
{
"id": 28,
"service_option_reference": "ezppZD0-MjgsIDp0eXBlPT40LCA6d2luZG93PT48SW5zdGFjYXJ0OjpDdXN0b21lcnM6OkF2YWlsYWJpbGl0eTo6VjE6OlRpbWVzdGFtcFdpbmRvdzogc3RhcnRzX2F0OiA8R29vZ2xlOjpQcm90b2J1Zjo6VGltZXN0YW1wOiBzZWNvbmRzOiAxNTE5MjY0ODAwLCBuYW5vczogMD4sIGVuZHNfYXQ6IDxHb29nbGU6OlByb3RvYnVmOjpUaW1lc3RhbXA6IHNlY29uZHM6IDE1MTkyNzIwMDAsIG5hbm9zOiAwPj59",
"date": "2018-02-21",
"window": {
"immediate_hour": 2,
"type": "immediate"
},
"availability": {
"available": true,
"reasons": [],
"item_codes": []
}
},
{
"id": 29,
"service_option_reference": "ezppZD0-MjksIDp0eXBlPT43LCA6d2luZG93PT48SW5zdGFjYXJ0OjpDdXN0b21lcnM6OkF2YWlsYWJpbGl0eTo6VjE6OlRpbWVzdGFtcFdpbmRvdzogc3RhcnRzX2F0OiA8R29vZ2xlOjpQcm90b2J1Zjo6VGltZXN0YW1wOiBzZWNvbmRzOiAxNzE2OTA5Mjc4LCBuYW5vczogNzEyOTEwNDY-LCBlbmRzX2F0OiA8R29vZ2xlOjpQcm90b2J1Zjo6VGltZXN0YW1wOiBzZWNvbmRzOiAxNzE2OTE2NDc4LCBuYW5vczogNzEyOTEwNDY-Pn0=",
"date": "2024-05-28",
"window": {
"start_at": "2024-05-28T15:14:38Z",
"end_at": "2024-05-28T17:14:38Z",
"type": "eta",
"asap": false
},
"availability": {
"available": true,
"reasons": [],
"item_codes": []
}
}
],
"warnings": [
{
"error": {
"message": "1 item not found.",
"error_code": 2000
},
"meta": {
"items": [
{
"item_code": "000000004011"
}
]
}
}
]
}
{
"service_options": [
{
"id": 159,
"service_option_reference": "ezppZD0-MTU5LCA6dHlwZT0-OSwgOndpbmRvdz0-PEluc3RhY2FydDo6Q3VzdG9tZXJzOjpBdmFpbGFiaWxpdHk6OlYxOjpUaW1lc3RhbXBXaW5kb3c6IHN0YXJ0c19hdDogPEdvb2dsZTo6UHJvdG9idWY6OlRpbWVzdGFtcDogc2Vjb25kczogMTUxOTI2NDgwMCwgbmFub3M6IDA-LCBlbmRzX2F0OiA8R29vZ2xlOjpQcm90b2J1Zjo6VGltZXN0YW1wOiBzZWNvbmRzOiAxNTE5MjcyMDAwLCBuYW5vczogMD4-fQ==",
"date": "2018-02-21",
"window": {
"start_at": "2018-02-22T02:00:00Z",
"end_at": "2018-02-22T04:00:00Z",
"type": "scheduled",
"asap": false
},
"availability": {
"available": true,
"reasons": [],
"item_codes": []
}
},
{
"id": 160,
"service_option_reference": "ezppZD0-MTYwLCA6dHlwZT0-NCwgOndpbmRvdz0-PEluc3RhY2FydDo6Q3VzdG9tZXJzOjpBdmFpbGFiaWxpdHk6OlYxOjpUaW1lc3RhbXBXaW5kb3c6IHN0YXJ0c19hdDogPEdvb2dsZTo6UHJvdG9idWY6OlRpbWVzdGFtcDogc2Vjb25kczogMTUxOTI2NDgwMCwgbmFub3M6IDA-LCBlbmRzX2F0OiA8R29vZ2xlOjpQcm90b2J1Zjo6VGltZXN0YW1wOiBzZWNvbmRzOiAxNTE5MjcyMDAwLCBuYW5vczogMD4-fQ==",
"date": "2018-02-21",
"window": {
"immediate_hour": 2,
"type": "immediate"
},
"availability": {
"available": true,
"reasons": [],
"item_codes": []
}
},
{
"id": 161,
"service_option_reference": "ezppZD0-MTYxLCA6dHlwZT0-NywgOndpbmRvdz0-PEluc3RhY2FydDo6Q3VzdG9tZXJzOjpBdmFpbGFiaWxpdHk6OlYxOjpUaW1lc3RhbXBXaW5kb3c6IHN0YXJ0c19hdDogPEdvb2dsZTo6UHJvdG9idWY6OlRpbWVzdGFtcDogc2Vjb25kczogMTcxNjkwOTI3OCwgbmFub3M6IDcxMjkxMDQ2PiwgZW5kc19hdDogPEdvb2dsZTo6UHJvdG9idWY6OlRpbWVzdGFtcDogc2Vjb25kczogMTcxNjkxNjQ3OCwgbmFub3M6IDcxMjkxMDQ2Pj59",
"date": "2024-05-28",
"window": {
"start_at": "2024-05-28T15:14:38Z",
"end_at": "2024-05-28T17:14:38Z",
"type": "eta",
"asap": false
},
"availability": {
"available": true,
"reasons": [],
"item_codes": []
}
}
],
"warnings": [],
"flags": {
"long_distance_delivery": false
}
}
4XX Errors
Error responses return either a single error or multiple errors.
HTTP Code | Cause | Error Message | Error Code | Error Meta |
---|---|---|---|---|
400 | User Not Found | "User Not Found" | 1001 | {"key":"user_id"} |
400 | Invalid location code | "Could not find specified store." | 1001 | {"key":"location_code"} |
400 | No stores found | "No store location found for given address." | 1001 | Not applicable |
400 | Invalid items | "1 item not found." | 2000 | {"upcs":["123"],"items":[{"item_upc":"123"}],"error_name":"ItemNotFoundError"} |
400 | Cannot deliver to address | "Unfortunately, we cannot deliver to that area." | 1001 | {"key":"address"} |
400 | Store does not support delivery to address | "We do not currently support delivery from this store to the selected address." | 1001 | {"key":"address"} |
400 | Invalid Quantity, expected weight | "One of these items had an invalid quantity amount, 0001234567892 expected weight" | 2012 | {"upc":"0001234567892","item_code":"0001234567892","expected_param":"weight","error_name":"WrongQuantityParameterError"} |
400 | Invalid Quantity, expected count | "One of these items had an invalid quantity amount, 0001234567892 expected count" | 2012 | {"upc":"0001234567892","item_code":"0001234567892","expected_param":"count","error_name":"WrongQuantityParameterError"} |
400 | Invalid Quantity, expected count or weight | "One of these items had an invalid quantity amount, 0001234567892 expected count or weight" | 2012 | {"upc":"0001234567892","item_code":"0001234567892","expected_param":"count or weight","error_name":"WrongQuantityParameterError"} |
400 | Duplicate items were provided | "Duplicate items provided for this order." | 2007 | {"duplicate_items":[{"item_rrc":1234,"item_upc":"0001234567892","line_num":2}],"error_name":"DuplicateItemsError"} |
400 | Priority ETA options not configured | "Priority ETA options are not configured for this retailer." | 1001 | {"key":"filters.with_priority_eta_options"} |
400 | ETA options not configured | "ETA options are not configured for this retailer." | 1001 | {"key":"filters.with_eta_options"} |
400 | Without address | "can't be blank" | 1001 | {"key":"address"} |
400 | Some items are not deliverable | "Some items are not deliverable" | 2005 | {"items":[{"item_rrc":"133631"},{"item_rrc":"133631"}]} |
400 | Too many items | "The number of items in your cart exceeds our maximum limit for a single delivery. Please remove 10 items from your cart to continue." | 2024 | Not applicable |
400 | Too much beverage | "The weight of beverages in your cart exceeds our maximum limit for a single delivery. Please remove 150 lbs of beverages from your cart to continue." | 2026 | Not applicable |
400 | Too many big and bulky items | "The number of big and bulky items in your cart exceeds our maximum limit for a single delivery. Please remove 2 such items from your cart to continue." | 2023 | {"items":[]} |
400 | Too much weight | "The total weight of items in your cart exceeds our maximum limit for a single delivery. Please remove 15 lb from your cart to continue." | 2027 | {"over_weight_amount":15,"weight_unit":"lb"} |
403 | User Not Active | "User Not Active" | null | Not applicable |
404 | Resource not found | "Resource not found" | 4000 | Not applicable |