Skip to content

Refund a payment session

POST
/gateway/sessions/{session_id}/refund/
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.

session_id
required
string

Prefixed public id of the payment session (e.g. ps_...).

Input serializer for refunding a payment session.

object
reason
required
string
>= 1 characters <= 500 characters
refund_type
  • FULL - FULL
  • PARTIAL - PARTIAL
string
default: FULL
Allowed values: FULL PARTIAL
amount

Required for partial refunds. String with correct decimal places.

string
>= 1 characters
metadata
Media typeapplication/json

Result of a refund request.

object
refund_id
required

Identifier of the created refund.

string
refunded_amount
required

Refunded amount as a decimal string.

string
automated_refund
required

True when the acquirer refund/reversal was confirmed automatically; false when ops must process it manually.

boolean
epg_error_message

Present only when automated_refund is false: the acquirer failure reason.

string
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.

Media typeapplication/json

RFC 9457 problem detail body (application/problem+json).

object
type
required

URI identifying the error type.

string format: uri
title
required

Short, human-readable summary of the error type.

string
status
required

HTTP status code.

integer
detail
required

Human-readable explanation specific to this occurrence.

string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example"
}

One or more fields failed validation.

Media typeapplication/json

Problem detail with a per-field errors array (422 responses).

object
type
required

URI identifying the error type.

string format: uri
title
required

Short, human-readable summary of the error type.

string
status
required

HTTP status code.

integer
detail
required

Human-readable explanation specific to this occurrence.

string
errors
required
Array<object>

A single field-level validation error inside a problem+json body.

object
field
required

Name of the field that failed validation.

string
code
required

Machine-readable error code, e.g. ‘required’.

string
message
required

Human-readable description of the failure.

string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}