Skip to Content
PaymentsRefund

Refund a Payment

POST /v1/payments/refund

Refunds a captured payment, either fully or partially. Only PaymentIntents with status succeeded can be refunded.

Request Parameters

ParameterTypeRequiredDescription
payment_intent_idstring (UUID)YesThe ID of the captured PaymentIntent to refund.
amountintegerNoAmount to refund in cents. Set to 0 or omit for a full refund.
reasonstringNoReason for the refund (e.g., customer_request, duplicate, fraudulent).
connector_accountstringNoMust equal the connector account that settled the originating sale / authorize. See the override-forbidden note below.

Refund inherits the originating connector account. The gateway refunds through the same account that originally settled the charge, regardless of the merchant’s current default. Passing a different connector_account (body or X-Connector-Account header) returns 400 connector_account_override_forbidden. If the originating account has been hard-deleted, refund returns 409 originating_account_unavailable.

Examples

Full Refund

Partial Refund

To refund a specific amount, set amount to the desired value in cents:

curl -X POST https://sandbox.api.gatelithix.com/v1/payments/refund \ -H "Authorization: Bearer sk_test_your_key_here" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: ref_$(uuidgen)" \ -d '{ "payment_intent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "amount": 1500 }'

Multiple partial refunds can be issued against the same PaymentIntent until the total refunded amount equals the original amount.

Response

{ "id": "r1234567-89ab-cdef-0123-456789abcdef", "payment_intent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "amount": 5000, "status": "succeeded", "reason": "customer_request", "connector_account_id": "aa0e8400-e29b-41d4-a716-446655440aaa", "connector_account_short_id": "ca_abc123def4", "test_mode": true, "created_at": "2026-03-18T12:05:00Z" }

Error — override forbidden

Refund refuses any connector_account that differs from the one that originally settled the PaymentIntent. If the originating sale used ca_abc123def4 but refund specifies ca_ghi789jkl0:

POST /v1/payments/refund Authorization: Bearer sk_test_your_key_here Idempotency-Key: ref_01HK... Content-Type: application/json { "payment_intent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "amount": 1500, "connector_account": "ca_ghi789jkl0" }

Response — 400 Bad Request:

{ "error": { "type": "invalid_request_error", "code": "connector_account_override_forbidden", "message": "Refund must use the same connector_account as the originating charge.", "param": "connector_account", "request_id": "req_01HK9ABCD3F7X1YZ2Q3W4E5R6T" } }

Fix: drop the connector_account field on refund — the gateway inherits it from the originating charge automatically.

Error Cases

Error CodeHTTP StatusCause
invalid_param400Missing payment_intent_id
refund_exceeds_amount400Refund amount exceeds remaining balance
payment_intent_not_found404PaymentIntent does not exist
invalid_state_transition409PaymentIntent is not in succeeded status
connector_account_override_forbidden400Refund supplied a different connector_account than the originating charge. See example above.
connector_account_inactive400Originating connector account has since been soft-deleted.
originating_account_unavailable409Originating connector account has been hard-deleted; refund cannot route through it. Contact the processor directly and reconcile via ledger adjustment.