Create Purchases
Amazon will call the Company Ordering Connector API to pass information like shopper identities, payment sources, carts, and cart items. The use of the Ordering connector will enable the Company to implement logic to calculate order totals after applying promotions and discounts to the shopper cart. The Company will also be able to apply loyalty and taxes as applicable.
The Ordering Connector serves as a common API for customers who use Amazon's Just Walkout and Dashcart services. Please refer to the appropriate section for the Company's implementation.
Requests made through the Ordering Connector must be idempotent—meaning no additional effects should occur if Amazon calls your API more than once using the same parameters. Please refer to the idempotentShoppingTripId key for more information on how to ensure the requests are idempotent.
Note: In the future, new attributes might be added. We recommend that you structure your code so that it can handle new attributes gracefully.
Create Purchases
Amazon will use the Company /v1/order/purchases endpoint to create a purchase record
POST /v1/order/purchases
Body parameter
{
"requestId": "string",
"idempotentShoppingTripId": "string",
"storeId": "string",
"shoppingTrip": {
"startTime": "2024-03-22T17:09:39Z",
"endTime": "2024-03-22T17:09:39Z",
"authEvents": [
{
"id": "string",
"timestamp": "2025-05-02T00:05:18Z",
"location": "ENTRY",
"payloadType": "FINANCIAL",
"scanResult": {
"id": "string",
"type": "SHOPPER"
}
}
]
},
"cartItems": [
{
"id": "string",
"type": "SKU",
"quantity": {
"value": "string",
"unit": "string"
},
"externalIdentifiers": [
{
"id": "string",
"type": "UPC"
}
],
"lineItemId": "string"
}
],
"shopperIdentity": {
"id": "string"
},
"shopperDeviceId": "string",
"paymentSource": {
"id": "string"
}
}
| Data Field | Required | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| requestId | Required | The requestId field contains a UUID ,Universally Unique Identifier,for each checkout request. Amazon generates this UUID for each request | |||||||||||||||||||||||||||||||||||||||||||||
| idempotentShoppingTripId | Required | The idempotentShoppingTripId field contains a Universally Unique ID (UUID) for the current shopping trip. Amazon generates a UUID for each shopping trip. The API uses this UUID to ensure that the service correctly handles multiple calls to the API using the same information with no unintended side-effects. In other words, the idempotentShoppingTripId ensures that calls to the API are idempotent. Compare the idempotentShoppingTripId to the requestId field | |||||||||||||||||||||||||||||||||||||||||||||
| storeId | Required | <= 255 characters. The storeId field contains a unique identifier for your store. This identifier is the store ID you defined during your onboarding process with Amazon. You also use this storeId when uploading your catalog into the JWO portal | |||||||||||||||||||||||||||||||||||||||||||||
| shoppingTrip | Required | object (ShoppingTrip) . Provides details about a shopping trip's significant events.Properties
|
|||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
| cartItems | Required | Array of objects (CartItem). The cartItems field contains a list of JSON objects that define each item in the shopper’s cart | |||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
| shopperIdentity | Optional | object (ShopperIdentity). Uniquely identifies a shopper. This value is returned by Identity connector APIs for integrations also implementing the Identity connector | |||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
| shopperDeviceId | Optional | <= 255 characters. The shopperDeviceId field holds a UUID value that uniquely identifies the shopper’s mobile device. This ID will remain consistant for all of the shopper’s shopping trips as long as they use the same device | |||||||||||||||||||||||||||||||||||||||||||||
| paymentSource | The paymentSource object contains optional information about the source of payment for this transaction. The object contains a single id field, which is required if the paymentSource field is present | ||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
Example responses
> 200 Response{
"purchaseId": "string"
}
| Data Field | Required | Description |
|---|---|---|
| purchaseID | Required | string <= 255 characters .The PurchaseId is a unique identifier for the shopping trip as represented in the Company system. The PurchaseId can be used as a reference to track the shopping cart across the Amazon and Company systems. For example if an empty cart is returned, the purchaseId can be set to an empty string. If the cart contains items, the purchaseId can be set to a unique value in the Company's system |
Error example responses
{
"message": "string"
}
422 PurchaseRejected example
{
"__type": "PurchaseRejected",
"errorMsg": "1 cart item(s) were rejected.",
"rejectedItems": [
{
"id": "SKU-1001",
"type": "SCANCODE",
"reason": "SKU_NOT_FOUND",
"detail": "not in catalog",
"lineItemId": "line-1"
}
]
}
Status code response samples
| Status | Meaning | Description |
|---|---|---|
| 201 | OK | You will respond with a 201 status code after successfully validating the API content against the API model and accepting all cart items in the request. |
| 400 | Bad Request | The API returns a 400 Bad Request Error when requests to the Ordering Connector might be missing a required value or an incorrect data type is passed to the API |
| 401 | Unauthorized | You will respond with a 401 AuthorizationDeclined Error when requests to the Ordering Connector does not contain the correct authorization. For example the Amazon IAM role is not allow listed in the Company's API Gateway |
| 422 | Purchase Rejected | You will respond with a 422 PurchaseRejected error when the request is well-formed but one or more cart items cannot be accepted. For example, the SKU or scancode is not present in the catalog, the item is not sellable, the price is unavailable, or the requested quantity is invalid. The response should include an errorMsg summary and a rejectedItems list identifying each rejected item and the machine-readable rejection reason. |
| 404 | Not Found | You will respond with a 404 when the request is made to an unknown resource. For example the Company's invoke URL is not properly configured within the Amazon system |
| 429 | Throttling 429 response | You will respond with a 429 when the service needs to throttle it's caller. Caller is instructed to retry after backoff when this error occurs. |
| 500 | Internal Server Error | You will respond with a 500 ServerError when the Ordering Connector fails due to a server issue. For example an un-handled exception or error occurs when processing the Amazon API call. |
| 503 | Service Unavailable | You will respond with a 503 ServiceUnavailable when the Ordering Connector is unavailable. For example the Company's endpoint is down for unplanned activity or for maintenance |

