PACKAGE_DELIVERY_IN_TRANSIT

📘

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.

The PACKAGE_DELIVERY_IN_TRANSIT event is published when one or more items in the specified order were shipped. Typically, this event is published when the item(s) are being delivered to the recipient's address.

This event was previously called DELIVERY_IN_TRANSIT.

The following examples are ways that you might use this event:

  • To enable customers to see on various touchpoints (for example, merchant order history, Amazon order history, Buy with Prime order details) that their item has been shipped. This helps customers be confident that the delivery estimate will be met.
  • To enable customer service agents to see that an item has shipped, so that they can give the customer updated information if the customer reaches out by phone or email.
  • To enable developers to write code to signal the order management system when to collect payment from the customer. Payment can only be collected when the item has shipped.
  • To enable supply chain managers to see when items are fulfilled, so that they can evaluate the performance of their logistics network to make more informed decisions about where to improve.

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

Schema for webhook destinations
{
    "idempotencyKey":"example-idempotency-key",
    "eventDescriptor": "PACKAGE_DELIVERY_IN_TRANSIT",
    "resources": [
        "businessProduct/business-product-id/order/order-id/delivery/delivery-id"
    ],
    "eventId":"example-event-id",
    "apiVersion": "2024-11-01",
    "subscriptionId": "example-subscription-id",
    "eventTime":"2025-01-20T12:34:56Z",
    "data": {}
}
Schema for Amazon EventBridge destinations
{
    "version": "0",
    "id": "example-event-id",
    "detail-type": "PACKAGE_DELIVERY_IN_TRANSIT",
    "source": "aws.partner/buywithprime/partner-event-source-name",
    "account": "example-aws-account-id",
    "time": "2025-01-20T12:34:56Z",
    "region": "us-east-1",
    "resources": [
        "businessProduct/business-product-id/order/order-id/delivery/delivery-id"
    ], 
    "detail": {
        "idempotencyKey":"example-idempotency-key",
        "eventDescriptor": "PACKAGE_DELIVERY_IN_TRANSIT",
        "resources": [
            "businessProduct/business-product-id/order/order-id/delivery/delivery-id"
        ],
        "eventId":"example-event-id",
        "apiVersion": "2024-11-01",
        "subscriptionId": "example-subscription-id",
        "eventTime":"2025-01-20T12:34:56Z",
        "data": {}
    }
}

Fields

KeyData typeDescription
versionStringAmazon EventBridge event version.
idStringAmazon EventBridge-generated UUID for an event.
detail-typeStringType schema for the detail of the event, which in this case is PACKAGE_DELIVERY_IN_TRANSIT.
sourceStringName of the partner event source in Amazon EventBridge. For details, see Subscribe to Events.
accountStringAWS account ID that hosts the partner event source.
timeStringISO 8601 timestamp that indicates when the event was published.
regionStringAWS region from which the event is published.
resourcesArray of stringsArray 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 Subscribe to Events.
detailObjectJSON object that contains details about the event. For details, see detail fields.

Detail fields

KeyData typeDescription
idempotencyKeyStringUnique identifier to detect duplicate events.
eventDescriptorStringEvent type that determines the default query.
resourcesArray of stringsArray 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. This field is the same value as resources at the top level.
eventIdStringUnique identifier for this event. This field is the same value as id at the top level.
apiVersionStringBuy with Prime API version associated with this event.
subscriptionIdStringUnique identifier for an event subscription.
eventTimeStringISO 8601 timestamp that indicates when the event was published. This field is the same value as time at the top level.
dataObjectJSON object that can contain API response data.

Handling the event

When you receive this event, you typically query the order to fetch the delivery information for all line items in the order. Take the following steps:

  1. Parse the resources array of the event to get the order ID and delivery ID.
  2. Using the order ID that you found in the resources array in the previous step, make an API call to the order query. For examples of how to perform this query, see Query a Buy with Prime Order.
  3. In the response, navigate to the lineItems.packageInformation.details array and find the element with the ID that you found in the resources 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 the state attribute in the delivery details is either IN_TRANSIT, CANCELLED, or DELIVERED. For more information, see PACKAGE_DELIVERY_CANCELLED and PACKAGE_DELIVERED.

Related topics