Retrieve FBA Orders with Refunds


When to Use

  • To only retrieve FBA orders that have refunds/returns.

  • See more on all the options for filtering, querying, expanding data under the Getting and Filtering Data page

Requirements of this Format to Process the Response Accurately

  1. Filter to the specific DistributionCenterIDs associated with FBA (for some sellers, there may be more than 1 DC for FBA).
  2. Update the CreatedDateUtc filter on each request to avoid capturing Adjustments previously captured.
    • Incorporate the UTC time in the request if seller needs to retrieve these refunds intraday.
  3. When reading the response, ignore any Orders where the Fulfillment is blank (Fulfillments: [ ]), because the response may include non-FBA refunds/cancellations.
    • There's no way to limit the request to only FBA refunds/cancellations.

Resource URL / Endpoint

GET https://api.channeladvisor.com/v1/OrderItems?$filter=Adjustments/Any(c:c/CreatedDateUtc gt 2018-09-01)&
$select=Order&$expand=Order($expand=Fulfillments($expand=Items),Fulfillments($filter=DistributionCenterID lt 0), Items($expand=Adjustments))

Important and/or Required Parameters

Operator / PropertyRequiredNote
$filter=Adjustments/Any(c:c/CreatedDateUtc gt 2018-09-01)RequiredRequired to prevent identifying Adjustments that have previously been retrieved. Include in URL.
Filters out Adjustments created before the specified date (and time, if included).
 $select=OrderRequiredDefines the Order level entity be included in the evaluation.
 $expand=OrderRequiredDefines the Order level entity data to be expanded in the response
 ($expand=Fulfillments($expand=Items),RequiredDefines the Fulfillments (child to Order), and Fullfillment Item collections to be expanded in the response. 
 Fulfillments($filter=DistributionCenterID lt 0)RequiredDefines the Fulfillments requested only display content when the DistributionCenterID represents Amazon distribution centers.
If using other Externally-Managed DCs, set the filter to: $filter=DistributionCenterID lt 0 and DistributionCenterID gt -100)
 Items($expand=Adjustments)) RequiredDefines the Items in the Order and Item level Adjustments also be expanded in the response.
