Update a Buy with Prime Order
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.
This topic provides examples of how to use the Order interface to update information in a Buy with Prime order.
You must successfully create an order before you can update it. To learn how to create an order, see Create a Buy with Prime Order.
To learn how to call the Buy with Prime API, see Call the Buy with Prime API.
Note: We currently don’t support deleting or updating the orderAlias
, orderLink
, or discount
fields of an order. If you pass null to these fields in a call to updateOrder
, expect that the existing values of these fields won't change.
Trigger fulfillment for an existing order
This example shows how to trigger fulfillment for an order that you created with desiredExecutionState
set to NOT_STARTED
. To trigger fulfillment, you set desiredExecutionState
to STARTED
by using the updateOrder
mutation.
Request
// GraphQL mutation
mutation updateOrder($input: UpdateOrderInput!) {
updateOrder(input: $input) {
order {
id
}
}
}
// Mutation variables
{
"input": {
"orderId": "example-order-id",
"desiredExecutionState": "STARTED"
}
}
Response
{
"data": {
"updateOrder": {
"order": {
"id": "example-order-id"
}
}
}
}
Update order-level attributes
You can update order-level attributes by using the updateOrder
mutation. This example shows how to update order-level attributes such as the total price and taxes on the order.
Request
// GraphQL mutation
mutation updateOrder($input: UpdateOrderInput!) {
updateOrder(input: $input) {
order {
id
totalPrice {
value {
amount
currencyCode
}
}
taxes {
summary {
collectableTaxAmount {
amount
}
}
}
}
}
}
// Mutation variables
{
"input": {
"orderId": "example-order-id",
"totalPrice": {
"value": {
"amount": 20,
"currencyCode": "USD"
}
},
"taxes": {
"summary": {
"collectableTaxAmount": {
"amount": 12,
"currencyCode": "USD"
}
}
}
}
}
Response
{
"data": {
"updateOrder": {
"order": {
"id": "example-order-id",
"totalPrice": {
"value": {
"amount": 20,
"currencyCode": "USD"
}
},
"taxes": {
"summary": {
"collectableTaxAmount": {
"amount": 12
}
}
}
}
}
}
}
Update refund details for an order
For examples, see Update Refund Details.
Related topics
Updated 23 days ago