API Reference

Refunding a Received Pix

After creating a Pix Charge and the amount has been computed in your bank account(cash-in), the recipient can return perform a refund operation for the payer - integral value (full) or partial value.

📘

The refund process can only be carried out up to 90 days after the date of receipt.

Request

PUT 'https://apisandbox.delbank.com.br/baas/api/v1/transactions/{transactionId}/refund?filterBy={filterBy}'
curl --location 'https://apisandbox.delbank.com.br/baas/api/v1/transactions/{transactionId}/refund?filterBy={filterBy}' \
--header 'Content-Type: application/json' \
--header 'x-delbank-api-key: ${apiKey}' \
--data '{
    "description": "Pix recebido de forma errada",
    "amount": 1
}}'

Headers

NameDescription
x-delbank-api-keyRequired. API key

Path Parameters

NameTypeDescription
transactionIdstringRequired. Transction identifier

Query parameters

NameTypeDescription
filterByenumRequired.Enter the type of filter that should be used to search for the transaction. Domains:
- CORRELATION_ID - Field utilized by the charge (cash-in)
- END_TO_END_ID - Field utilized in the receiving Pix
- NSU - Field utilized by Delbank's internal control.

Requisition Body

NameTypeDescription
amountnumberRequired. Value to be refunded
descriptionstringTransaction description

Examples

While creating a charge, it's necessary to inform the correlationId field, this field is utilized by the client system to query charges, payments, etc. Once a charge is paid, it is possible to refund it by informing the correlationId value and it's also necessary to inform the filterBy field with the CorrelationId value in the endpoint.

Below is an example to refund a payment. The charge created has a correlationId equals to 3202309041323490Yzily

PUT 'https://apisandbox.delbank.com.br/baas/api/v1/transactions/3202309041323490YziIy/refund?filterBy=CORRELATION_ID'
{
    "description": "Pix received incorrectly",
    "amount": 1
}

🚧

Observation

It is worth remembering that the return process can use the transaction identification in three ways:

  • The correlationId is the field utilized in the creating of a charge, the cash-in process.
  • The endToEndId is the field utilized in the pix process.
  • The nsu is a delbank internal field.

All of the above information can be obtained from the bank account statement

Response

The http status code 200 indicates a successful transaction.

Been succeeded, the return will have the following fields in JSON format:

{
    "id": "73efa4c7-9540-417a-b3cb-67e6936ab965",
    "nsu": 999999134,
    "amount": 1.0,
    "notes": "Pix recebido de forma errada",
    "createdAt": "2023-08-18T02:30:56.657Z",
    "type": {
        "name": "DEBIT_PIX_REFUND",
        "description": "Refund received pix",
        "isCredit": false
    },
    "balance": {
        "balancePrevious": 69696889086637.60,
        "currentBalance": 69696889086636.60
    },
    "proof": {
        "id": "73efa4c7-9540-417a-b3cb-67e6936ab965",
        "endToEndId": "E99999003202309041323490YziIyKiU",
        "status": "PIX_EFFECTIVE",
        "type": "PIX_MANUAL",
        "amount": 6.0,
        "createdAt": "2023-08-04T10:23:48.924Z",
        "description": "Pix received incorrectly",
        "payer": {
            "number": "826953",
            "branch": "9162",
            "type": "CURRENT",
            "holder": {
                "document": "12345678901234",
                "name": "CENTRO DE SAUDE CREDILUZ LTDA",
                "type": "LEGAL"
            },
            "participant": {
                "name": "DELBANK",
                "ispb": "38224857"
            }
        },
        "beneficiary": {
            "number": "31712",
            "branch": "0001",
            "type": "CURRENT",
            "holder": {
                "document": "32752023000149",
                "name": "bxxdbde",
                "type": "LEGAL"
            },
            "participant": {
                "name": "DELBANK",
                "ispb": "38224857"
            }
        }
    }
}