Endpoint Get Orders
Name
get_orders
Description
Returns orders created or updated during the time frame indicated by the specified parameters. You can also apply a range of filtering criteria to narrow the list of orders returned. If NextToken is present, that will be used to retrieve the orders instead of other criteria.
Related Tables
Parameters
Parameter | Required | Options | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name:
Label: MarketplaceIds |
YES |
|
||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: CreatedAfter A UTC date used for selecting orders created after (or at) a specified time. Date format must be UTC - ISO 8601 format (e.g. short date 2017-02-10 -OR- date and time 2017-02-10T12:10:02). If LastUpdatedAfter is not specified. Specifying both CreatedAfter and LastUpdatedAfter returns an error. You can use static values or date functions. Supported functions are now|today|yesterday|weekstart|weekend|monthstart|monthend|yearstart|yearend and supported intervals for add/subtract are ms|s|sec|min|h|hour|y|year|d|day|m|month|y|year. Example monthstart-3d (subtract 3days from month start) |
|
|||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: CreatedBefore A UTC date used for selecting orders created before (or at) a specified time. Date format must be UTC - ISO 8601 format (e.g. short date 2017-02-10 -OR- date and time 2017-02-10T12:10:02) You can use static values or date functions. Supported functions are now|today|yesterday|weekstart|weekend|monthstart|monthend|yearstart|yearend and supported intervals for add/subtract are ms|s|sec|min|h|hour|y|year|d|day|m|month|y|year. Example monthstart-3d (subtract 3days from month start) |
|
|||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: LastUpdatedAfter A UTC date used for selecting orders that were last updated after (or at) a specified time. An update is defined as any change in order status, including the creation of a new order. Includes updates made by Amazon and by the seller. Date format must be UTC - ISO 8601 format (e.g. short date 2017-02-10 -OR- date and time 2017-02-10T12:10:02). If CreatedAfter is not specified.Specifying both CreatedAfter and LastUpdatedAfter returns an error.If LastUpdatedAfter is specified, then BuyerEmail and SellerOrderId cannot be specified. You can use static values or date functions. Supported functions are now|today|yesterday|weekstart|weekend|monthstart|monthend|yearstart|yearend and supported intervals for add/subtract are ms|s|sec|min|h|hour|y|year|d|day|m|month|y|year. Example monthstart-3d (subtract 3days from month start) |
|
|||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: LastUpdatedBefore A UTC date used for selecting orders that were last updated before (or at) a specified time. An update is defined as any change in order status, including the creation of a new order. Includes updates made by Amazon and by the seller. Date format must be UTC - ISO 8601 format (e.g. short date 2017-02-10 -OR- date and time 2017-02-10T12:10:02) You can use static values or date functions. Supported functions are now|today|yesterday|weekstart|weekend|monthstart|monthend|yearstart|yearend and supported intervals for add/subtract are ms|s|sec|min|h|hour|y|year|d|day|m|month|y|year. Example monthstart-3d (subtract 3days from month start) |
|
|||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: OrderStatuses A list of OrderStatus values. Used to select orders with a current status that matches one of the status values that you specify. |
|
|||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: FulfillmentChannels A list that indicates how an order was fulfilled. |
|
|||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: PaymentMethods A list of PaymentMethod values. Used to select orders paid for with the payment methods that you specify. |
|
|||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: BuyerEmail The e-mail address of a buyer. Used to select only the orders that contain the specified e-mail address. If BuyerEmail is specified, then FulfillmentChannel, OrderStatus, PaymentMethod, LastUpdatedAfter, LastUpdatedBefore, and SellerOrderId cannot be specified. |
||||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: SellerOrderId An order identifier that is specified by the seller. Not an Amazon order identifier. Used to select only the orders that match a seller-specified order identifier. If SellerOrderId is specified, then FulfillmentChannel, OrderStatus, PaymentMethod, LastUpdatedAfter, LastUpdatedBefore, and BuyerEmail cannot be specified. |
||||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: MaxResultsPerPage A number that indicates the maximum number of orders that can be returned per page. Value must be 1 - 100. Default 100. |
||||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: EasyShipShipmentStatuses A list of EasyShipShipmentStatus values. Used to select Easy Ship orders with statuses that match the specified values. If EasyShipShipmentStatus is specified, only Amazon Easy Ship orders are returned. Possible values: - PendingSchedule (The package is awaiting the schedule for pick-up.) - PendingPickUp (Amazon has not yet picked up the package from the seller.) - PendingDropOff (The seller will deliver the package to the carrier.) - LabelCanceled (The seller canceled the pickup.) - PickedUp (Amazon has picked up the package from the seller.) - DroppedOff (The package is delivered to the carrier by the seller.) - AtOriginFC (The packaged is at the origin fulfillment center.) - AtDestinationFC (The package is at the destination fulfillment center.) - Delivered (The package has been delivered.) - RejectedByBuyer (The package has been rejected by the buyer.) - Undeliverable (The package cannot be delivered.) - ReturningToSeller (The package was not delivered and is being returned to the seller.) - ReturnedToSeller (The package was not delivered and was returned to the seller.) - Lost (The package is lost.) - OutForDelivery (The package is out for delivery.) - Damaged (The package was damaged by the carrier.) |
|
|||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: ElectronicInvoiceStatuses A list of ElectronicInvoiceStatus values. Used to select orders with electronic invoice statuses that match the specified values. Possible values: - NotRequired (Electronic invoice submission is not required for this order.) - NotFound (The electronic invoice was not submitted for this order.) - Processing (The electronic invoice is being processed for this order.) - Errored (The last submitted electronic invoice was rejected for this order.) - Accepted (The last submitted electronic invoice was submitted and accepted.) |
|
|||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: AmazonOrderIds Comma separated list of AmazonOrderId values. An AmazonOrderId is an Amazon-defined order identifier, in 3-7-7 format. Max count : 50 |
||||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: ActualFulfillmentSupplySourceId Denotes the recommended sourceId where the order should be fulfilled from. |
||||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: IsISPU When true, this order is marked to be picked up from a store rather than delivered. |
||||||||||||||||||||||||||||||||||||||||||||||||
Name:
Label: StoreChainStoreId The store chain store identifier. Linked to a specific store in a store chain. |
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
---|---|---|---|---|
AmazonOrderId |
DT_WSTR
|
nvarchar(500)
|
500 | |
PurchaseDate |
DT_DBTIMESTAMP
|
datetime
|
||
LastUpdateDate |
DT_DBTIMESTAMP
|
datetime
|
||
OrderStatus |
DT_WSTR
|
nvarchar(100)
|
100 | |
FulfillmentChannel |
DT_WSTR
|
nvarchar(50)
|
50 | |
SalesChannel |
DT_WSTR
|
nvarchar(100)
|
100 | |
ShipServiceLevel |
DT_WSTR
|
nvarchar(500)
|
500 | |
CurrencyCode |
DT_WSTR
|
nvarchar(50)
|
50 | |
Amount |
DT_WSTR
|
nvarchar(50)
|
50 | |
NumberOfItemsShipped |
DT_I4
|
int
|
||
NumberOfItemsUnshipped |
DT_I4
|
int
|
||
PaymentMethod |
DT_WSTR
|
nvarchar(50)
|
50 | |
PaymentMethodDetails |
DT_WSTR
|
nvarchar(500)
|
500 | |
IsReplacementOrder |
DT_BOOL
|
bit
|
||
MarketplaceId |
DT_WSTR
|
nvarchar(500)
|
500 | |
ShipmentServiceLevelCategory |
DT_WSTR
|
nvarchar(100)
|
100 | |
OrderType |
DT_WSTR
|
nvarchar(500)
|
500 | |
EarliestShipDate |
DT_DBTIMESTAMP
|
datetime
|
||
LatestShipDate |
DT_DBTIMESTAMP
|
datetime
|
||
EarliestDeliveryDate |
DT_DBTIMESTAMP
|
datetime
|
||
LatestDeliveryDate |
DT_DBTIMESTAMP
|
datetime
|
||
IsBusinessOrder |
DT_BOOL
|
bit
|
||
IsPrime |
DT_BOOL
|
bit
|
||
IsGlobalExpressEnabled |
DT_BOOL
|
bit
|
||
IsPremiumOrder |
DT_BOOL
|
bit
|
||
IsSoldByAB |
DT_BOOL
|
bit
|
||
IsIBA |
DT_BOOL
|
bit
|
||
DefaultShipFromName |
DT_WSTR
|
nvarchar(500)
|
500 | |
DefaultShipAddressLine1 |
DT_WSTR
|
nvarchar(500)
|
500 | |
DefaultShipFromCity |
DT_WSTR
|
nvarchar(100)
|
100 | |
DefaultShipFromStateOrRegion |
DT_WSTR
|
nvarchar(50)
|
50 | |
DefaultShipFromPostalCode |
DT_WSTR
|
nvarchar(100)
|
100 | |
DefaultShipFromCountryCode |
DT_WSTR
|
nvarchar(50)
|
50 | |
DefaultShipFromPhone |
DT_WSTR
|
nvarchar(500)
|
500 | |
DefaultShipFromAddressType |
DT_WSTR
|
nvarchar(100)
|
100 | |
FulfillmentSupplySourceId |
DT_WSTR
|
nvarchar(500)
|
500 | |
IsISPU |
DT_BOOL
|
bit
|
||
IsAccessPointOrder |
DT_BOOL
|
bit
|
||
HasAutomatedShippingSettings |
DT_BOOL
|
bit
|
||
EasyShipShipmentStatus |
DT_WSTR
|
nvarchar(500)
|
500 | |
ElectronicInvoiceStatus |
DT_WSTR
|
nvarchar(500)
|
500 |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. |
Examples
SSIS
Use Amazon Selling Partner (SP-API) Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
This Endpoint belongs to the Orders table, therefore it is better to use it, instead of accessing the endpoint directly:
There are no parameters to configure. |

