Process return and create refund

Process a return and create a refund for the associated order. This endpoint finalizes the return flow by issuing a refund tied to an existing return.

Required fields:

  • order_id
  • return_id

A successful request that refunds money returns 201 with the created refund details for the specified order. A return processed with
exchange items where nothing is refunded returns 200 with process_return_response instead.

Returns with exchange items:

  • Send the exchange items in exchange_line_items, together with the return line items in refund_line_items, to process them in one request. Their
    prices are netted, and what happens to the money is Shopify's suggested outcome for the whole order, the same as financial_outcome of the
    suggested refund: the items are first netted against what the order already owes.
  • When money is refunded (REFUND), the response is 201 with the refund, return_id, return_status, financial_outcome and the processed
    exchange_line_items.
  • When the customer owes money (INVOICE) or nothing is owed either way (EVEN), nothing is refunded and the response is 200 with
    process_return_response. For an INVOICE with notify set to true, Shopify's invoice for the order is emailed to the customer.
  • Shopify closes the return by itself a moment after everything in it is processed, so return_status can still read OPEN.
  • Without exchange_line_items, the return line items are refunded as before. A return that still has exchange items stays open, and they are
    listed in pending_exchange_line_items. Processing them in a later request does not net them with the refunded items: the exchange items are then
    charged in full.
  • Requests for Shopify are rejected with 400 when the return is not open, when a quantity is more than is left to process, or when transactions
    are sent and no refund is due. Custom integrations receive the request as is.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Scope

erc-ecommerce-return:write

Body Params

Process return refund request containing order ID, return ID, line items, and payment details.

The process return and refund request body.

string
required
length between 1 and 255

The order ID to create the refund for.

string
required
length between 1 and 255

The return ID to process and refund. This field is required.

string
length between 1 and 255

The brand identifier. If the account is multi-brand, this parameter is required.

boolean

Whether to notify the customer about the refund. For a return processed with exchange items where the customer owes money, Shopify's invoice for the order is also emailed to the customer.

string
length between 3 and 3

The currency code for the refund.

refund_line_items
array of objects

The line items to refund. When exchange_line_items is not empty, an omitted or empty refund_line_items processes only the exchange items. A line item with restock_type RETURN and a location_id is restocked at that location.

refund_line_items
transactions
array of objects

The payment transactions for the refund. For a return processed with exchange items, they are only used when money is refunded: when they are omitted, the transactions Shopify suggests are used, and when no refund is due they must be omitted.

transactions
exchange_line_items
array of objects

The exchange items of the return to process together with the return line items, so that their prices are netted. The money outcome is Shopify's, for the whole order (see financial_outcome). When it is omitted or empty, the return line items are refunded as for a return without exchange items, and a return that still has exchange items stays open. Processing the return line items and the exchange items in separate requests does not net them: the returned items are refunded in full and the exchange items are then charged in full. For Shopify, the return must be open and every quantity must be left to process. Custom integrations receive it as is.

exchange_line_items
Responses

Language
Credentials
OAuth2
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json