POST /v1/payments/{paymentId}/refund.
What can be refunded
The eligibility rules are enforced server-side and surfaced in the payment detail response underrefundEligibility.
A refund issued for a non-eligible payment returns a
400 with one of the
codes above.
Issue a refund
Currently only full refunds are supported. Send noamount to refund the
full remaining balance, or send the exact remaining refundable amount.
Refund lifecycle
A refund can be in one of these statuses:
Listen for
PAYMENT_REFUNDED and PAYMENT_REFUND_FAILED webhook events to
react to status changes.
Idempotency
SendingPOST /v1/payments/{paymentId}/refund requires an
X-Idempotency-Key header. Reusing the same key with the same body returns
the original response. Reusing the key with a different body returns
409 IDEMPOTENCY_PAYLOAD_MISMATCH.
While a refund is being processed for a given payment, additional refund
requests fail with 409 REFUND_IN_PROGRESS until the current refund settles.

