Refund
POST https://api-sandbox.letpay.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 |
Authorization
Header | Value |
---|---|
X-Auth-Token | MY_ACCESS_TOKEN |
Request Description
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 when the payment method isBOLETO
.bank_code
(required*/number): The code of the institution to which the payment is directed. Required only when the payment method isOXXO
,PAYNET
,SPEI
orBANK_TRANSFER
.clabe
(required*/string): CLABE customer interbank. Required only when the payment method isOXXO
,PAYNET
orSPEI
.account_number
(required*/string): The number of the destination bank account. Required only when the payment method isBANK_TRANSFER
.account_type
(required*/enum): Type of the destination bank account. Valid options in Colombia:CC
,CA
,NC
,DE
. Valid options in Peru:CC
,CA
,CM
. Valid options in Chile:CC
,CA
,CV
. Required only when the payment method isBANK_TRANSFER
.tax_id
(required*/string): Unique identifier of the destination account owner. Required only when the payment method isBANK_TRANSFER
.tax_id_type
(required*/enum): Type of identifier used for the destination account owner. Valid options in Colombia:NIT
,CC
,CE
,TI
,PP
. Valid options in Peru:DNI
,CE
,PAS
,RUC
. Valid option in Chile:RUT
. Required only when the payment method isBANK_TRANSFER
.email
: (required*/string): Email address of the destination account owner. Required only when the payment method isBANK_TRANSFER
and the country is Peru.first_name
: (required*/string): First name of the destination account owner. Required only when the payment method isBANK_TRANSFER
and the country is Peru or Chile.surname
: (required*/string): Surname of the destination account owner. Required only when the payment method isBANK_TRANSFER
and the country is Peru or Chile.
Response Description
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.
Example Request
- Credit/Debit Card
- Boleto
- PIX
- OXXO
- Paynet
- SPEI
- PicPay
- Bank Transfer (Colombia)
- Bank Transfer (Peru)
- Bank Transfer (Chile)
- 401 - Unauthorized
- 502 - Bad Gateway
Example Request
Credit/Debit Card
curl --location 'https://api-sandbox.letpay.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
Boleto
curl --location 'https://api-sandbox.letpay.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"amount": 123.45,
"pix_key": "25899a12-349c-4d6b-8663-85fde794bdfc"
}'
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
PIX
curl --location 'https://api-sandbox.letpay.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
OXXO
curl --location 'https://api-sandbox.letpay.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
Paynet
curl --location 'https://api-sandbox.letpay.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
SPEI
curl --location 'https://api-sandbox.letpay.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
PicPay
curl --location 'https://api-sandbox.letpay.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
Bank Transfer (Colombia)
curl --location 'https://api-sandbox.letpay.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"bank_code": "1001",
"account_number": "123456",
"account_type": "CA",
"tax_id_type": "NIT",
"tax_id": "1716458334"
}'
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
Bank Transfer (Peru)
curl --location 'https://api-sandbox.letpay.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"bank_code": "002",
"account_number": "12345678909876",
"account_type": "CA",
"tax_id_type": "DNI",
"tax_id": "70274647",
"email": "[email protected]",
"first_name": "Alice",
"surname": "Sonnentag"
}'
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
Bank Transfer (Chile)
curl --location 'https://api-sandbox.letpay.io/refund' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"payment_token": "MY_PAYMENT_TOKEN",
"bank_code": "001",
"account_number": "123456",
"account_type": "CA",
"tax_id_type": "RUT",
"tax_id": "41786329",
"first_name": "Alice",
"surname": "Sonnentag"
}'
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
401 - Unauthorized
curl --location 'https://api-sandbox.letpay.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.letpay.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",
"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"
}