Replenish Endpoint
Replenish is the core API used to place an order for a device/slot combination. Calling the Replenish endpoint will order the ASIN selected by your customer during device registration. The replenish endpoint is able to place both test and real orders, depending on the LwA scope data that was used when registering the customer. For more information, please read the Test Device Purchases documentation.
- Path
- HTTP Method
- Header Parameters
- Versioning
- Response Example
- Response Example Details
- Error Responses
Path
/replenish/{SLOT_ID}
HTTP Method
POST
Header Parameters
Authorization: Bearer (ACCESS_TOKEN)
x-amzn-accept-type: com.amazon.dash.replenishment.DrsReplenishResult@1.0
x-amzn-type-version: com.amazon.dash.replenishment.DrsReplenishInput@1.0
Versioning
Versioning is used to incrementally update API functionality without directly impacting customers. x-amzn-type-version
and x-amzn-accept-type
headers must be sent with each call. The following are supported by the Replenish Endpoint:
x-amzn-type-version: com.amazon.dash.replenishment.DrsReplenishInput@1.0
x-amzn-accept-type: com.amazon.dash.replenishment.DrsReplenishResult@1.0
Response Example
HTTP/1.1 200 Accepted
x-amzn-type-version: com.amazon.dash.replenishment.DrsReplenishResult@1.0
Content-Type: application/json
{
"eventInstanceId" : "SOME_EVENT_INSTANCE"
"detailCode" : "STANDARD_ORDER_PLACED"
}
Response Example Details
A successful response does not indicate that a purchase actually occurred. A successful response indicates that Amazon has accepted the request and performed some processing. On any accepted order, Amazon will provide:
eventInstanceId
: used to map order notifications back to the original purchase event. This will be up to 255 char long.detailCode
: describes the order result
The following detailCode
values are used:
Responses | Description |
---|---|
STANDARD_ORDER_PLACED |
An order was successfully placed and will be shipped to the customer. |
TEST_ORDER_PLACED |
An order was successfully placed with the test flag. All notifications will proceed normally but the customer will not be charged and the item will not ship. |
ORDER_INPROGRESS |
No order was placed because an order is already in progress. This value will be returned as long as there is an order still out for delivery to the customer. |
Error Responses
Error Response | Description |
---|---|
HTTP/1.1 400 Bad Request | Client Error: An error occurred due to data passed in by the client (e.g. bad token). Amazon will make a best effort to provide feedback on the nature of the failure in the response body. |
HTTP/1.1 404 Not Found | Client Error: Attempting to replenish a non-existing slot. |
HTTP/1.1 500 | Internal Server Error: Indicates that an error occurred internally to the server. |
Last updated: Aug 07, 2018