Shopify returns

Shopify returns

With EcartAPI you can run the whole Shopify returns cycle:

  • Know what can be returned.
  • Create the return as the seller or on behalf of the buyer.
  • Approve or decline buyer requests.
  • Send the items back with tracking and a label.
  • Restock, fulfill exchanges and refund.
  • Close or reopen the return.

This guide explains each piece and the Shopify behaviors you will run into. The API Reference has every request and response.

📘

Before you start

  • Shopify requires the read_returns scope to read returns and write_returns to create or change them. Your app must request them and the store must authorize them; a store connected before you added them has to authorize the app again.
  • Every amount, quantity and boolean is sent and received as a string ("1", "25.99", "true").
  • Ids are numeric strings. Shopify global ids (gid://shopify/Return/123) are also accepted.

Concepts

ConceptWhat it isWhere it appears
ReturnThe return of one or more items of an order, with its status, reasons and refunds.return
Return itemAn order item being returned, with its quantity and reason.return.returnItems[]
Exchange itemA product the customer receives in place of the returned one.return.exchangeItems[]
Return packageWhat has to travel back to the store. A return can have several packages.return.returnPackages[]
Return fulfillmentOne shipment of a package back to the store, with tracking and a label. A package can have several.returnFulfillment
RefundMoney returned to the customer for the return.return.refunds[]
flowchart LR
  O[Order] --> R[Return]
  R --> RI[Return items]
  R --> EI[Exchange items]
  R --> RP[Return packages]
  RP --> RF[Return fulfillments]
  R --> RE[Refunds]

The return flow mirrors the order flow: order → package → fulfillment becomes return → return package → return fulfillment. returnFulfillmentOrderId in a return is the counterpart of fulfillmentOrderId in an order.


Endpoints

EndpointWhat it does
Get returnable items GET /orders/{orderId}/returns/returnableItems of the order that can still be returned
Get return reasons GET /returns/reasonsReasons catalog of the store
Create a return POST /orders/{orderId}/returnsCreate a seller return or a buyer request
Get all returns GET /orders/{orderId}/returnsReturns of an order
Get a return GET /orders/{orderId}/returns/{returnId}Full detail of a return
Get a return by id GET /returns/{returnId}Same detail when you do not have the order
Approve POST …/returns/{returnId}/approveApprove a buyer request
Reject POST …/returns/{returnId}/rejectDecline a buyer request
Cancel POST …/returns/{returnId}/cancelCancel before processing
Process POST …/returns/{returnId}/processReceive items, restock, fulfill exchanges and refund
Close POST …/returns/{returnId}/closeClose a return
Reopen POST …/returns/{returnId}/reopenReopen a closed return
Get return fulfillments GET …/returns/{returnId}/fulfillmentsShipments of a return
Get a return fulfillment GET …/fulfillments/{returnFulfillmentId}One shipment
Create a return fulfillment POST …/returns/{returnId}/fulfillmentsAdd tracking and label for a package
Update a return fulfillment PUT …/fulfillments/{returnFulfillmentId}Fix tracking or label

… stands for /orders/{orderId}. The order endpoint also lists the return packages of an order with GET /orders/{orderId}?include=returnPackages.


Statuses

status is an object, the same shape used in orders:

"status": { "id": null, "status": "OPEN", "ecartapi": "open", "ecartapiId": "2", "substatus": null }
  • status: the raw Shopify value.
  • ecartapi / ecartapiId: the EcartAPI standard. Use it to build logic that also works with other platforms.
  • id and substatus are always null on Shopify.
Shopify statusecartapiecartapiIdMeaning
REQUESTEDrequested1The buyer asked for the return; waiting for the seller
OPENopen2Approved or created by the seller; items on their way or being handled
DECLINEDdeclined3The request was declined
CANCELEDcanceled4Canceled before processing
CLOSEDclosed5Finished
—other6A status without a mapping
stateDiagram-v2
  [*] --> REQUESTED: create (buyer)
  [*] --> OPEN: create (seller)
  REQUESTED --> OPEN: approve
  REQUESTED --> DECLINED: reject
  OPEN --> CANCELED: cancel (before processing)
  OPEN --> CLOSED: process all items (asynchronous) or close
  CLOSED --> OPEN: reopen

Return package status. Shopify leaves a package OPEN even after its items are processed, and there is no way to close it. So in returnPackages[].status:

  • status keeps the raw Shopify value.
  • ecartapi is computed:
    • closed when every item of the package was processed, or when the return is closed.
    • canceled when the return was canceled.
    • open otherwise.

Use ecartapi to know whether a package is done.


The return object

{
  "id": "39195148457",
  "name": "#1721-R2",
  "orderId": "18997674868905",
  "status": { "id": null, "status": "CLOSED", "ecartapi": "closed", "ecartapiId": "5", "substatus": null },
  "requestedBy": "seller",
  "totalQuantity": "1",
  "decline": { "isDeclined": "false", "reason": null, "note": null },
  "returnItems": [
    {
      "id": "53728247977",
      "orderItemId": "50925749567657",
      "fulfillmentItemId": "18725256593577",
      "productId": null,
      "variantId": null,
      "name": "Hacha Rhitta - Seven Deadly Sins",
      "sku": "hacha-333",
      "quantity": "1",
      "processedQuantity": "1",
      "reason": { "id": "9", "handle": "style", "name": "Style" },
      "reasonNote": "Exchange requested by the customer",
      "customerNote": null
    }
  ],
  "exchangeItems": [
    { "id": "3793289385", "productId": "9008390570153", "variantId": "47306191896745", "name": "Descuentos - large / white", "sku": "34567", "quantity": "1", "processedQuantity": "1" }
  ],
  "returnPackages": [
    {
      "id": "38720798889",
      "returnFulfillmentOrderId": "38720798889",
      "status": { "id": null, "status": "OPEN", "ecartapi": "closed", "ecartapiId": "5", "substatus": null },
      "logisticMode": null,
      "items": [
        { "id": "52528480425", "returnItemId": "53728247977", "orderItemId": "50925749567657", "name": "Hacha Rhitta - Seven Deadly Sins", "quantity": "1" }
      ]
    }
  ],
  "refunds": [
    { "id": "1036219138217", "amount": "0.00", "currency": "MXN", "note": null, "createdAt": "2026-11-19T23:55:28Z" },
    { "id": "1036221137065", "amount": "39.44", "currency": "MXN", "note": null, "createdAt": "2026-11-20T00:25:14Z" }
  ],
  "dates": { "createdAt": "2026-11-19T23:51:23Z", "approvedAt": "2026-11-19T23:51:23Z", "closedAt": "2026-11-19T23:55:30Z", "updatedAt": null }
}
PropertyMeaning
idReturn id. Use it as {returnId} in the routes.
nameName shown in Shopify (#1721-R2).
orderIdOrder the return belongs to.
statusStatus object (see Statuses).
requestedBybuyer or seller. On returns read from Shopify, it is seller when the return was approved at the moment it was created, and buyer when it was requested and approved later.
totalQuantityTotal units in the return.
declineAlways an object. isDeclined is "true" when the request was declined; reason (FINAL_SALE, OTHER, RETURN_PERIOD_ENDED) and note explain why.
returnItems[].idReturn item id. You send it as items[].id when processing.
returnItems[].orderItemIdThe order item being returned (items[].id in the order).
returnItems[].fulfillmentItemIdThe item of the original shipment.
returnItems[].productId / variantIdnull on Shopify. Match orderItemId with the order items[].id to get them.
returnItems[].quantity / processedQuantityUnits being returned / units already processed.
returnItems[].reasonAlways an object: { id, handle, name }.
returnItems[].reasonNote / customerNoteNote from the seller / note from the buyer.
exchangeItems[]Products the customer receives. id is sent when processing; processedQuantity tells how many were already fulfilled.
returnPackages[].idPackage id. Equal to returnFulfillmentOrderId.
returnPackages[].returnFulfillmentOrderIdSend it when creating a return fulfillment for this package.
returnPackages[].items[].idPackage item id. Send it as items[].id when creating a return fulfillment and as dispositions[].returnPackageItemId when processing.
returnPackages[].items[].returnItemIdThe return item this package item belongs to.
refunds[]Refunds linked to the return: id, amount, currency, note, createdAt. See Zero-amount refunds.
datescreatedAt, approvedAt, closedAt, updatedAt.

Objects are never null in returns: status, decline, dates, reason, package status, and the return fulfillment tracking and document are always objects whose keys can be null. Lists are always lists ([] when empty).

The return fulfillment object

{
  "id": "9313190057",
  "returnId": "39178993833",
  "returnFulfillmentOrderId": "38704840873",
  "orderId": "18996869333161",
  "status": null,
  "tracking": { "number": "223444000", "company": null, "url": "https://tracking.example.com/223444000" },
  "document": { "url": "https://cdn.example.com/labels/223444000.pdf" },
  "items": [
    { "id": "12757663913", "returnItemId": "53704687785", "returnPackageItemId": "52505215145", "orderItemId": "50923588878505", "productId": null, "variantId": null, "name": "Descuentos - large / white", "sku": null, "quantity": "1" }
  ]
}
PropertyMeaning
idReturn fulfillment id ({returnFulfillmentId}).
returnId / returnFulfillmentOrderId / orderIdReturn, package and order it belongs to.
statusAlways null on Shopify: Shopify gives no status to the shipment. Follow the return and its packages.
tracking{ number, company, url }.
document.urlReturn label.
items[].quantityUnits in this shipment.
items[].returnItemIdFilled only by the list endpoint; null in the other responses.

Where each id comes from

You sendTake it from
Create return → items[].idReturnable → items[].fulfillmentItemId
Create return → items[].reasonIdReturn reasons → reasons[].id
Create return → exchangeItems[].variantIdThe product variant you will send
Create return fulfillment → returnFulfillmentOrderIdreturnPackages[].returnFulfillmentOrderId
Create return fulfillment → items[].idreturnPackages[].items[].id
Process → items[].idreturnItems[].id
Process → dispositions[].returnPackageItemIdreturnPackages[].items[].id of the same return item (its returnItemId equals items[].id)
Process → dispositions[].locationIdGet all locations → id
Process → exchangeItems[].idexchangeItems[].id of the return
Process → refund.transactions[].parentIdGet order transactions → a transaction of kind sale or capture

Flows

A. The seller creates the return

  1. Get the returnable items and pick the units.

  2. Create the return with requestedBy: seller. It is OPEN right away.

    { "return": { "requestedBy": "seller", "items": [{ "id": "18723222716585", "quantity": "1", "reasonId": "1", "reasonNote": "Too small" }] } }
  3. Create a return fulfillment with the tracking and label of the package. Your project generates the label (see Return labels).

    { "returnFulfillment": { "returnFulfillmentOrderId": "38704840873", "items": [{ "id": "52505215145", "quantity": "1" }], "tracking": { "number": "223444000", "url": "https://tracking.example.com/223444000" }, "documents": { "document": "https://cdn.example.com/labels/223444000.pdf" }, "notifyCustomer": "true" } }
  4. When the package arrives, process the return: restock and refund.

    { "returnProcess": { "items": [{ "id": "53704687785", "quantity": "1", "dispositions": [{ "returnPackageItemId": "52505215145", "quantity": "1", "type": "RESTOCKED", "locationId": "79469592745" }] }], "refund": { "transactions": [{ "parentId": "20944553705641", "amount": "25.99", "currency": "MXN" }] }, "notifyCustomer": "true" } }
  5. Shopify closes the return by itself when every item is processed. See Closing is asynchronous.

B. The buyer requests a return and you approve it

  1. The request reaches you in one of two ways:
    • Your portal creates it with requestedBy: buyer. It is REQUESTED.

      { "return": { "requestedBy": "buyer", "items": [{ "id": "18725256593577", "quantity": "1", "reasonId": "9", "customerNote": "I would like the large / white version" }] } }
    • The buyer requests it from their Shopify account and the returns webhook delivers the full return.

  2. Approve it (optional body: { "return": { "notifyCustomer": "true" } }). It moves to OPEN. Get the return to read its returnPackages[] before creating a return fulfillment.
  3. Continue with steps 3 to 5 of flow A.

C. The buyer requests a return and you decline it

Reject it with a reason. It moves to DECLINED and decline.isDeclined is "true".

{ "return": { "declineReason": "RETURN_PERIOD_ENDED", "declineNote": "The 30-day return window has ended.", "notifyCustomer": "true" } }

D. The buyer wants an exchange

Shopify does not accept exchange items in a buyer request, and they cannot be added to a REQUESTED return. To give the buyer an exchange:

  1. Decline the buyer request (flow C). The note can tell the buyer that a new return is coming.

  2. Create a seller return for the same items with exchangeItems. You can keep the buyer's note in reasonNote.

    { "return": { "requestedBy": "seller", "items": [{ "id": "18725256593577", "quantity": "1", "reasonId": "9", "reasonNote": "Exchange requested by the customer" }], "exchangeItems": [{ "variantId": "47306191896745", "quantity": "1" }] } }
  3. Create the return fulfillment as in flow A.

  4. Process the return item and the exchange item (exchangeItems[].id comes from the return). If your policy refunds part of the price, add refund (see Refund amounts).

    { "returnProcess": { "items": [{ "id": "53728247977", "quantity": "1", "dispositions": [{ "returnPackageItemId": "52528480425", "quantity": "1", "type": "RESTOCKED", "locationId": "79469592745" }] }], "exchangeItems": [{ "id": "3793289385", "quantity": "1" }] } }

E. Refund later

You can process the items first and refund afterwards:

  1. Process with items and no refund. Shopify records a zero-amount refund (see Zero-amount refunds).

  2. When you are ready, process again with only refund. This works even if the return is already CLOSED, and the refund stays linked to the return.

    { "returnProcess": { "refund": { "transactions": [{ "parentId": "20945627578537", "amount": "39.44", "currency": "MXN" }] }, "notifyCustomer": "true" } }

F. Cancel, close or reopen

  • Cancel an OPEN return before anything is processed.
  • Close a return that stays OPEN after you finished with it.
  • Reopen a CLOSED return to process it again.

None of them take a body.


Webhooks

Subscribe to these resources to follow returns without polling (see Webhooks). Each delivery is the full object, the same one the API returns.

Register one webhook per resource and action:

POST /api/v2/webhooks

{
  "resource": "returns",
  "action": "create",
  "url": "https://yourdomain.com/webhooks/returns/create"
}

Repeat it for returns / update and returnFulfillments / create.

Resource / actionShopify eventBody
returns / createThe buyer requested a returnThe return
returns / updateA return was approved, declined, canceled, processed, closed, reopened or changedThe return
returnFulfillments / createTracking or a label was added to a return fulfillmentThe return fulfillment

Things to keep in mind

Closing is asynchronous

When the last item is processed, Shopify closes the return a moment later. The process response can still say OPEN with closedAt: null. To get the final status:

  • read the return again, or
  • wait for the returns / update webhook.

Call close only if the return stays OPEN.

Zero-amount refunds

Processing without refund makes Shopify create a refund of 0.00. It records the restocked items. It also shows that the return was processed without money back, so it is listed in refunds[] on purpose.

Refund amounts

EcartAPI and Shopify refund exactly the amount you send in refund.transactions[].amount. Neither of them computes it: how much to refund (item price, discounts, taxes, shipping, exchanges, fees) is decided by your project and your return policy.

What Shopify requires:

  • parentId is a transaction of kind sale or capture of the order.
  • amount is in the currency of that transaction, which is the currency the customer paid in.
  • The total refunded cannot exceed what was paid for the order, unless you send allowOverRefunding: "true".

Data you can read from EcartAPI:

WhereFields
Order items (Get an order)price: unit price before discounts. discount: discounts allocated to the whole line. salePrice: price minus discount divided by quantity. All three in the store currency; priceExtension and discountExtension are in the customer's currency.
Ordercurrency (store), currencyExtension (customer), taxesIncluded, taxLines[]
Order transactionskind (sale, capture, refund…), amount, currency
Order refunds[]Refunds already issued on the order: amount and refundItems
Return refunds[]Refunds linked to this return
  • A sale transaction keeps its original amount after a refund; each refund is listed as a separate transaction of kind refund.
  • Item-level taxes are not available for Shopify orders (items[].tax is null).
  • EcartAPI cannot charge the customer. If an exchange item costs more than the returned one, collect the difference through your own channel.

Return labels

EcartAPI does not generate return labels. Your project creates the label and sends its tracking and URL when creating the return fulfillment. For the origin and destination of the label, we suggest using the order's shipping address (Get an order) and the store locations (Get all locations).

Check that dispositions match

Shopify accepts a returnPackageItemId from another return or another item without an error, and then the restock is not applied where you expect. For each item you process:

  • Find its package item in returnPackages[].items[], where returnItemId equals the return item id.
  • Use that package item's id as returnPackageItemId.

Several packages

A return can have more than one package. In that case:

  • Send returnFulfillmentOrderId when you create a return fulfillment; without it the request is rejected. With a single package it is optional.
  • Each package reports its own status.

What the lists include

  • The returns list of an order includes up to 10 returns, without pagination or filters. Each return shows fewer items and refunds than the detail. Get a return by id for the full data.
  • Only the return fulfillments list fills items[].returnItemId.

Product and variant ids

returnItems[].productId and variantId are null on Shopify. Match orderItemId with the order items to get them.

Reasons and notes

  • Get the reasons with the reasons endpoint instead of hard-coding them; any reason applies to any product.
  • If you send a reason handle that does not exist, it is saved as a note.
  • reasonNote (seller, max 255) is used in seller returns; customerNote (buyer, max 300) in buyer requests.

Implementation checklist

  • The store grants read_returns and write_returns.
  • Webhooks registered for returns (create, update) and returnFulfillments (create).
  • Return reasons loaded from the reasons endpoint, not hard-coded.
  • Refund amounts decided by your project and your return policy.
  • Return labels generated by your project.
  • Location ids for restocking taken from the locations endpoint.
  • Each disposition uses the package item of the same return item.
  • The final status is read after processing (asynchronous close).
  • Full flow tested in a Shopify development store.

Errors

CaseResponse
The body does not match the schema422 with the validation detail
An id with an invalid format400
The return belongs to another order, or the return or return fulfillment does not exist404
Creating a return fulfillment without returnFulfillmentOrderId when the return has zero or several packages400
Shopify rejects the operation (for example, approving a return that is not REQUESTED)400 with the Shopify detail

Errors use the standard shape:

{ "statusCode": 422, "error": "Unprocessable Entity", "message": "\"returnProcess\" must contain at least one of [items, exchangeItems, refund, refundShipping]", "ecartapiError": true }

Did this page help you?