Reporting API v1 reference

Amazon Business API for Order History

Overview

With Amazon Business API for Order History you can create spend reports and track progress towards your spending goals

Version information

Version : 2021-01-08

License information

License : Amazon Software License
License URL : https://aws.amazon.com/asl/

URI scheme

Host : api.business.amazon.com
Schemes : HTTPS

Consumes

  • application/json

Produces

  • application/json

External Docs

Description : Learn more about the Amazon Business API.
URL : http://business.amazon.com

Operations

getOrdersByOrderDate
getOrdersByOrderId

Paths

GET /reports/2021-01-08/orders

Operation: getOrdersByOrderDate

Description

Returns a paginated list of orders with order dates that fall within the date range that you specify. You can optionally retrieve lineItem, charges and shipments for these orders

Parameters

TypeNameDescriptionSchemaDefault
QuerystartDate
required
Lower limit for the search range. This date represents the order datestring (date-time)-
QuerynextPageToken
optional
A page token returned in the response to your previous request when the number of results exceed the page size(100). To get the next page of results, include nextPageToken as the only parameter. When no nextPageToken value is returned there are no more pages to return. This token needs to be encodedstring-
QueryendDate
required
Upper limit for the search range, This date represents the order datestring (date-time)-
QuerypurchaseOrderNumber
optional
The purchase order number associated with the item of a PPI order. This number is created by the buyer. This is an option param to only get order details for a specific purchase order number. This is currently under testingstring-
QueryincludeLineItems
optional
Option to get all line items associated with the orderboolean"false"
QueryincludeShipments
optional
Option to get all shipments associated with the orderboolean"false"
QueryincludeCharges
optional
Option to get all charges associated with the orderboolean"false"

Responses

HTTP CodeDescriptionSchema
200Orders successfully retrieved
Headers :
Access-Control-Allow-Origin (string)
x-amzn-RateLimit-Limit (string) : Your rate limit (requests per second) for this operation.
x-amzn-requestid (string) : Unique request reference identifier.
OrdersOutput

For error status codes, descriptions and schemas, see Error responses and schemas.

Produces

  • application/json

GET /reports/2021-01-08/orders/{orderId}

Operation: getOrdersByOrderId

Description

API to fetch details for a specific order based on order identifier.You can optionally retrieve lineItem, charges and shipments for this order

Parameters

TypeNameDescriptionSchemaDefault
PathorderId
required
Order identifier to get the corresponding order detailsstring-
QueryincludeLineItems
optional
Option to get all line items associated with the orderboolean"false"
QueryincludeShipments
optional
Option to get all shipments associated with the orderboolean"false"
QueryincludeCharges
optional
Option to get all charges associated with the orderboolean"false"

Responses

HTTP CodeDescriptionSchema
200Orders retrieved successfully
Headers :
Access-Control-Allow-Origin (string)
x-amzn-RateLimit-Limit (string) : Your rate limit (requests per second) for this operation.
x-amzn-requestid (string) : Unique request reference identifier.
OrdersOutput

For error status codes, descriptions and schemas, see Error responses and schemas.

Produces

  • application/json

Error Responses and Schemas

This table contains HTTP status codes and associated information for error responses.

HTTP CodeDescriptionSchema
400400 response
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
x-amzn-requestId (string):Unique request reference identifier.
ErrorList
401401 response
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
x-amzn-requestId (string):Unique request reference identifier.
ErrorList
403403 response
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
x-amzn-requestId (string):Unique request reference identifier.
ErrorList
404404 response
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
x-amzn-requestId (string):Unique request reference identifier.
ErrorList
429429 response
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
x-amzn-requestId (string):Unique request reference identifier.
ErrorList
500500 response
Headers:
Access-Control-Allow-Origin (string)
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
x-amzn-requestId (string):Unique request reference identifier.
ErrorList
504504 response
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
x-amzn-requestId (string):Unique request reference identifier.
ErrorList

Definitions

Money

The monetary value.

NameDescriptionSchema
currencyCode
required
The three-digit currency code, in ISO 4217 format.string
amount
required
The currency amount.string

Order

The response schema for the getOrdersByDates and getOrdersById operations

