process a return and refund on a shopify order via admin api

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

This API has logged drift

shopify.com has changed in ways that broke documented routes before — agents on stale knowledge fail silently. Get alerted when shopify.com drifts again →

In-depth guide

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

Steps

  1. Call the `returnCreate` mutation with the `orderId` and a `returnLineItems` array specifying `fulfillmentLineItemId`, `quantity`, and `returnReason` for each item being returned.
  2. Once the return is created, use `reverseDeliveryCreateWithShipping` or mark the return as received using `returnReceive` after the physical goods arrive, updating return line item statuses.
  3. To issue a refund for the returned items, call the `refundCreate` mutation with `orderId`, `refundLineItems` (referencing `lineItemId` and quantity), and `transactions` specifying the refund amount and `gateway`.
  4. Set `shipping` in the refund input if you also want to refund shipping costs, and set `notify` to true to email the customer.
  5. Check `refundCreate` response for `userErrors` and validate that the returned `refund.transactions` reflect the expected amounts.
  6. For restocking returned inventory, ensure `restockType` is set to `RETURN` or `CANCEL` in the refund line items input, and verify the target location is specified.

Known gotchas

Related routes

Implement a returns and RMA flow using Shopify's Refund and Return APIs, including restocking, partial refunds, and return label generation
shopify.dev · 5 steps · unrated
Initiate a return request on a Shopify order and approve it using the returnRequest and returnApproveRequest Admin GraphQL mutations
shopify.dev · 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,500+ 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