Refunds
Create a refund
Creates a pending refund for a paid invoice. The refund goes to the refund address the customer used, in the coin they paid with. amount is in the business's settlement coin and defaults to what is left of that payment.
Nothing is sent yet: the business opens sign_url and approves the transfer from its payout wallet.
Rate limit: 60 per minute per API key, shared with the other endpoints that have this limit.
bearerAuthAuthorizationBearer <token>A live API key, sk_live_ followed by 32 base58 characters.
Idempotency-Key?stringA unique string of 1 to 255 characters for this operation. A key belongs to the business across every endpoint for 24 hours, so give each operation its own key, for example invoice-order-1042 and refund-order-1042, not the order id alone. A retry with the same key on the same endpoint and with the same body returns the stored response with the header Idempotent-Replayed: true. The same key with a different body or on another endpoint returns 409 idempotency_conflict. Errors are not stored, so a request that failed can be retried with the same key, even with a corrected body. While the first request with a key is still running, a retry gets 409 idempotency_conflict with Retry-After: 1.
1 <= length <= 255application/json- body
invoice_id*string1 <= lengthpayment_id?stringCompleted payment on the invoice to refund. Defaults to the payment that paid the invoice; set it to refund an extra payment, such as a second deposit.
1 <= lengthamount?TransferAmountDecimal string in the business's settlement coin, greater than 0.
^\d{1,12}(\.\d{1,18})?$The pending refund.
application/json- response
A refund or a payout. Money leaves the business's payout wallet only after the business approves it at sign_url.
id*stringStarts with ref_ for refunds and pay_ for payouts.
object*string"refund""payout"status*string"pending""processing""completed""failed""canceled"invoice_id*string|nullbatch_id*|Set for payouts created together, from a CSV in the dashboard or with POST /api/v1/payouts/batch.
amount*stringAmount of the business's settlement coin to send.
source_asset*stringThe business's settlement coin.
asset_id*stringThe coin the recipient receives.
recipient*stringtx_hash*string|nullfailure_reason*string|nullsign_url*stringDashboard page where the business approves the transfer from its payout wallet.
uricreated_at*stringdate-timecurl -X POST 'https://example.com/api/v1/refunds' \ -H 'Content-Type: application/json' \ -d '{ "invoice_id": "string"}'{ "id": "string", "object": "refund", "status": "pending", "invoice_id": "string", "batch_id": "string", "amount": "string", "source_asset": "string", "asset_id": "string", "recipient": "string", "tx_hash": "string", "failure_reason": "string", "sign_url": "http://example.com", "created_at": "2019-08-24T14:15:22Z"}