id. A payment’s line items describe what was paid for (each with its share of the service fee); they are not refunded individually.
Line-item refunds are not supported. Pass the payment’s
id in the {id} path parameter; a line-item id returns 404 PAYMENT_NOT_FOUND.Full and partial refunds
The principal is the payment amount excluding the service fee.- The service fee is refunded only on a full refund with
feeType: "include_fee". Partial refunds return principal only. - If you refunded the principal without the fee, send another refund with
feeType: "include_fee"and noamountCentsto refund the fee. - Asking for more principal than remains returns
422 INVALID_STATE;messagegives the remaining amount in cents. reasonis optional (up to 1000 characters).
reversalType
The response’s reversalType identifies whether the payment was voided or refunded:
"void"means the payment had not settled and was voided."refund"means the payment had settled and was refunded.
Amounts after a refund
On the payment (GET /payments/{id}):
refundedAmountCentsis the total refunded so far, including principal and service fee.remainingRefundableAmountCentsis the amount still refundable, including principal and service fee.statusispartially_refundeduntil the principal and service fee have both been fully refunded. It then becomesrefunded.
Example: full refund including the fee
target is always "group", indicating that the refund applies to the payment. Individual line items cannot be refunded separately.
amountCents is the amount returned by this refund. In this example, it includes 10000 cents of principal and a 300-cent service fee.
Example: partial refund
cURL
When the fee refund fails
If the principal refund succeeds but the separate service-fee refund fails, you get502 PARTIAL_REFUND_PENDING with details.remainingRefundableAmountCents. Retry the same refund to finish it. See Errors.
Line items
Each line item in the payment response carries itsamountCents, its pro-rated share of the service fee (serviceFeeCents), and your referenceId, description and metadata. Use them for reconciliation and display.
Idempotency
Refunds support theIdempotency-Key header, so retries are safe. See Idempotency.