Example Request
GET https://api.channeladvisor.com/v1/OrderItems?access_token=xxxxxxxxxx&$filter=Adjustments/Any(c:c/CreatedDateUtc gt 2018-09-01)&$select=Order
&$expand=Order($expand=Fulfillments($expand=Items),Fulfillments($filter=DistributionCenterID lt 0), Items($expand=Adjustments))
Example Response (Success)
200 OK
{
    "@odata.context": "https://api.channeladvisor.com/v1/$metadata#OrderItems(Order)",
    "value": [
        {
            "Order": {
                "ID": 3153279,
                "ProfileID": 12345678,
                "SiteID": 640,
                "SiteName": "Amazon Seller Central - US",
                // Omitted Fields Irrelevant to This Example
                "Fulfillments": [
                    {
                        "ID": 3078590,
                        "ProfileID": 12345678,
                        "OrderID": 3164663,
                        "CreatedDateUtc": "2018-08-21T20:47:12Z",
                        "UpdatedDateUtc": "2018-08-27T15:39:45.6466667Z",
                        "Type": "Ship",
                        "DeliveryStatus": "Complete",
                        "TrackingNumber": "AT0001234501",
                        "ShippingCarrier": "AMZN_US",
                        "ShippingClass": "Expedited",
                        "DistributionCenterID": -2,
                        "ExternalFulfillmentCenterCode": "ALN2 ",
                        "ShippingCost": 0,
                        "InsuranceCost": 0,
                        "TaxCost": 0,
                        "ShippedDateUtc": "2018-08-22T22:51:32Z",
                        "SellerFulfillmentID": null,
                        "HasShippingLabel": false,
                        "Items": [
                            {
                                "ID": 3179539,
                                "ProfileID": 12345678,
                                "FulfillmentID": 3078590,
                                "OrderID": 3153279,
                                "OrderItemID": 3149849,
                                "Quantity": 1,
                                "ProductID": 2714763
                            }
                        ]
                    }
                ],
                "Items": [
                    {
                        "ID": 3149849,
                        "ProfileID": 12345678,
                        "OrderID": 3153279,
                        "ProductID": 2714763,
                        "SiteOrderItemID": "49404331684227",
                        "SellerOrderItemID": null,
                        "SiteListingID": "51788362",
                        "Sku": "815-TT",
                        "Title": "Decorative Test Tubes",
                        "Quantity": 1,
                        "UnitPrice": 19.95,
                        "TaxPrice": 0,
                        "ShippingPrice": 0,
                        "ShippingTaxPrice": 0,
                        "RecyclingFee": 0,
                        "GiftMessage": null,
                        "GiftNotes": null,
                        "GiftPrice": 0,
                        "GiftTaxPrice": 0,
                        "IsBundle": false,
                        "ItemURL": "",
                        "HarmonizedCode": null,
                        "Adjustments": [
                            {
                                "ID": 104923,
                                "ProfileID": 12345678,
                                "OrderID": 3164663,
                                "OrderItemID": 3149849,
                                "Quantity": 1,
                                "IsRestock": false,
                                "Reason": "GeneralAdjustment",
                                "ItemAdjustment": 34.99,
                                "TaxAdjustment": 0,
                                "ShippingAdjustment": 0,
                                "ShippingTaxAdjustment": 0,
                                "GiftWrapAdjustment": 0,
                                "GiftWrapTaxAdjustment": 0,
                                "RecyclingFeeAdjustment": 0,
                                "Type": "Refund",
                                "SellerAdjustmentID": "286944928679",
                                "PublicNotes": "Adjustment marked as 'Not Sent to Marketplace'",
                                "Comment": null,
                                "CreatedDateUtc": "2018-09-06T15:03:32.13Z",
                                "RequestStatus": "PostProcessingComplete",
                                "RestockStatus": null,
                                "RmaNumber": null,
                                "ReturnShippingFee": null,
                                "RestockingFee": null,
                                "ReturnTrackingNumberOrUrl": null,
                                "ReturnShippingMethod": null
                            }
                        ]
                    }
                ]
            }
        },
        {
            "Order": {
                "ID": 3165878,
                "ProfileID": 12345678,
                "SiteID": 640,
                "SiteName": "Amazon Seller Central - US",
                // Omitted Fields Irrelevant to This Example
                "Fulfillments": [],
                "Items": [
                    {
                        "ID": 3162939,
                        "ProfileID": 12345678,
                        "OrderID": 3165878,
                        "ProductID": 2726862,
                        "SiteOrderItemID": "49401518245795",
                        "SellerOrderItemID": null,
                        "SiteListingID": "98765432",
                        "Sku": "LgPotBlue25in",
                        "Title": "Clay Plant Pot - Blue 5 Inch Base",
                        "Quantity": 1,
                        "UnitPrice": 11.99,
                        "TaxPrice": 0,
                        "ShippingPrice": 4.95,
                        "ShippingTaxPrice": 0,
                        "RecyclingFee": 0,
                        "GiftMessage": null,
                        "GiftNotes": null,
                        "GiftPrice": 0,
                        "GiftTaxPrice": 0,
                        "IsBundle": false,
                        "ItemURL": "",
                        "HarmonizedCode": null,
                        "Adjustments": [
                            {
                                "ID": 105733,
                                "ProfileID": 12345678,
                                "OrderID": 3165878,
                                "OrderItemID": 3162939,
                                "Quantity": 1,
                                "IsRestock": false,
                                "Reason": "1",
                                "ItemAdjustment": 11.99,
                                "TaxAdjustment": 0,
                                "ShippingAdjustment": 4.95,
                                "ShippingTaxAdjustment": 0,
                                "GiftWrapAdjustment": 0,
                                "GiftWrapTaxAdjustment": 0,
                                "RecyclingFeeAdjustment": 0,
                                "Type": "Refund",
                                "SellerAdjustmentID": null,
                                "PublicNotes": null,
                                "Comment": "Failed",
                                "CreatedDateUtc": "2018-09-17T10:56:49.12Z",
                                "RequestStatus": "Error",
                                "RestockStatus": "Error",
                                "RmaNumber": null,
                                "ReturnShippingFee": null,
                                "RestockingFee": null,
                                "ReturnTrackingNumberOrUrl": null,
                                "ReturnShippingMethod": null
                            }
                        ]
                    }
                ]
            }
        },
		//Omitted additional orders from example to save space
    ],
    "@odata.nextLink": "https://api.channeladvisor.com/v1/OrderItems?access_token=xxxxxxxxxx&$filter=Adjustments%2FAny%20%28c%3Ac%2FID%20ne%20null%29&$select=Order%0A&$expand=Order%28%24expand%3DFulfillments%28%24expand%3DItems%29%2CFulfillments%28%24filter%3DDistributionCenterID%20lt%200%29%2C%20Items%28%24expand%3DAdjustments%29%29&$skip=20"
}