Skip to main content

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 methodTime limit
PIX90 days
Creadit Card6 months
BOLETONo limit

Authorization

HeaderValue
X-Auth-TokenMY_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 is BOLETO.
  • bank_code (required*/number): The code of the institution to which the payment is directed. Required only when the payment method is OXXO, PAYNET, SPEI or BANK_TRANSFER.
  • clabe (required*/string): CLABE customer interbank. Required only when the payment method is OXXO, PAYNET or SPEI.
  • account_number (required*/string): The number of the destination bank account. Required only when the payment method is BANK_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 is BANK_TRANSFER.
  • tax_id (required*/string): Unique identifier of the destination account owner. Required only when the payment method is BANK_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 is BANK_TRANSFER.
  • email: (required*/string): Email address of the destination account owner. Required only when the payment method is BANK_TRANSFER and the country is Peru.
  • first_name: (required*/string): First name of the destination account owner. Required only when the payment method is BANK_TRANSFER and the country is Peru or Chile.
  • surname: (required*/string): Surname of the destination account owner. Required only when the payment method is BANK_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

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"
}