HomeDocumentationCode SamplesAnnouncementsModelsRelease NotesFAQGitHubVideos
Developer HubAPI StatusSupport
Documentation
Developer HubAPI StatusSupport

Sales API v1 Reference

Retrieve information about sales performance.

Overview

The Selling Partner API for Sales provides APIs related to sales performance.

Version information

Version : v1

Contact information

Contact : Selling Partner API Developer Support
Contact URL : https://sellercentral.amazon.com/gp/mws/contactus.html

License information

License : Apache License 2.0
License URL : http://www.apache.org/licenses/LICENSE-2.0

URI scheme

Host : sellingpartnerapi-na.amazon.com
Schemes : HTTPS

Consumes

  • application/json

Produces

  • application/json

Operations

getOrderMetrics

Paths

GET /sales/v1/orderMetrics

Operation: getOrderMetrics

Description

Returns aggregated order metrics for given interval, broken down by granularity, for given buyer type.

Usage Plan:

Rate (requests per second)Burst
.515

The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see Usage Plans and Rate Limits in the Selling Partner API.

Parameters

TypeNameDescriptionSchemaDefault
QuerymarketplaceIds
required
A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.

For example, ATVPDKIKX0DER indicates the US marketplace.
< string > array-
Queryinterval
required
A time interval used for selecting order metrics. This takes the form of two dates separated by two hyphens (first date is inclusive; second date is exclusive). Dates are in ISO8601 format and must represent absolute time (either Z notation or offset notation). Example: 2018-09-01T00:00:00-07:00--2018-09-04T00:00:00-07:00 requests order metrics for Sept 1st, 2nd and 3rd in the -07:00 zone.string-
QuerygranularityTimeZone
optional
An IANA-compatible time zone for determining the day boundary. Required when specifying a granularity value greater than Hour. The granularityTimeZone value must align with the offset of the specified interval value. For example, if the interval value uses Z notation, then granularityTimeZone must be UTC. If the interval value uses an offset, then granularityTimeZone must be an IANA-compatible time zone that matches the offset. Example: US/Pacific to compute day boundaries, accounting for daylight time savings, for US/Pacific zone.string-
Querygranularity
required
The granularity of the grouping of order metrics, based on a unit of time. Specifying granularity=Hour results in a successful request only if the interval specified is less than or equal to 30 days from now. For all other granularities, the interval specified must be less or equal to 2 years from now. Specifying granularity=Total results in order metrics that are aggregated over the entire interval that you specify. If the interval start and end date don’t align with the specified granularity, the head and tail end of the response interval will contain partial data. Example: Day to get a daily breakdown of the request interval, where the day boundary is defined by the granularityTimeZone.enum (Granularity)-
QuerybuyerType
optional
Filters the results by the buyer type that you specify, B2B (business to business) or B2C (business to customer). Example: B2B, if you want the response to include order metrics for only B2B buyers.enum (BuyerType)"All"
QueryfulfillmentNetwork
optional
Filters the results by the fulfillment network that you specify, MFN (merchant fulfillment network) or AFN (Amazon fulfillment network). Do not include this filter if you want the response to include order metrics for all fulfillment networks. Example: AFN, if you want the response to include order metrics for only Amazon fulfillment network.string-
QueryfirstDayOfWeek
optional
Specifies the day that the week starts on when granularity=Week, either Monday or Sunday. Default: Monday. Example: Sunday, if you want the week to start on a Sunday.enum (FirstDayOfWeek)"Monday"
Queryasin
optional
Filters the results by the ASIN that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all ASINs. Example: B0792R1RSN, if you want the response to include order metrics for only ASIN B0792R1RSN.string-
Querysku
optional
Filters the results by the SKU that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all SKUs. Example: TestSKU, if you want the response to include order metrics for only SKU TestSKU.string-

Responses

HTTP CodeDescriptionSchema
200OrderMetric action taken on the resource OrderMetrics.
Headers :
x-amzn-RateLimit-Limit (string) : Your rate limit (requests per second) for this operation..
x-amzn-RequestId (string) : unique request reference id.
GetOrderMetricsResponse

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

Error Responses and Schemas

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

