Refund a committed payment intent, in whole or in part.
const url = 'https://api.paygasus.com/payments/card/pi_9Z3K01ARZ3NDEKTSV4RRFFQ69G5FAV/refund';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"amount":1000}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.paygasus.com/payments/card/pi_9Z3K01ARZ3NDEKTSV4RRFFQ69G5FAV/refund \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "amount": 1000 }'Refunds are aggregate-only: there is no per-refund object and no
refund-enumeration endpoint. Only amount_refunded on the intent reflects
the running total refunded; issue multiple calls for multiple partial
refunds up to the captured amount.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
pi_9Z3K01ARZ3NDEKTSV4RRFFQ69G5FAVPayment intent ID
Request Bodyrequired
Section titled “Request Bodyrequired”object
Amount to refund, in the currency’s minor units. Must not exceed the
remaining refundable amount (amount_captured − amount_refunded).
Example
1000Responses
Section titled “Responses”Refunded. The returned intent’s amount_refunded reflects the new aggregate total
object
A monetary amount in the currency’s minor units (e.g. cents for USD).
A monetary amount in the currency’s minor units (e.g. cents for USD).
A monetary amount in the currency’s minor units (e.g. cents for USD).
Currently supported currencies by Paygasus Pay
object
object
object
object
Non-terminal resting state for asynchronously-settled charges (e.g. ACH).
The processor has accepted the submission but the final outcome arrives
later via an event, which advances the intent to Committed/Failed.
object
object
object
object
Example
{ "amount": 1000, "amount_captured": 1000, "amount_refunded": 1000, "capture_method": "automatic", "currency": "USD", "id": "pi_9Z3K01ARZ3NDEKTSV4RRFFQ69G5FAV", "payment_method": { "brand": "AMEX" }, "status": { "status": "created" }}No such payment intent
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "param": "example", "type": "example" }}Intent is not in a refundable state, is already being processed, or the amount exceeds the refundable remaining
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "param": "example", "type": "example" }}Processor transport failure; the operation is retryable
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "param": "example", "type": "example" }}