Get Refund Details

📘

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.

As you process Buy with Prime refunds for an order, you can get details about all the refunds associated with the order. You then initiate the refunds and update the Buy with Prime order with the latest information. For details, see Steps to Process Refunds.

The following examples show how to get information about Buy with Prime refunds.

For an overview of refund terminology, see Synchronize Refunds. To learn how to call the Buy with Prime API, see Call the Buy with Prime API.


Get refund details for an order

After you receive a REFUND_REQUESTED event, you parse the resources array of the event to get the order ID, and then you query the associated order to get information about any refunds that are associated with the order.

The following example query gets the line item, product, and refund data for an order. The response shows that the refund is in PENDING state. The refund is associated with line item example-line-item-id. The estimated amount to be refunded is $10.

Request
// GraphQL query
query order {
  order(orderId: "example-order-id") {
    id
    refunds {
      details {
        id
        state
        aliases {
          aliasType
          aliasId
        }
        createdAt
        updatedAt
        refundTotal {
          totalAmount {
            currencyCode
            amount
          }
        }
        refundFor {
          orderLineItems {
            lineItem {
              id
            }
            refundedQuantity {
              amount
            }
          }
        }
        paymentDetails {
          id
          amount {
            currencyCode
            amount
          }
          paymentMethod {
            displayString
            type
          }
          state
        }
      }
    }
  }
}
Response
{
  "data": {
    "order": {
      "id": "example-order-id",
      "refunds": {
        "details": [
          {
            "id": "example-refund-id",  
            "state": "PENDING", 
            "aliases": [],
            "createdAt": "2024-04-03T14:14:18.160Z",
            "updatedAt": "2024-04-03T14:14:18.410Z",
            "refundTotal": {
              "totalAmount": {
                "currencyCode": "USD",
                "amount": 10.00 
              }
            },
            "refundFor": {
              "orderLineItems": [
                {
                  "lineItem": {
                    "id": "example-line-item-id" 
                  },
                  "refundedQuantity": {
                    "amount": 1 
                  }
                }
              ]
            },
            "paymentDetails": []
          }
        ]
      }
    }
  }
}

Related topics