Refunds

Refund a paid invoice. Operator approves every refund before broadcast. Partial refunds supported — total refunds cannot exceed the original net credited amount.

POST /api/v1/merchant/invoices/{invoice_public_id}/refunds

Required scope: refunds.write. Required header: Idempotency-Key. The invoice must be in paid or partially_refunded state.

Body

FieldTypeNotes
amountstringDecimal. ≤ remaining refundable.
refund_addressstringAddress to send the refund to.
refund_address_memostringFor memo-capable networks.
reasonstringInternal note. ≤ 500 chars.
customer_visible_reasonstringShown in webhook payload. ≤ 500 chars.

Example

curl
curl -X POST https://api.swapss.lol/api/v1/merchant/invoices/INV-0123456789/refunds \
  -H "Authorization: Bearer sk_live_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "5.00",
    "refund_address": "TH...example",
    "reason": "Customer asked to cancel"
  }'

Lifecycle

pending_approval → approved → submitted → confirmed. On confirmed the parent invoice is rolled up to refunded when all of the net amount has been refunded, or partially_refunded if there's remainder. Failures return the locked amount to your available balance.

GET /api/v1/merchant/refunds

Paginated list. Filters: status, asset.

GET /api/v1/merchant/invoices/{public_id}/refunds

All refunds for one invoice.