Preview time slots for pickup
POST /v2/fulfillment/service_options/pickup
Previews possible service options for pickup fulfillments.
Use this endpoint when customers have yet to sign in, register, or start shopping, but you want to give them a preview of the pickup time slots that might be available to them at checkout.
Based on the store location_code in your request, the returned service_options[] reflect current and anticipated shopper availability.
By default, all service_options[] have a window.type of scheduled. To retrieve an eta time slot, set with_eta_options to true. You can also get a priority_eta time slot by setting with_priority_eta_options to true.
These service_options[] are for preview purposes only. Don't select one of their id or service_option_reference values and then use it to reserve a standard or reserve a desired window time slot, respectively. Doing so increases the probability that order creation will fail.
To reduce the chances of that happening, always select an id or service_option_reference returned by a list time slots for pickup request and use it to make a reservation.
For details, see Preview time slots.
Security
| Name | In | Description |
|---|---|---|
Authorization | header | The Authorization header with the bearer token acquired during authentication. |
Request
| Field | Type | Required | Description |
|---|---|---|---|
location_code | string | The location code of the store fulfilling the order. | |
cart_total_cents | integer | The total value of all items for the order in cents. | |
items_count | integer | The number of items in the order. | |
with_eta_options | boolean | Returns ETA options instead of immediate when true. For more information, contact your Instacart Representative. Defaults to false. |
Request examples
- cURL
- Java
- Python
- Go
curl --request POST \
--url https://connect.instacart.com/v2/fulfillment/service_options/pickup \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"location_code": "string",
"cart_total_cents": 1,
"items_count": 1,
"with_eta_options": true
}'
HttpResponse<String> response = Unirest.post("https://connect.instacart.com/v2/fulfillment/service_options/pickup")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer <token>")
.body("{\n \"location_code\": \"string\",\n \"cart_total_cents\": 1,\n \"items_count\": 1,\n \"with_eta_options\": true\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
payload = "{\n \"location_code\": \"string\",\n \"cart_total_cents\": 1,\n \"items_count\": 1,\n \"with_eta_options\": true\n}"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'Authorization': "Bearer <token>"
}
conn.request("POST", "/v2/fulfillment/service_options/pickup", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://connect.instacart.com/v2/fulfillment/service_options/pickup"
payload := strings.NewReader("{\n \"location_code\": \"string\",\n \"cart_total_cents\": 1,\n \"items_count\": 1,\n \"with_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, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response
None.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. |
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
4XX Errors
Error responses return either a single error or multiple errors.
| HTTP Code | Cause | Error Message | Error Code | Error Meta |
|---|---|---|---|---|
400 | Invalid location code | "Specified store is not available for pickup." | 1001 | {"key":"location_code"} |