Get order items
GET /v2/post_checkout/orders/{order_id}/items
Retrieves the list of items in the order. Each item in the list includes item details of the ordered item, the current status of that item, and the current replacement for that item, if one exists. Item details include the name, quantity ordered, and cost unit.
The following table describes the list of valid item statuses:
Status | Description |
---|---|
APPROVED | Replacement approved by customer. |
FOUND | Original item requested found by shopper. |
REJECTED | Replacement rejected by customer. |
REPLACED | Item replaced. |
TO_REFUND | Item to be refunded. |
NOT_PICKED | Not picked yet. |
Security
Name | In | Description |
---|---|---|
Authorization | header | The Authorization header with the bearer token acquired during authentication. |
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
order_id | path | string | The ID of the order. | |
X-Treat-Ids-As-Internal | header | boolean |
Request
None.Request examples
- cURL
- Java
- Python
- Go
curl --request GET \
--url 'https://connect.instacart.com/v2/post_checkout/orders/{order_id}/items' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'X-Treat-Ids-As-Internal: true'
HttpResponse<String> response = Unirest.get("https://connect.instacart.com/v2/post_checkout/orders/{order_id}/items")
.header("Accept", "application/json")
.header("Authorization", "Bearer <token>")
.header("X-Treat-Ids-As-Internal", "true")
.asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
headers = {
'Accept': "application/json",
'Authorization': "Bearer <token>",
'X-Treat-Ids-As-Internal': "true"
}
conn.request("GET", "/v2/post_checkout/orders/{order_id}/items", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://connect.instacart.com/v2/post_checkout/orders/{order_id}/items"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Treat-Ids-As-Internal", "true")
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 |
---|---|---|---|
line_items | Array(LineItem) | Array of order line items. |
LineItem Object
Field | Type | Required | Description |
---|---|---|---|
id | string | The ID of the line item. | |
replacement_status | string | The current status of the replacement for this item if one exists. | |
status | string | The current status of this item. | |
certified_delivery | boolean | Whether the line item requires certified delivery. | |
item | OrderItem | The order line item. | |
replacement | OrderItem | The replacement for this item if one exists. |
OrderItem Object
Field | Type | Required | Description |
---|---|---|---|
name | string | The name of the item. | |
image_url | string | The URL of the item image. | |
quantity | string | The number of items. | |
cost_unit | string | The unit of item quantity. |
Response examples
200 Success
200
Order items fetched
{
"line_items": [
{
"id": "qwertyuiop",
"replacement_status": "SUBSTITUTION_STATUS_UNSPECIFIED",
"status": "REPLACED",
"certified_delivery": false,
"item": {
"name": "Bananas",
"image_url": "fakeUrl.com",
"quantity": "30.0",
"cost_unit": "LB"
},
"replacement": {
"name": "Bananas",
"image_url": "fakeUrl.com",
"quantity": "30.0",
"cost_unit": "LB"
}
}
]
}
4XX Errors
Error responses return either a single error or multiple errors.
HTTP Code | Cause | Error Message | Error Code | Error Meta |
---|---|---|---|---|
404 | Order items not found | "Resource not found" | 4000 | Not applicable |