Skip to content

Search API reference

Find an endpoint or a guide of the Sovgate API reference and jump straight to it.

Create a refund

Give back all or part of a payment.

POST/v1/refunds

Refunds a payment that succeeded, to the card it was paid with. It can't be canceled once made. Making a refund costs nothing; the payment's own fee isn't returned.

Endpoint

http
POST /v1/refunds

Request body

NameTypeRequiredDescription
paymentstringRequiredThe payment to refund, pay_....
amountintegerOptionalIn cents. Default: all that is left of the payment.
reasonenumRequiredrequested_by_customer, duplicate, fraudulent or other.
notestringOptionalFor your team; the customer doesn't see it. Required for other. Up to 500 characters, with no card number.
confirm_duplicatebooleanOptionalSet it to repeat a refund refused with possible_duplicate: the same amount of the same payment moments ago.

Example request

bash
curl -X POST https://api.sovgate.com/v1/refunds \  -H "Authorization: Bearer sov_sk_test_your_key" \  -H "Idempotency-Key: 505f4ae9-4b2a-4c1d-9e3f-717a4094153a" \  -H "Content-Type: application/json" \  -d '{  "payment": "pay_baa7f53c0bc0867df75250d9",  "amount": 1000,  "reason": "requested_by_customer"}'

Example response

json
{  "id": "re_0d1143ee96c031b8ebefe0df",  "object": "refund",  "livemode": false,  "payment": "pay_baa7f53c0bc0867df75250d9",  "amount": 1000,  "currency": "usd",  "status": "pending",  "reason": "requested_by_customer",  "failure_reason": null,  "destination": {    "type": "refund"  },  "created": "2026-11-27T14:05:14Z",  "succeeded_at": null,  "failed_at": null}

Errors

CodeWhen
invalid_stateThe payment didn't succeed, is held (cancel it instead), has a chargeback open, or is in an open batch refund.
parameter_invalidThe amount is more than what's left to refund.
possible_duplicateThe same amount of the same payment was refunded moments ago.