Retrieve Orders with > 20 Items


When to Use

  • When requesting orders using the GET /v1/Orders endpoint, the API is designed to maximize processing efficiency.
    • By default, 20 orders per page are returned in response using this endpoint.
    • In addition to this, if an order contains more than 20 items, the Items and FulfillmentItems collections within the order (if expanded) will contain a maximum of 20 items.
  • This basic request will exclude item-level information such as SKUs included in the order, individual item-level quantities ordered, etc.
  • A collection $skip page URL is provided at the end of each collection section to retrieve Items/FulfillmentItems beyond 20.
  • An alternate option in request design is to use the existence of these $skip page URLs as a trigger for capturing only the ChannelAdvisor Order ID, then retrieving that one order specifically with a separate request.
    • A request to GET /v1/Orders(OrderID) with expanded collections will display all Items and FulfillmentItems in the order. This is the easiest way of handling the retreival.

Resource URL / Endpoint

GET https://api.channeladvisor.com/v1/Orders?$expand=Items,Fulfillments($expand=Items)
GET https://api.channeladvisor.com/v1/Orders(OrderID)?$expand=Items,Fulfillments($expand=Items)

Important and/or Required Parameters

PropertyRequiredNote
ProfileIDConditionalInclude in URL. Required if need to only retrieve orders from a single profile when authorized for multiple profiles.
The ChannelAdvisor generated unique identifier for the Profile.
Replace value with numeric integer representing the ID.
OrderIDConditionalInclude in URL. Required to retrieve a specific order.
The ChannelAdvisor generated unique identifier for the Order.
When specifying the Order ID, the Profile ID is not needed since the Order ID will be unique across all profiles.

Retrieve All Orders and Expand Items and Fulfillment Items

Example Request
GET https://api.channeladvisor.com/v1/Orders?access_token=xxxxxxxxxx&$expand=Items,Fulfillments($expand=Items)

Response Data Notes

Notice the two sections in the response that provide the @odata.nextLink URLs:

  • "Items@odata.nextLink": "https://api.channeladvisor.com/v1/Orders(864458)/Items?$skip=20",
    • Use this URL to capture the next 20 items in the order.
    • Append the active access token to the request.
    • OR use the existence of this kind of link to identify the Order as one that needs to be retrieved directly  GET /v1/Orders(654321)?$expand=Items,Fulfillments($expand=Items)
  • "Items@odata.nextLink": "https://api.channeladvisor.com/v1/Fulfillments(776863)/Items?$skip=20"
    • Use this URL to capture the next 20 fulfillment items in the order.
    • Append the active access token to the request.
Example Result (Success)
200 OK
{
    "@odata.context": "https://api.channeladvisor.com/v1/$metadata#Orders",
    "value": [
        {
            // Non-relevant orders data omitted
        },
        {
            "ID": 654321,
            "ProfileID": 12345678,
            "SiteID": 576,
            "SiteName": "eBay Fixed Price US",
            // Data Omitted to Save Space
            "Items": [
                {
                    "ID": 827389,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    "ProductID": 2985411,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827390,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827391,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827392,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827393,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827394,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827395,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827396,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827397,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827398,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827399,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827400,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827401,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827402,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827403,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827404,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827405,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827406,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827407,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                },
                {
                    "ID": 827408,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    // Data Omitted to Save Space
                }
            ],
            "Items@odata.nextLink": "https://api.channeladvisor.com/v1/Orders(864458)/Items?$skip=20",
            "Fulfillments": [
                {
                    "ID": 776863,
                    "ProfileID": 12345678,
                    "OrderID": 654321,
                    "CreatedDateUtc": "2017-07-18T06:41:42Z",
                    "UpdatedDateUtc": "2017-07-18T06:56:11.5166667Z",
                    "Type": "Ship",
                    "DeliveryStatus": "NoChange",
                    "TrackingNumber": null,
                    "ShippingCarrier": "eBay",
                    "ShippingClass": "Standard",
                    "DistributionCenterID": 0,
                    "ExternalFulfillmentCenterCode": null,
                    "ShippedDateUtc": null,
                    "SellerFulfillmentID": null,
                    "Items": [
                        {
                            "ID": 850144,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850145,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850146,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850147,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850148,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850149,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850150,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850151,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850152,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850153,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850154,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850155,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850156,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850157,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850158,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850159,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850160,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850161,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850162,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        },
                        {
                            "ID": 850163,
                            "ProfileID": 12345678,
                            "FulfillmentID": 776863,
                            // Data Omitted to Save Space
                        }
                    ],
                    "Items@odata.nextLink": "https://api.channeladvisor.com/v1/Fulfillments(776863)/Items?$skip=20"
                }
            ]
        },
        {
            // Non-relevant orders data omitted
		}
    ],
    "@odata.nextLink": "https://api.channeladvisor.com/v1/Orders?access_token=xxxxxxxxxx&exported=false&$expand=Items%2CFulfillments%28%24expand%3DItems%29&$skip=20"
}