Skip to content

Create Refund

Refunds one or more order items, with an optional shipping refund and an adjustment fee/refund. The same eligibility checks as the admin Refund screen apply (the order must not be closed or marked fraud, and each item's requested quantity must be ≤ its still-refundable quantity, qty_to_refund). The refund totals are computed from the items + shipping + adjustments, and the total cannot exceed the order's remaining refundable balance.

After the mutation, fetch the full refund via adminRefund(id:) or the REST GET /api/admin/refunds/{id} endpoint.

Prerequisites

The example item quantities must be ≤ each item's qty_to_refund. Already-refunded quantities are rejected with "We found an invalid quantity to refund items." — fetch the order detail to see the current per-item refundable qty before submitting.

Operation

OperationType
createAdminRefundMutation

Errors

ConditionLang keyMessage
Order closedbagistoapi::app.admin.order.actions.refund.closedClosed orders cannot be refunded.
Order fraudbagistoapi::app.admin.order.actions.refund.fraudFraud orders cannot be refunded.
Nothing to refundbagistoapi::app.admin.order.actions.refund.nothing-to-refundThere is nothing left to refund on this order.
No permissionbagistoapi::app.admin.order.actions.refund.no-permissionYou do not have permission to create refunds.
Qty exceeds availablebagistoapi::app.admin.order.actions.refund.qty-exceedsRequested quantity (:requested) exceeds available quantity (:available) for SKU :sku.
Amount zerobagistoapi::app.admin.order.actions.refund.amount-zeroThe computed refund amount is zero. Adjust quantity, shipping or adjustment values.
Amount exceeds maximumbagistoapi::app.admin.order.actions.refund.amount-exceeds-maxThe refund amount (:amount) exceeds the maximum refundable amount (:max).
Save failedbagistoapi::app.admin.order.actions.refund.failedCould not create the refund.

Released under the MIT License.