Returns API Overview

This topic outlines how to use the API to create and process returns.

Create a Return

> To create a return, use the CreateReturn operation.

Note:  When creating a return, make sure to include all required fields as detailed in the API reference topic.

Authorize a Return

After you create a return, you can choose to authorize it.

> To authorize a return, use the PerformReturnActions operation, using a request body similar to the one shown in the following code block: Tip:  You can authorize returns in bulk using the PerformReturnActions operation. To do so, include additional comma-separated return IDs within the brackets of the ReturnIds field shown below.

{
	"ActionName": "Authorize",
	"ReturnIds": [ "09d9d6f55a57343098599740000043da" ]
}

When successful, the operation returns a collection of items containing the return(s) you updated. The return transitions to the Authorized state.

Process a Return

After a return is authorized, you can update the quantity of return items received or the items eligible for restocking, refund the return, and/or create a replacement order for the return. You can perform these actions in any order or combination.

Note:  It is no longer required to call the PerformReturnActions operation to change the return state after completing any of the steps in this section. The action/state transitions of Await/Pending, Receive/Received, Restock/Restocked, Refund/Refunded, and Ship/Shipped are deprecated (but still supported for backwards-compatibility with legacy applications). Now, a return can directly transition from Authorized to Closed/Cancelled/Rejected.

Receive and Restock

To update the received or restockable item quantities:

  1. For an existing return object, update the returnItem.quantityReceived or returnItem.quantityRestockable properties. Tip:  To obtain an existing return object, use the response from the CreateReturn operation, or use another operation that retrieves a return, such as the GetReturn operation.
  2. Use the UpdateReturn operation to send the updated return object to the system.

Refund

To refund a return:

  1. Use the GetPayments operation to retrieve the payments available on the return, which includes payment IDs from the parent order.
  2. Refund the payment based on whether you are crediting an existing payment or issuing a new store credit or check:
    • (Credit Existing Payment)—Use the PerformPaymentActionForReturn operation, specifying the payment ID you noted in Step 1 as a URI parameter and including a request body similar to:
      {
      	"ActionName": "CreditPayment",
      	"Amount": 10.0
      }
    • (Issue New Store Credit or Check)—Use the CreatePaymentActionForReturn operation, including a request body similar to:
      {
      	"ActionName": "CreditPayment",
      	"Amount": 10.0,
      	"NewBillingInfo": {
      		"PaymentType": "StoreCredit" or "Check"				
      	}
      }
  3. Verify that the responses from the payment operations include return objects that contain the new payment interactions.

Replace

>To ship a replacement item, use the CreateReturnShippingOrder operation to create a replacement order for the return.

Note:  The request body (a collection of ReturnItemSpecifier) is optional. If the body is empty, the operation replaces all remaining items marked for replace. If you want to replace only a specific item(s) marked for return, you must specify the item(s) in the request body, such as the one given in the following code block:
[
	{
		"Quantity": 2,
		"ReturnItemId": "79bb306d265c4c618077a74301029114"
	},
	{
		"Quantity": 1,
		"ReturnItemId": "97bb03d662c5c41608777a3410201941"
	}
]

If successful, the operation returns the new child order. At this point, you must proceed to complete (or cancel) the new child order. You cannot close the parent return if a child order is open.

Close a Return

Note:  Before you can close a return, you must:
  • Authorize the return.
  • Refund a payment or return an item on the return.
  • Close or cancel any replacement orders created on the return.

> To close a return, use the PerformReturnActions operation, using a request body similar to the one shown in the following code block: Tip:  You can close returns in bulk using the PerformReturnActions operation. To do so, include additional comma-separated return IDs within the brackets of the ReturnIds field shown below.

{
	"ActionName": "Close",
	"ReturnIds": [ "09d9d6f55a57343098599740000043da" ]
}

When successful, the operation returns a collection of items containing the return(s) you closed. The return transitions to the Closed state.