API Destination
This Endpoint belongs to the Orders table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to get orders:
There are no parameters to configure. |

ODBC application
Use these SQL queries in your ODBC application data source:
Read Orders
Read orders with search criteria such as CreatedAfter, CreatedBefore, MarketPlaceIds, OrderStatuses, PaymentType and many more
SELECT * FROM Orders
--WHERE AmazonOrderId='902-1845936-5435065'
WITH(
CreatedAfter='1900-01-01T00:00:00'
-- , CreatedBefore='1900-01-01T00:00:00'
-- , LastUpdatedAfter='1900-01-01T00:00:00'
-- , LastUpdatedBefore='1900-01-01T00:00:00'
-- , OrderStatuses='Pending~Unshipped~PartiallyShipped~PendingAvailability~Shipped~Canceled~Unfulfillable'
-- , MarketplaceIds='ATVPDKIKX0DER~A2Q3Y263D00KWC~A2EUQ1WTGCTBG2'
-- , FulfillmentChannels='AFN~MFN'
-- , PaymentMethods='COD~CVS~Other'
-- , AmazonOrderIds='1111111,222222,333333'
)
--CONNECTION(
-- ServiceUrl='https://sellingpartnerapi-na.amazon.com'
--)
Sandbox - Read Orders (Fake data for testing)
Read orders which has fake values (sandbox data)
SELECT *
FROM Orders
--DONOT try WHERE AmazonOrderId='TEST_CASE_200' (WHERE clause) for sandbox endpoint, it will return empty row. If you try in Live API then should work.
WITH(
CreatedAfter='TEST_CASE_200'
--CreatedAfter='TEST_CASE_200_NEXT_TOKEN'
, MarketplaceIds='ATVPDKIKX0DER'
)
CONNECTION(
ServiceUrl='https://sandbox.sellingpartnerapi-na.amazon.com'
)
get_orders
endpoint belongs to
Orders
table(s), and can therefore be used via those table(s).
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Read Orders
Read orders with search criteria such as CreatedAfter, CreatedBefore, MarketPlaceIds, OrderStatuses, PaymentType and many more
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders
--WHERE AmazonOrderId=''902-1845936-5435065''
WITH(
CreatedAfter=''1900-01-01T00:00:00''
-- , CreatedBefore=''1900-01-01T00:00:00''
-- , LastUpdatedAfter=''1900-01-01T00:00:00''
-- , LastUpdatedBefore=''1900-01-01T00:00:00''
-- , OrderStatuses=''Pending~Unshipped~PartiallyShipped~PendingAvailability~Shipped~Canceled~Unfulfillable''
-- , MarketplaceIds=''ATVPDKIKX0DER~A2Q3Y263D00KWC~A2EUQ1WTGCTBG2''
-- , FulfillmentChannels=''AFN~MFN''
-- , PaymentMethods=''COD~CVS~Other''
-- , AmazonOrderIds=''1111111,222222,333333''
)
--CONNECTION(
-- ServiceUrl=''https://sellingpartnerapi-na.amazon.com''
--)';
EXEC (@MyQuery) AT [LS_TO_AMAZON_SELLING_PARTNER_SP_API_IN_GATEWAY];
Sandbox - Read Orders (Fake data for testing)
Read orders which has fake values (sandbox data)
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM Orders
--DONOT try WHERE AmazonOrderId=''TEST_CASE_200'' (WHERE clause) for sandbox endpoint, it will return empty row. If you try in Live API then should work.
WITH(
CreatedAfter=''TEST_CASE_200''
--CreatedAfter=''TEST_CASE_200_NEXT_TOKEN''
, MarketplaceIds=''ATVPDKIKX0DER''
)
CONNECTION(
ServiceUrl=''https://sandbox.sellingpartnerapi-na.amazon.com''
)';
EXEC (@MyQuery) AT [LS_TO_AMAZON_SELLING_PARTNER_SP_API_IN_GATEWAY];
get_orders
endpoint belongs to
Orders
table(s), and can therefore be used via those table(s).