NameDescriptionSchema
orderDate
required
Date when order was placed.string (date-time)
orderId
required
Amazon order identifier.string
purchaseOrderNumber
required
Purchase Order Number assigned to the order.string
orderQuantity
required
The item quantity relevant to this order.integer
orderStatus
required
The status of the order.enum (OrderStatus)
lastOrderApproverName
required
Name of the last person who took action on order approval.string
buyingCustomer
required
Requisitioner or buyer that placed the order.Customer
buyerGroupName
required
The group within the business from which the order was placed.string
businessOrderInfo
required
Additional information provided at checkout.< string, string > map
orderSubTotal
required
Principal amount on the order (only includes the price; excludes shipping, taxes, or discounts).Money
orderShippingAndHandling
required
Total shipping charges applied (excludes shipment tax and discounts).Money
orderPromotion
required
Sum of all discounts on all order items and shipping (we don't show shipping discounts separately by each individual order).Money
orderTax
required
Sum of all taxes on the orderMoney
orderNetTotal
required
Total amount charged for the order.Money
lineItems
optional
Total items of the order< LineItem > array
shipments
optional
Total shipments of the order< Shipment > array
charges
optional
Total charges of the order< Charge > array

Charge

This attribute represents a charge object

NameDescriptionSchema
transactionDate
required
Date when payment was processed.string (date-time)
transactionId
required
Transaction reference identifier of the transaction.string
amount
required
Amount charged for a particular transaction. If amount is not settled yet, this is the amount for which Amazon received an authorization.Money
paymentInstrumentType
required
Credit card, Pay by Invoice, Bank Account, Reward Account, etc.string
paymentInstrumentLast4Digits
required
The last 4 digits of the payment card used in the transaction. If Pay by Invoice was used, this value is null.string

Customer

A customer with a role in a purchase (Buyer,Payer,Approver etc.,).

NameDescriptionSchema
id
required
Unique customer identifier internal to Amazon. This is currently in testingstring
name
optional
The customer name.string
email
optional
The customer email address.string

OrdersOutput

A model which represents a paginated list of orders

NameDescriptionSchema
orders
required
Orders for the given date range or by the given orderId< Order > array
nextPageToken
required
A page token returned in the response to your previous request when the number of results exceed the page size(100). To get the next page of results, include nextPageToken as the only parameter. When no nextPageToken value is returned there are no more pages to return.string
size
required
Size of the orders returned in the current responseinteger

LineItem

This attribute represents a line item object

NameDescriptionSchema
productCategory
required
Category of the product according to Amazon terminology.string
asin
required
The Amazon Standard Identification Number (ASIN) for the itemstring
title
required
The title of the item.string
unspsc
required
The United Nations Standard Products and Services Code for the itemstring
productCondition
required
Condition of the item purchased (new, used, used good, etc.).string
listedPricePerUnit
required
Listed Price Per Unit on Amazon Business.Money
purchasedPricePerUnit
required
Purchased Price Per UnitMoney
itemQuantity
required
Quantity of a line item.integer
itemSubTotal
required
Total principal amount you paid for individual items in the order. Excludes tax, promotions, discounts, and shipping and handling.Money
itemShippingAndHandling
required
Principal amounts for the shipping and handling for each item. Excludes the corresponding tax and discount amounts.Money
itemPromotion
required
Total discounts or promotions applied to a line item. Includes all discount components (discount on price, shipping, gift wrapping, other fees, etc.). Excludes tax.Money
itemTax
required
Total tax charged on item.Money
itemNetTotal
required
Total charged for the item. Including tax, discounts, shipping and handling, and item price.Money
purchaseOrderLineItem
required
Only for customers using Punchout. The cXML system adds a line item number.string
taxExemptionApplied
required
Yes or No.boolean
taxExemptionType
required
Code that specifies the type of tax exemption appliedstring
taxExemptOptOut
required
Yes or No.boolean
discountProgram
required
Negotiated Pricing or Quantity Discountsstring
discountType
required
Type of the discount appliedstring
discountAmount
required
Amount (in dollars) discountedMoney
discountRatio
required
The ratio of price to discount.string
seller
required
Information of the selling merchant including name, city, state and postal code.Seller
sellerCredentials
required
Seller's credentials or certifications (i.e. Minority owned business, Veteran owned business, etc.)< string > array
brandCode
required
Brand code as provided by the vendor or seller.string
brandName
required
Item Brand as provided by the vendor or seller.string
manufacturerName
required
Name of the manufacturer as provided by the vendor or seller.string
transactionIds
required
Transaction reference identifiers for the LineItem.< string > array
carrierTrackingNumbers
required
Tracking numbers from the shipment carrier for the LineItem.< string > array

Seller

This attribute represents the name, city, state and postal code of the selling merchant.

NameDescriptionSchema
sellerName
required
Name of the selling merchant.string
sellerCity
required
City of the selling merchant.string
sellerState
required
State of the selling merchant.string
sellerPostalCode
required
Postal code of the selling merchant.string

Shipment

This attribute represents a shipment object

NameDescriptionSchema
shipmentDate
required
Date when the item was shippedstring (date-time)
shipmentStatus
required
Current status of the shipmentenum (ShipmentStatus)
carrierTracking
required
Tracking number from the shipment carrier.string
deliveryInformation
required
Details the delivery status and estimated delivery date.DeliveryInformation
shipmentQuantity
required
Total quantity (across all line items) in the shipment.integer
shipmentSubTotal
required
This is the sum of all items in a shipment order (only includes the price; excludes shipping, taxes, or discounts).Money
shipmentShippingAndHandling
required
Shipping and handling for the line items in the shipment.Money
shipmentPromotion
required
Sum of all discounts for line items in the shipmentMoney
shipmentTax
required
Sum of all taxes charged for line items in the shipment.Money
shipmentNetTotal
required
Total amount charged for the shipment.Money
carrierName
required
Name of the shipment carrier.string

DeliveryInformation

Details the delivery status and estimated delivery date.

NameDescriptionSchema
expectedDeliveryDate
required
The expected delivery date of the shipment.string (date-time)
deliveryStatus
required
The current delivery status of the shipment.enum (DeliveryStatus)

ErrorList

A list of error responses returned when a request is unsuccessful.

NameSchema
errors
required
< Error > array

Error

Error response returned when the request is unsuccessful.

NameDescriptionSchema
code
required
An error code that identifies the type of error that occurred.string
message
required
A message that describes the error condition.string
details
optional
Additional details that can help the caller understand or fix the issue.string

OrderStatus

The status of the order.

Type : enum

ValueDescription
Pending ApprovalThe order has been submitted for approval.
Payment ConfirmedThe payment information has been collected by Amazon Business. This doesn’t mean that payment has been authorized by the bank or that Amazon Business have the collected funds.
Pending FulfillmentThe order is due for fulfillment.
PendingThe order details are being processed by Amazon Business.
CancelledThe order has been cancelled either by the buyer or by Amazon Business.
ClosedThe order has been delivered to the buyer and closed.

ShipmentStatus

Current status of the shipment

Type : enum

ValueDescription
ShippedThe package has been shipped.

DeliveryStatus

The current delivery status of the shipment.

Type : enum

ValueDescription
DELIVEREDThe package has been delivered.
NOT DELIVEREDThe package hasn't been delivered.
NOT AVAILABLEThe package has no delivery information.