HTTP CodeDescriptionSchema
400Request has missing or invalid parameters and cannot be parsed.
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
x-amzn-RequestId (string):Unique request reference id.
GetOrderMetricsResponse
403403 can be caused for reasons like Access Denied, Unauthorized, Expired Token, Invalid Signature or Resource Not Found.
Headers:
x-amzn-RequestId (string):Unique request reference id.
GetOrderMetricsResponse
404The resource specified does not exist.
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
x-amzn-RequestId (string):Unique request reference id.
GetOrderMetricsResponse
413The request size exceeded the maximum accepted size.
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
Note: For this status code, the rate limit header is deprecated and no longer returned.
x-amzn-RequestId (string):Unique request reference id.
GetOrderMetricsResponse
415The entity of the request is in a format not supported by the requested resource.
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
Note: For this status code, the rate limit header is deprecated and no longer returned.
x-amzn-RequestId (string):Unique request reference id.
GetOrderMetricsResponse
429The frequency of requests was greater than allowed.
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
Note: For this status code, the rate limit header is deprecated and no longer returned.
x-amzn-RequestId (string):Unique request reference id.
GetOrderMetricsResponse
500Encountered an unexpected condition which prevented the server from fulfilling the request.
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
Note: For this status code, the rate limit header is deprecated and no longer returned.
x-amzn-RequestId (string):Unique request reference id.
GetOrderMetricsResponse
503Temporary overloading or maintenance of the server.
Headers:
x-amzn-RateLimit-Limit (string):Your rate limit (requests per second) for this operation.
Note: For this status code, the rate limit header is deprecated and no longer returned.
x-amzn-RequestId (string):Unique request reference id.
GetOrderMetricsResponse

Definitions

GetOrderMetricsResponse

The response schema for the getOrderMetrics operation.

NameDescriptionSchema
payload
optional
The payload for the getOrderMetrics operation.OrderMetricsList
errors
optional
Encountered errors for the getOrderMetrics operation.ErrorList

OrderMetricsList

A set of order metrics, each scoped to a particular time interval.

Type : < OrderMetricsInterval > array

OrderMetricsInterval

Contains order metrics.

NameDescriptionSchema
interval
required
The interval of time based on requested granularity (ex. Hour, Day, etc.) If this is the first or the last interval from the list, it might contain incomplete data if the requested interval doesn't align with the requested granularity (ex. request interval 2018-09-01T02:00:00Z--2018-09-04T19:00:00Z and granularity day will result in Sept 1st UTC day and Sept 4th UTC days having partial data).string
unitCount
required
The number of units in orders based on the specified filters.integer
orderItemCount
required
The number of order items based on the specified filters.integer
orderCount
required
The number of orders based on the specified filters.integer
averageUnitPrice
required
The average price for an item based on the specified filters. Formula is totalSales/unitCount.Money
totalSales
required
The total ordered product sales for all orders based on the specified filters.Money

Error

Error response returned when the request is unsuccessful.

NameDescriptionSchema
code
required
An error code that identifies the type of error that occured.string
message
required
A message that describes the error condition in a human-readable form.string
details
optional
Additional details that can help the caller understand or fix the issue.string

ErrorList

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

Type : < Error > array

Money

The currency type and the amount.

NameDescriptionSchema
currencyCode
required
Three-digit currency code. In ISO 4217 format.string
amount
required
The currency amount.Decimal

Decimal

A decimal number with no loss of precision. Useful when precision loss is unnaceptable, as with currencies. Follows RFC7159 for number representation.

Type : string

BuyerType

Filters the results by the buyer type that you specify, B2B (business to business) or B2C (business to customer). Example: B2B, if you want the response to include order metrics for only B2B buyers.

Type : enum

ValueDescription
B2BBusiness to business.
B2CBusiness to customer.
AllBusiness to business and business to customer.

Granularity

The granularity of the grouping of order metrics, based on a unit of time. Specifying granularity=Hour results in a successful request only if the interval specified is less than or equal to 30 days from now. For all other granularities, the interval specified must be less or equal to 2 years from now. Specifying granularity=Total results in order metrics that are aggregated over the entire interval that you specify. If the interval start and end date don’t align with the specified granularity, the head and tail end of the response interval will contain partial data. Example: Day to get a daily breakdown of the request interval, where the day boundary is defined by the granularityTimeZone.

Type : enum

ValueDescription
HourHour
DayDay
WeekWeek
MonthMonth
YearYear
TotalTotal

FirstDayOfWeek

Specifies the day that the week starts on when granularity=Week, either Monday or Sunday. Default: Monday. Example: Sunday, if you want the week to start on a Sunday.

Type : enum

ValueDescription
MondayMonday
SundaySunday