Refund a payment session
const url = 'https://api.paymee.online/api/v1/gateway/sessions/example/refund/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"reason":"example","refund_type":"FULL","amount":"example","metadata":"example"}'};
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.paymee.online/api/v1/gateway/sessions/example/refund/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "reason": "example", "refund_type": "FULL", "amount": "example", "metadata": "example" }'Issue a full or partial refund against a succeeded payment session. For PARTIAL refunds, amount is required. When the acquirer refund cannot be confirmed automatically, the response still succeeds with automated_refund: false and ops processes it manually.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Prefixed public id of the payment session (e.g. ps_...).
Request Bodyrequired
Section titled “Request Bodyrequired”Input serializer for refunding a payment session.
object
FULL- FULLPARTIAL- PARTIAL
Required for partial refunds. String with correct decimal places.
Input serializer for refunding a payment session.
object
FULL- FULLPARTIAL- PARTIAL
Required for partial refunds. String with correct decimal places.
Input serializer for refunding a payment session.
object
FULL- FULLPARTIAL- PARTIAL
Required for partial refunds. String with correct decimal places.
Responses
Section titled “Responses”Result of a refund request.
object
Identifier of the created refund.
Refunded amount as a decimal string.
True when the acquirer refund/reversal was confirmed automatically; false when ops must process it manually.
Present only when automated_refund is false: the acquirer failure reason.
Examplegenerated
{ "refund_id": "example", "refunded_amount": "example", "automated_refund": true, "epg_error_message": "example"}The referenced payment session does not exist for this merchant account.
RFC 9457 problem detail body (application/problem+json).
object
URI identifying the error type.
Short, human-readable summary of the error type.
HTTP status code.
Human-readable explanation specific to this occurrence.
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example"}One or more fields failed validation.
Problem detail with a per-field errors array (422 responses).
object
URI identifying the error type.
Short, human-readable summary of the error type.
HTTP status code.
Human-readable explanation specific to this occurrence.
A single field-level validation error inside a problem+json body.
object
Name of the field that failed validation.
Machine-readable error code, e.g. ‘required’.
Human-readable description of the failure.
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}
