Skip to main content

List time slots for pickup

POST /v2/fulfillment/users/{user_id}/service_options/cart/pickup

Lists the available pickup 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 location. The list includes immediate and scheduled time slots.

After a time slot is selected, save the service_option_id. You specify the ID when reserving the time slot.

Best practice

Include all the items in the cart in the request. Connect can surface any errorssuch as items missing from the catalogearly in the user flow and also precompute some validations to optimize performance.

Security

NameInDescription
AuthorizationheaderThe Authorization header with the bearer token acquired during authentication.

Parameters

NameInTypeRequiredDescription
user_idpathstringRequiredThe ID of the user.

Request

FieldTypeRequiredDescription
itemsArray(OrderItem)RequiredThe items for delivery.
location_codestringRequiredThe location code of the store fulfilling the order.
with_eta_optionsbooleanOptionalReturns ETA options instead of immediate when true. For more information, contact your Instacart Representative. Defaults to false.

OrderItem Object

FieldTypeRequiredDescription
line_numstringRequiredThe item's line number in the order.
countintegerOptionalThe count of the item. Must be a non-negative integer.
weightnumberOptionalFor 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_instructionsstringOptionalAny special instructions about the item selection.
replacement_policystringOptionalOne of "no_replacements", "users_choice" (default if replacement_items specified), or "shoppers_choice" (default otherwise).
replacement_itemsArray(Replacement_items)OptionalA 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.
itemItemRequiredThe item's code.

Replacement_items Object

One of the following:

FieldTypeRequiredDescription
upcstringRequiredThe item's universal product code (upc).

or

FieldTypeRequiredDescription
rrcstringRequiredThe item's retailer reference code (rrc).

Item Object

One of the following:

FieldTypeRequiredDescription
upcstringRequiredThe item's universal product code (upc).

or

FieldTypeRequiredDescription
rrcstringRequiredThe item's retailer reference code (rrc).

Request examples

curl --request POST \
--url 'https://connect.instacart.com/v2/fulfillment/users/{user_id}/service_options/cart/pickup' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"items": [
{
"line_num": "string",
"count": 1,
"weight": 1,
"special_instructions": "string",
"replacement_policy": "no_replacements",
"replacement_items": [
{
"upc": "string"
}
],
"item": {
"upc": "string"
}
}
],
"location_code": "string",
"with_eta_options": true
}'

Response

FieldTypeRequiredDescription
service_optionsArray(ServiceOption)RequiredThe returned service options.
warningsArray(Error)OptionalAny warnings associated with this request.
flagsFlagsOptionalAdditional properties of the address.

ServiceOption Object

FieldTypeRequiredDescription
idintegerRequiredThe ID of the service option.
service_option_referencestringOptionalThe reference of the service option.
datestringRequiredThe date the service will take place in ISO 8601 format.
handoff_timestringOptionalThe ETA for shopper to arrive at store.
windowWindowRequiredThe time window when the service will take place.
availabilityOptionAvailabilityRequiredThe availability of this service option.

OptionAvailability Object

FieldTypeRequiredDescription
availablebooleanRequiredIndicates if this service option is available for the user.
reasonsArray(string)OptionalThe 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_codesArray(string)OptionalThe item codes which caused the option to be unavailable.

Window Object

One of the following:

FieldTypeRequiredDescription
start_atstringRequiredThe start of the delivery window in ISO 8601 format.
end_atstringRequiredThe end of the delivery window in ISO 8601 format.
typestringRequiredThe type of service option. One of 'scheduled', 'eta' (contact your Instacart Connect representative), or 'asap' (contact your Instacart Connect representative).
asapbooleanOptionalIndicates if delivery will happen as soon as possible. Only true when type is asap.

or

FieldTypeRequiredDescription
immediate_hourintegerRequiredIndicates the number of hours after order creation that delivery will occur.
typestringRequiredIndicates this is an immediate option. Defaults to immediate.

Error Object

FieldTypeRequiredDescription
errorErrorDetailsOptionalInformation relevant to the error.
metaMetaErrorOptionalThe error metadata.

ErrorDetails Object

FieldTypeRequiredDescription
messagestringOptionalThe error message.
error_codeintegerOptionalThe error code.

MetaError Object

FieldTypeRequiredDescription
itemsArray(ItemInfo)OptionalThe items that triggered the error.

ItemInfo Object

FieldTypeRequiredDescription
item_codestringOptionalThe retailer reference code (RRC) or universal product code (UPC) of an item that triggered the error.

Flags Object

FieldTypeRequiredDescription
long_distance_deliverybooleanOptionalWhether a delivery to the address will be a long distance delivery.

Reasons for unavailability of a service option

ReasonDescription
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 countyThe city and county of the store and customer must match.
Unfortunately alcohol pickup is not available at this location. Please remove alcohol from your basket or try delivery.Alcohol pickup is not available at this location.

Response examples

200 Success

{
"service_options": [
{
"id": 204,
"service_option_reference": "ezppZD0-MjA0LCA6dHlwZT0-MSwgOndpbmRvdz0-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": 205,
"service_option_reference": "ezppZD0-MjA1LCA6dHlwZT0-MTYsIDp3aW5kb3c9PjxJbnN0YWNhcnQ6OkN1c3RvbWVyczo6QXZhaWxhYmlsaXR5OjpWMTo6VGltZXN0YW1wV2luZG93OiBzdGFydHNfYXQ6IDxHb29nbGU6OlByb3RvYnVmOjpUaW1lc3RhbXA6IHNlY29uZHM6IDE1MTkyNjQ4MDAsIG5hbm9zOiAwPiwgZW5kc19hdDogPEdvb2dsZTo6UHJvdG9idWY6OlRpbWVzdGFtcDogc2Vjb25kczogMTUxOTI3MjAwMCwgbmFub3M6IDA-Pn0=",
"date": "2018-02-21",
"window": {
"start_at": "2018-02-22T02:00:00Z",
"end_at": "2018-02-22T04:00:00Z",
"type": "eta",
"asap": false
},
"availability": {
"available": true,
"reasons": [],
"item_codes": []
}
}
],
"warnings": []
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400User Not Found"User Not Found"1001{"key":"user_id"}
400Duplicate items were provided"Duplicate items provided for this order."2007{"duplicate_items":[{"item_rrc":1234,"item_upc":"0001234567892","line_num":2}],"error_name":"DuplicateItemsError"}
400Invalid 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"}
400Invalid 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"}
400Invalid 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"}
400Invalid location code"Specified store is not available for pickup."1001{"key":"location_code"}
400Invalid items"1 item not found."2000{"upcs":["123"],"items":[{"item_upc":"123"}],"error_name":"ItemNotFoundError"}
403User Not Active"User Not Active"nullNot applicable
404Resource not found"Resource not found"4000Not applicable