Skip to main content
POST
Refund a card payment (full or partial)

Authorizations

X-Suby-Api-Key
string
header
required

API key authentication

Headers

Idempotency-Key
string

Optional. A unique string you generate per refund. Retrying a request with the same key replays the original result (response header Idempotency-Replayed: true) instead of issuing the refund again — making a timed-out request safe to retry. Reusing a key with a different request body returns 409. Especially important for partial refunds, which are otherwise legitimately repeatable.

Maximum string length: 255

Path Parameters

paymentId
string
required

Body

application/json
reason
string

Reason for the refund

Maximum string length: 500
Example:

"Customer requested refund"

amountInCents
integer

Optional. Amount to refund in cents, in the payment's currency. Omit to refund the full remaining amount. When provided, must not exceed the remaining refundable amount (grossAmountCents - refundedAmountCents).

Required range: x >= 1
Example:

500

idempotencyKey
string

Optional alternative to the Idempotency-Key header (the header takes precedence). Same behavior — retrying with the same value replays the original result instead of re-refunding.

Maximum string length: 255
Example:

"refund-pay_abc123-01HZ..."

Response

Refund initiated (or the stored result replayed for a repeated Idempotency-Key).

success
boolean
Example:

true

data
object