Skip to main content

Create a last mile delivery order (single call)

POST /v2/fulfillment/lastmile/orders

Creates a last mile delivery order. If you have integrated with the Instacart service option system, you can pass a service option ID from a previous call to use for the order. Otherwise, you can pass a start and end date window in ISO 8601 format and we will attempt to find the first available service option in the given search window.

You can see which service option window was used for the order in the fulfillment_details section of the response.

note

If no available service options are found for the requested window, the order creation call fails.

Security#

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

Parameters#

Request#

FieldTypeRequiredDescription
order_idstringUnique ID to use for this order, can be used later for lookup.
location_codestringโœ…Location code returned by location api.
start_atstringThe requested delivery window start time in ISO 8601 format.
end_atstringThe requested delivery window end time in ISO 8601 format.
service_option_idintegerThe ID of the service option for the order.
localestringThe order's locale in IETF Language Tag format. Example: en-US.
first_namestringโœ…The user's first name.
last_namestringโœ…The user's last name.
user_phonestringโœ…The user's phone number.
emailstringThe user's email.
initial_tip_centsintegerThe pre-delivery tip in cents.
items_countintegerโœ…The number of items in the order.
bags_countintegerThe number of bags in the order.
items_weightnumberโœ…The weight of the items in lbs.
cart_totalnumberThe gross merchandise value (gmv) of the cart.
alcoholicbooleanIndicator whether order contains alcohol. Defaults to false.
leave_unattendedbooleanIndicator if the user wants to the driver to leave the order unattended. Defaults to false.
special_instructionsstringSpecial instructions about the order to pass on to the shopper.
customer_sms_opt_outbooleanIndicator whether the user has opted-out from receiving SMS communication. Defaults to false.
addressAddressโœ…The address of the user.

Address Object#

FieldTypeRequiredDescription
address_line_1stringโœ…The first address line.
address_line_2stringThe second address line.
address_typestringThe type of address, e.g., "residential".
postal_codestringโœ…The postal/zip code of the address.

Request Examples#

curl --request POST \  --url https://connect.instacart.com/v2/fulfillment/lastmile/orders \  --header 'Accept: application/json' \  --header 'Authorization: Bearer <token>' \  --header 'Content-Type: application/json' \  --data '{  "order_id": "string",  "location_code": "string",  "start_at": "string",  "end_at": "string",  "service_option_id": 1,  "locale": "string",  "first_name": "string",  "last_name": "string",  "user_phone": "string",  "email": "string",  "initial_tip_cents": 1,  "items_count": 1,  "bags_count": 1,  "items_weight": 1,  "cart_total": 1,  "alcoholic": true,  "leave_unattended": true,  "special_instructions": "string",  "customer_sms_opt_out": true,  "address": {    "address_line_1": "string",    "address_line_2": "string",    "address_type": "string",    "postal_code": "string"  }}'

Response#

FieldTypeRequiredDescription
idstringโœ…The ID of the order.
statusstringโœ…The current order status.
order_urlstringLink to view the order.
created_atstringThe time of order creation in ISO 8601 format.
cancellation_reasonstringThe reason the order was canceled.
localestringThe order's locale in POSIX format. Example: en_US.
fulfillment_detailsFulfillment_detailsThe order delivery details.

Fulfillment_details Object#

FieldTypeRequiredDescription
store_locationstringThe location code of the store where the order was fulfilled. The store_location is often the same as the location_code that was used to create the order. However, orders can be fulfilled from a different store location.
window_starts_atstringโœ…The start time of the delivery window in ISO 8601 format.
window_ends_atstringโœ…The end time of the delivery window in ISO 8601 format.
delivered_atstringThe time the order was delivered at in ISO 8601 format.
bag_countintegerThe number of bags in the order.

Response Examples#

{  "id": "12345676789012345678780",  "status": "created",  "order_url": "https://example.com/example-order",  "created_at": "2018-02-22T00:00:00Z",  "cancellation_reason": "",  "locale": "en_US",  "fulfillment_details": {    "window_starts_at": "2018-02-22T00:00:00Z",    "window_ends_at": "2018-02-22T00:00:00Z"  }}