Skip to main content

Preview time slots for delivery

POST /v2/fulfillment/service_options/delivery

Lists the available delivery service options for the specified postal code. In this context, service options are time slots. Availability is based on current and anticipated shopper availability for the relevant store and delivery location.

Use this endpoint when you want to display a list of available time slots before a customer logs in or starts shopping. By default, the time slots returned are immediate and scheduled time slots. To get an ETA time slot with the scheduled time slots, set the with_eta_options field to true. For more information about ETAs and the preview scenario, see Service options.

If you permit a potential customer to select a preview time slot, save the service_option_id. When the customer is ready to check out, call Reserve a time slot with the service_option_id.

If you don't permit a potential customer to select a preview time slot, or if you need to prompt the customer to pick a different time slot, call List time slots for delivery at checkout.

Best practice

Order creation might fail because the preview time slot isn't available anymore when the customer checks out. To reduce the chance of order creation failing, call List time slots for delivery to get a list of validated time slots. Save the service_option_id, and then call Reserve a time slot.

Security

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

Parameters

None.

Request

FieldTypeRequiredDescription
postal_codestringRequiredThe postal code for delivery.
cart_total_centsintegerOptionalThe total value of all items for the order in cents.
items_countintegerOptionalThe number of items in the order.
with_eta_optionsbooleanOptionalReturns ETA options instead of immediate when true. For more information, contact your Instacart Representative. Defaults to false.
with_priority_eta_optionsbooleanOptionalReturns Priority ETA options instead of immediate when true. For more information, contact your Instacart Representative. Defaults to false.
desired_windowsArray(DesiredWindow)OptionalThe desired windows for service options.

DesiredWindow Object

FieldTypeRequiredDescription
starts_atstringRequiredStart time of the desired window in ISO 8601 format.
ends_atstringRequiredEnd time of the desired window in ISO 8601 format.

Request examples

curl --request POST \
--url https://connect.instacart.com/v2/fulfillment/service_options/delivery \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"postal_code": "string",
"cart_total_cents": 1,
"items_count": 1,
"with_eta_options": true,
"with_priority_eta_options": true,
"desired_windows": [
{
"starts_at": "string",
"ends_at": "string"
}
]
}'

Response

FieldTypeRequiredDescription
service_optionsArray(ServiceOption)RequiredThe returned service options.

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.

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.
Cannot deliver alcohol to this postal codeInstacart can’t deliver alcohol to this postal code.
State law doesn't allow delivery of alcohol in this windowInstacart can’t deliver alcohol in this delivery window because of state law.

Response examples

200 Success

{
"service_options": [
{
"id": 15,
"service_option_reference": "ezppZD0-MTUsIDp0eXBlPT4iU2NoZWR1bGVkRGVsaXZlcnlPcHRpb24iLCA6d2luZG93PT48SW5zdGFjYXJ0OjpFbnRlcnByaXNlOjpCb2JhOjpDb3JlOjpUeXBlczo6VjE6OlNlcnZpY2VPcHRpb25TY2hlZHVsZWRXaW5kb3c6IGRlc2NyaXB0b3I6ICIiLCBzdGFydF9hdDogPEdvb2dsZTo6UHJvdG9idWY6OlRpbWVzdGFtcDogc2Vjb25kczogMTUxOTI1NzYwMCwgbmFub3M6IDA-LCBlbmRfYXQ6IDxHb29nbGU6OlByb3RvYnVmOjpUaW1lc3RhbXA6IHNlY29uZHM6IDE1MTkyNjQ4MDAsIG5hbm9zOiAwPj59",
"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": true,
"reasons": [],
"item_codes": []
}
}
]
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400Missing postal code"can't be blank"1001{"key":"postal_code"}
404Resource not found"Resource not found"4000Not applicable