ITEM_DELIVERED
Buy with Prime API is now available for early access
Sign up for early access to the Buy with Prime API using the 'Sign Up' button below. The API may change as Amazon receives feedback and iterates on it.
Note: This event is the same as the DELIVERY_COMPLETED
event. We recommend that you use the DELIVERY_COMPLETED
event instead.
The ITEM_DELIVERED
event is published when one or more items were delivered to their destination. Typically, this event means that the shopper has received some or all items that they ordered.
The following examples are ways that you might use this event:
- To enable customer service agents to see that an item was delivered, so that they can give the customer accurate information if the customer reaches out by phone or email.
- To enable developers to update their order management system and all of the downstream systems. Examples of downstream systems are analytics and reporting on business performance, accounting for remitting taxes, customer service agents helping customers who reach out, and so on.
When you receive this event, you typically query the order to fetch the delivery information for all line items in the order. For details, see Handling the event.
Required permission
To subscribe to this event, your API credentials must have at least Read Order permission. You choose permissions when you generate your API credentials. For details, see Authenticate to the Buy with Prime API.
Schema
{
"version": "0",
"id": "example-event-id",
"detail-type": "ITEM_DELIVERED",
"source": "aws.partner/buywithprime/partner-event-source-name",
"account": "example-aws-account-id",
"time": "2023-10-27T12:34:56Z",
"region": "us-east-1",
"resources": [
"businessProduct/business-product-id/order/order-id/delivery/delivery-id",
],
"detail": {}
}
Fields
Key | Data Type | Description |
---|---|---|
version | String | Amazon EventBridge event version. |
id | String | Amazon EventBridge-generated UUID for an event. |
detail-type | String | Type schema for the detail of the event, which in this case is ITEM_DELIVERED . |
source | String | Name of the partner event source in Amazon EventBridge. |
account | String | AWS account ID that hosts the partner event source. |
time | String | ISO 8601 timestamp that indicates when the event was published. |
region | String | AWS region from which the event is published. |
resources | Array of strings | Array of identifiers for the resources that triggered the event, in key-value pair format. Each resource identifier is a string that starts with businessProduct/{businessProductId}/ , followed by resource types (keys) and resource IDs (values) separated by slashes. For details about how to interpret resources , see How to process events. |
detail | Object | JSON object that contains details about the event. For this event, this object is empty; you must call the Buy with Prime API to find further information about the resource(s) specified in the resources array. |
Handling the event
When you receive this event, take the following steps:
- Parse the
resources
array of the event to get the order ID and delivery ID. - Using the order ID that you found in the
resources
array in the previous step, make an API call to theorder
query. For examples of how to perform this query, see Query a Buy with Prime Order. - In the response, navigate to the
lineItems.deliveryInformation.details
array and find the element with the delivery ID that you found in theresources
array of the event in step 1. There, you will find the details of delivery and a set of products delivered together to the customer. Several lines items can have the same delivery ID.
Note: Depending on the moment that you call the Buy with Prime API with respect to delivery progress, the value of thestate
attribute in the delivery details is eitherIN_TRANSIT
,CANCELLED
, orDELIVERED
. For more information, seeITEM_IN_TRANSIT
andITEM_CANCELLED
.
Related topics
Updated 3 days ago