Refund an order
Refunds a completed order, all of it. Which destination an order can take is in refund on the order: a payment method that cannot send money back (crypto, always) can only be refunded as store credit or recorded.
Send an Idempotency-Key with this request. The order is marked refunded only once the payment provider has said the money is on its way, or the buyer has been credited.
Needs the orders.refund permission (Refund Orders).
Authorizations
A secret API key, made under Developers in the dashboard: Authorization: Bearer shoply_sk_...
Headers
A word of your own for this one change, up to 180 letters, digits, dots, dashes, underscores and colons. Sent again with the same key, the request is not carried out twice: the first answer comes back, with Idempotent-Replay: true.
Path Parameters
The store's ID. A key reaches the store it was made in: GET /key answers which.
The order. The ID in a checkout's address is the order's ID.
Body
source: back through the payment provider, to what paid. balance: credit on the buyer's balance at the store. record: only marked as refunded, because you returned the money yourself.
source, balance, record Why.
requested, duplicate, fraudulent, other For balance only: how much to credit, from 0.01 up to what was paid, with at most 2 decimals. Left out, all of it.

