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
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description |
---|---|---|---|---|---|
AmazonOrderId |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
PurchaseDate |
DT_DBTIMESTAMP
|
datetime
|
False |
||
LastUpdateDate |
DT_DBTIMESTAMP
|
datetime
|
False |
||
OrderStatus |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
FulfillmentChannel |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
SalesChannel |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
ShipServiceLevel |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
CurrencyCode |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
Amount |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
NumberOfItemsShipped |
DT_I4
|
int
|
False |
||
NumberOfItemsUnshipped |
DT_I4
|
int
|
False |
||
PaymentMethod |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
PaymentMethodDetails |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
IsReplacementOrder |
DT_BOOL
|
bit
|
False |
||
MarketplaceId |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
ShipmentServiceLevelCategory |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
OrderType |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
EarliestShipDate |
DT_DBTIMESTAMP
|
datetime
|
False |
||
LatestShipDate |
DT_DBTIMESTAMP
|
datetime
|
False |
||
EarliestDeliveryDate |
DT_DBTIMESTAMP
|
datetime
|
False |
||
LatestDeliveryDate |
DT_DBTIMESTAMP
|
datetime
|
False |
||
IsBusinessOrder |
DT_BOOL
|
bit
|
False |
||
IsPrime |
DT_BOOL
|
bit
|
False |
||
IsGlobalExpressEnabled |
DT_BOOL
|
bit
|
False |
||
IsPremiumOrder |
DT_BOOL
|
bit
|
False |
||
IsSoldByAB |
DT_BOOL
|
bit
|
False |
||
IsIBA |
DT_BOOL
|
bit
|
False |
||
DefaultShipFromName |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
DefaultShipAddressLine1 |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
DefaultShipFromCity |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
DefaultShipFromStateOrRegion |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
DefaultShipFromPostalCode |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
DefaultShipFromCountryCode |
DT_WSTR
|
nvarchar(50)
|
50 | False |
|
DefaultShipFromPhone |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
DefaultShipFromAddressType |
DT_WSTR
|
nvarchar(100)
|
100 | False |
|
FulfillmentSupplySourceId |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
IsISPU |
DT_BOOL
|
bit
|
False |
||
IsAccessPointOrder |
DT_BOOL
|
bit
|
False |
||
HasAutomatedShippingSettings |
DT_BOOL
|
bit
|
False |
||
EasyShipShipmentStatus |
DT_WSTR
|
nvarchar(500)
|
500 | False |
|
ElectronicInvoiceStatus |
DT_WSTR
|
nvarchar(500)
|
500 | False |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | 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 component to read data or in API Destination component to read/write data:
Read from Orders table using API Destination
This Endpoint belongs to Orders table, therefore you cannot work with it directly. Use this table and table-operation pair instead:

ODBC application
Use these SQL queries in your ODBC application data source:
Get orders
SELECT * FROM get_orders
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'
--)
Read Single Order
Read single order by orderid
SELECT * FROM Orders
Where AmazonOrderId='902-1845936-5435065'
--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:
Get orders
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM get_orders';
EXEC (@MyQuery) AT [LS_TO_AMAZON_SELLING_PARTNER_SP_API_IN_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];
Read Single Order
Read single order by orderid
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Orders
Where AmazonOrderId=''902-1845936-5435065''
--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).