Skip to main content

Creating Reversal Request

Creates a reversal (refund) request for an amount received in the fund's account. The request goes through QI Tech validation before payment, and the payment is notified through the reversal webhook.

Available on
ProfileHostRequired permission
Assignorassignor-apiWrite

Base URL for each host: Environments (Hosts).

Request​

ENDPOINT
/transaction_reversal/fund_class/{fund_class_key}/transaction_reversal
METHOD
POST

Path Params​

FieldTypeDescription
fund_class_keystringUnique identifier key of the fund at QI DTVM
Request Body
{
"amount": 125.25,
"description": "Estorno - transferência indevida",
"reversal_type": "pix",
"reference_date": "2025-01-01",
"source_account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e",
"transaction_key": "4208d7d1-9077-4d00-aa4a-a4368b954867",
"origin_key": "0f8b6c2e-3d1a-4e5f-9a7b-2c4d6e8f0a1b"
}

Body Params​

FieldTypeRequiredDescription
amountnumberrequiredAmount to be reversed, in reais, with up to two decimal places. Minimum 0.01.
descriptionstringrequiredReversal description. Up to 100 characters.
reversal_typestringrequiredReversal type: pix, wire_transfer (TED) or reversal_conciliation.
reference_datestringrequiredReference date in the YYYY-MM-DD format. Cannot be earlier than the fund's current accounting date.
source_account_keystringconditionalKey (UUID) of the fund account the reversal is paid from. Send this field or source_account.
source_accountAccountconditionalData of the fund account the reversal is paid from. Alternative to source_account_key.
transaction_keystringconditionalKey (UUID) of the received transaction to be reversed. The amount is returned to the account that sent it. The transaction must be pending reconciliation.
target_accountAccountconditionalTarget account of the reversal, when transaction_key is not used.
target_pix_keystringconditionalTarget Pix key. Only accepted with reversal_type: pix.
origin_keystringoptionalYour identifier (UUID) for the request. A second request with the same origin_key is refused (TRV000033).
reference_keystringoptionalReference key of the transfer to reverse at the source bank (UUID).
conciliation_fieldstringoptionalField for reconciliation across multiple expectations.
end_to_end_idstringoptionalEnd-to-end identifier of the Pix to reverse.
external_keystringoptionalUnique key of the transaction to reverse at the source bank (UUID).
bank_slip_settlement_group_keystringoptionalUnique key of the bankslip settlement to reverse at the source bank (UUID).
Attention
  • Source: send exactly one of source_account_key and source_account.
  • Target: send exactly one of transaction_key, target_account and target_pix_key.

None or more than one returns a 400 error.

Account​

FieldTypeDescriptionCharacters
account_numberstringAccount numberUp to 20
account_digitstringAccount digit1
account_branchstringAccount branchUp to 4
financial_institutionFinancial InstitutionFinancial institution-
ownerOwnerAccount holder-

Financial institution​

FieldTypeDescriptionCharacters
ispbstringBrazilian Payment System Identifier8
codestringFinancial institution code3
namestringFinancial institution nameUp to 255

Owner​

FieldTypeDescriptionCharacters
namestringHolder's nameUp to 255
document_numberstringHolder's CPF or CNPJ, with punctuation14 or 18

Response​

STATUS
201

The response echoes the fields sent and adds the data below.

Response Body
{
"transaction_reversal_key": "b6da1a84-5bb3-4d71-9912-cbbcfe7189c1",
"amount": 125.25,
"status": "pending_validation",
"reversal_type": "pix",
"origin_type": "manual",
"reference_date": "2025-01-01",
"description": "Estorno - transferência indevida",
"source_account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e",
"source_account": {
"owner": {
"name": "Nome do Fundo",
"document_number": "11.222.333/0001-81"
},
"account_digit": "8",
"account_branch": "0001",
"account_number": "1234567",
"financial_institution": {
"ispb": "32402502",
"code": "329",
"name": "QI Sociedade de Crédito Direto"
}
},
"target_account": {
"owner": {
"name": "Nome do Remetente",
"document_number": "969.698.790-03"
},
"account_digit": "1",
"account_branch": "0001",
"account_number": "7654321",
"financial_institution": {
"ispb": "32402502",
"code": "329",
"name": "QI Sociedade de Crédito Direto"
}
},
"fund_class": {
"fund_class_key": "0619574f-2815-419d-8208-630b0dc30487",
"name": "Nome do Fundo",
"document_number": "11.222.333/0001-81",
"accounting_date": "2025-01-01",
"manager": {
"name": "EXEMPLO CAPITAL",
"manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
"document_number": "22.333.444/0001-81"
}
},
"transaction_key": "4208d7d1-9077-4d00-aa4a-a4368b954867",
"origin_key": "0f8b6c2e-3d1a-4e5f-9a7b-2c4d6e8f0a1b"
}
FieldTypeDescription
transaction_reversal_keystringIdentifier of the reversal at QI Tech (UUID).
statusstringpending_validation (awaiting QI Tech validation) or pending_expectation_confirmation (already approved, being processed). The reversal webhook is sent when the reversal is paid (paid) or when it is discarded after approval. A request rejected in the validation moves to discarded without a webhook.
source_account, target_accountobjectResolved source and target accounts.
fund_classobjectFund data.

Errors​

StatusCodeWhen it happens
409TRV000033A request with this origin_key already exists. Do not resend: the reversal has already been requested.
400TRV000020reference_date earlier than the fund's accounting date.
400TRV000019Invalid reversal_type.
400TRV000009amount with more than two decimal places.
400TRV000015 / TRV000016Source account missing, or sent in more than one way.
400TRV000017 / TRV000018Target missing, or sent in more than one way.
404TRV000013The source account was not found.
404TRV000021The transaction_key was not found in the source account.
400TRV000022The transaction is not pending reconciliation (it has already been reconciled or reversed).
400TRV000023The transaction does not have the sender's account data; send target_account.
400TRV000025target_pix_key sent with a reversal_type other than pix.
404TRV000026The target Pix key was not found.
404TRV000005The fund_class_key does not exist.
403TRV000012The fund is not associated with your assignor registration.
400QIT000001Invalid body (required field missing, wrong type or field not accepted).

Authentication, permission and host errors: see API Errors.