Skip to main content

Handle order item replacement

PUT /v2/post_checkout/orders/{order_id}/items/{order_item_id}/replacement

Approve a replacement made to an item while the order is being shopped or request a refund. Replacements must be resolved before the shopper has checked out.

Security

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

Parameters

NameInTypeRequiredDescription
order_idpathstringRequired

The order ID.

order_item_idpathstringRequired

The order item ID.

Request

FieldTypeRequiredDescription
statusstringRequired

The requested status of the replacement. One of 'APPROVED' or 'REJECTED'.

alternative_itemHashOptional

Alternative item suggestion when rejecting a replacement.

Request examples

curl --request PUT \
--url 'https://connect.instacart.com/v2/post_checkout/orders/{order_id}/items/{order_item_id}/replacement' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"status": "APPROVED",
"alternative_item": {
"key1": "value1",
"key2": "value2"
}
}'

Response

None.

Response examples

200 Success

{
// Empty
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400Cannot provide both rrc and upc"must include exactly one of rrc or upc"1001{"key":"alternative_item"}
400Cannot provide both count and weight"must include exactly one of count or weight"1001{"key":"alternative_item"}
400Must provide count or weight"must include exactly one of count or weight"1001{"key":"alternative_item"}
400Count must be greater than 0"count must be greater than 0"1001{"key":"alternative_item"}
400Weight must be greater than 0"weight must be greater than 0"1001{"key":"alternative_item"}
400Could not resolve alternative item"Could not resolve alternative item to a valid product"1001Not applicable
400Order item change already responded to"This order item change has already been responded to"4001Not applicable
400Order item change no longer modifiable"This order item change can no longer be modified"4001Not applicable
400alternative_item with APPROVED status"can only be provided when status is REJECTED"1001{"key":"alternative_item"}
400alternative_item without rrc or upc"must include exactly one of rrc or upc"1001{"key":"alternative_item"}
400Status not present*"There were issues with your request"9999Not applicable
400Status not valid"is not included in the list"1001{"key":"status"}
400Order was not created with Fulfillment v3, trying to fetch with client credentials"User ID not found"4001Not applicable
404No active order item change found"No active order item change found for item qwertyuiop"4000Not applicable
404Order not found"Resource not found"4000Not applicable
404Order item not found"Order item 1111 not found"4000Not applicable
* Multiple error