Refund
https://api-sandbox.epag.io/refund
To request a refund for a transaction, please note that partial refunds are possible only if the payment method permits.
Refunds should be issued in the same currency used for the original payment. At present, only transactions made in BRL are eligible for refunds.
The permissible time frame for refund requests is as follows from the date of payment:
Payment method | Time limit |
---|---|
PIX | 90 days |
Creadit Card | 6 months |
BOLETO | No limit |
Request Fields:
payment_token:
(required/string): Token to identify the payment.amount:
(optional/float): Amount to be refunded. Must be equal or inferior to the customer amount. If absent, the total amount will be used.notification_url:
(optional/string): URL to post callbacks to the payment's refunds.pix_key:
(required*/string): Unique identifier linked to a bank account. Can be: Tax ID number (CPF/CNPJ), Email address, Mobile telephone number, EVP (A randomly-generated UUID number). Required only if payment's method is equal toBOLETO
.bank_code:
(required/number): The code of the institution to which the payment is directed. Required only if payment's method is equal toOXXO
,PAYNET
orSPEI
.clabe:
(required/string): CLABE customer interbank. Required only if payment's method is equal toOXXO
,PAYNET
orSPEI
.
Responde Fields:
refund_id:
The refund id.payment_token:
The refunded payment id.created_at:
Refund creation date.refund_status:
The refund status. Possible values: REQUESTED, PROCESSING, COMPLETED, FAILED.refresh_token:
Updated auth token for next calls.
AUTHORIZATION | API Key |
---|---|
Key | X-Auth-Token |
Value | MY_ACCESS_TOKEN |
Body raw (json)
{
"payment_token": "MY_PAYMENT_TOKEN",
"amount": 123.45,
"type": "CHECKING",
"bank_number": "237",
"agency_number": "12345",
"agency_check_digit": "3",
"account_number": "123456",
"account_check_digit": "4",
"bank_code": 123456,
"clabe": "646180179900004256"
}
Example Request
- 200 - Credit/Debit Card
- 200 - Boleto
- 200 - PIX
- 200 - OXXO
- 200 - Paynet
- 200 - SPEI
- 200 - PicPay
- 400 - Bad Request
- 401 - Unauthorized
- 502 - Bad Gateway
Example Request
200 - Credit/Debit Card
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"amount": 123.45
}'
Example Response
Header
Content-Type: application/json
Body
{
"refund_id": 1,
"payment_token": "42afe884-f047-4452-a3db-65a7de76a9c5",
"created_at": "2019-03-10 12:24:33.657",
"refund_status": "PROCESSING",
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
200 - Boleto
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"amount": 123.45,
"type": "CHECKING",
"bank_number": "237",
"agency_number": "12345",
"agency_check_digit": "3",
"account_number": "123456",
"account_check_digit": "4"
}'
Example Response
Header
Content-Type: application/json
Body
{
"refund_id": 1,
"payment_token": "42afe884-f047-4452-a3db-65a7de76a9c5",
"created_at": "2019-03-10 12:24:33.657",
"refund_status": "PROCESSING",
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
200 - PIX
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"amount": 123.45
}'
Example Response
Header
Content-Type: application/json
Body
{
"refund_id": 1,
"payment_token": "42afe884-f047-4452-a3db-65a7de76a9c5",
"created_at": "2019-03-10 12:24:33.657",
"refund_status": "PROCESSING",
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
200 - OXXO
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"amount": 123.45,
"bank_code": 123456,
"clabe": "646180179900004256"
}'
Example Response
Header
Content-Type: application/json
Body
{
"refund_id": 1,
"payment_token": "42afe884-f047-4452-a3db-65a7de76a9c5",
"created_at": "2019-03-10 12:24:33.657",
"refund_status": "PROCESSING",
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
200 - Paynet
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"amount": 123.45,
"bank_code": 123456,
"clabe": "646180179900004256"
}'
Example Response
Header
Content-Type: application/json
Body
{
"refund_id": 1,
"payment_token": "42afe884-f047-4452-a3db-65a7de76a9c5",
"created_at": "2019-03-10 12:24:33.657",
"refund_status": "PROCESSING",
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
200 - SPEI
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"amount": 123.45,
"bank_code": 123456,
"clabe": "646180179900004256"
}'
Example Response
Header
Content-Type: application/json
Body
{
"refund_id": 1,
"payment_token": "42afe884-f047-4452-a3db-65a7de76a9c5",
"created_at": "2019-03-10 12:24:33.657",
"refund_status": "PROCESSING",
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
200 - PicPay
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"amount": 123.45
}'
Example Response
Header
Content-Type: application/json
Body
{
"refund_id": 1,
"payment_token": "42afe884-f047-4452-a3db-65a7de76a9c5",
"created_at": "2019-03-10 12:24:33.657",
"refund_status": "PROCESSING",
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
400 - Bad Request
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN"
}'
Example Response
Header
Content-Type: application/json
Body
{
"timestamp": "2024-01-19T13:34:45.916+0000",
"status": 400,
"error": "Bad Request",
"message": "Current payment status does not allow refund",
"path": "/refund",
"errors": [
{
"code": "01.05.0030",
"description": "Current payment status does not allow refund"
}
],
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
401 - Unauthorized
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: INVALID_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN"
}'
Example Response
Header
Content-Type: application/json
Body
{
"timestamp": "2024-01-19T13:42:12.506+0000",
"status": 401,
"error": "Unauthorized",
"message": "Access Denied",
"path": "/refund"
}
Example Request
502 - Bad Gateway
curl --location 'https://api-sandbox.epag.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN"
}'
Example Response
Header
Content-Type: application/json
Body
{
"timestamp": "2024-01-16T20:12:28.156+0000",
"status": 502,
"error": "Bad Gateway",
"message": "There was an issue when contacting an external API, please contact support",
"path": "/refund",
"errors": [
{
"code": "00.03.0001",
"description": "There was an issue when contacting an external API, please contact support"
}
],
"refresh_token": "MY_ACCESS_TOKEN"
}