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.

Endpoint ​

EndpointMethod
/api/admin/orders/{orderId}/refundsPOST

Request body ​

FieldTypeRequiredNotes
itemsarray of { orderItemId, quantity }yesItems to refund.
shippingfloatno (default 0)Original shipping to refund (base currency).
adjustmentRefundfloatno (default 0)Positive adjustment added to the refund total.
adjustmentFeefloatno (default 0)Fee subtracted from the refund total.

Errors ​

HTTPLang keyMessage
422bagistoapi::app.admin.order.actions.refund.closedClosed orders cannot be refunded.
422bagistoapi::app.admin.order.actions.refund.fraudFraud orders cannot be refunded.
422bagistoapi::app.admin.order.actions.refund.nothing-to-refundThere is nothing left to refund on this order.
422bagistoapi::app.admin.order.actions.refund.no-permissionYou do not have permission to create refunds.
422bagistoapi::app.admin.order.actions.refund.qty-exceedsRequested quantity (:requested) exceeds available quantity (:available) for SKU :sku.
422bagistoapi::app.admin.order.actions.refund.amount-zeroThe computed refund amount is zero. Adjust quantity, shipping or adjustment values.
422bagistoapi::app.admin.order.actions.refund.amount-exceeds-maxThe refund amount (:amount) exceeds the maximum refundable amount (:max).
422bagistoapi::app.admin.order.actions.refund.failedCould not create the refund.

To check the computed totals before committing, call Refund Preview (POST /api/admin/orders/{orderId}/refunds/preview) — it runs the same calculation without saving anything.

Released under the MIT License.