Implement a returns and RMA flow using Shopify's Refund and Return APIs, including restocking, partial refunds, and return label generation

domain: shopify.dev · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Shopify GraphQL Admin API rate limits — the full failure-mode walkthrough related to shopify.dev, checked against official docs, with linked verified routes.

Steps

  1. Create a return using the returnCreate Admin GraphQL mutation, specifying the orderId and returnLineItems with quantity and fulfillmentLineItemId for each item being returned
  2. Retrieve the return's status and the generated return label (if a shipping label was requested) via the return object; the label is accessible through returnShippingLabelCreate mutation if not auto-generated
  3. When the returned item arrives, call returnClose to mark the return complete, then use refundCreate to issue the refund specifying refundLineItems, refundShippingLine, and transactions array with the gateway and amount
  4. For partial refunds (restocking fee or partial quantity), set the amount in the transactions array to the partial amount; Shopify validates it does not exceed the original transaction amount
  5. Trigger restock by setting restockType to RETURN in the refundLineItems; specify locationId for the restocking destination location

Known gotchas

Related routes

Implement Returnly returns portal API integration to initiate returns, generate labels, and sync refund state back to Shopify
Returnly + Shopify returns · 6 steps · unrated
Implement a returns and RMA workflow using Loop Returns API concepts
loop-returns · 6 steps · unrated
Initiate a Shopify return with returnCreate, create a reverse delivery, and issue a partial refund
shopify.dev · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans