Skip to main content

Scenario Simulation

Step-by-step guide to simulate the completion of actions performed by external agents. These simulations include receiving and updating refund requests.

Information

There is no payload response (response body) for these requests, only a response status of 201.

1 - Simulating the Receipt of a Refund Request

Simulates the receipt of a refund request opened by another institution.

IMPORTANT

It is essential to have a valid pix_transfer_key to send the request, regardless of the information from the other party of the transfer, as all information from the second participant will be replaced in the mock process.

Request

ENDPOINT
/mock/pix/refund_request
METHOD
POST
Request Body
IMPORTANT

If the refund type is FRAUD, there must be a closed infraction report for the same pix_transfer_key.

{
"pix_transfer_key": "d5856a5f-378f-43ed-818b-df33b9fae703",
"refund_request_type": "fraud",
"refund_request_details": "Foi identificada uma fraude na transação.",
"refund_request_status": "open",
}

Object Request Body

FieldTypeDescriptionMax. Characters
pix_transfer_key *stringUnique identifier of the Pix transfer in the QI system (UUIDv4)36
refund_request_type *enumType of refund request.Enumerators refund_request_type
refund_request_status *stringInitial status of the refund request. "open"36
refund_request_detailsstringDetails of the refund request2000

Enumerators refund_request_type

FieldTypeDescription
fraudstringRefund Request originating from fraud.
operational_flawstringRefund Request originating from an internal error.

2 - Simulating the Update of a Refund Request

Simulates the status update of a refund request opened by the indirect participant.

The simulation options for updating a refund request are: 1 - Cancellation: Simulates the cancellation (cancel), made by a "target" participant, of a refund request previously opened by them.

2 - Closure: Simulates the closure (close), made by a "target" participant, of a refund request opened by the indirect participant. It is important that this report has already been acknowledged as open.

Request

ENDPOINT
/mock/pix/refund_request
METHOD
PATCH
Request Body - Cancelled
IMPORTANT

The Refund Request identified by the refund_request_key must have been previously created in the simulation of creating a refund request.

{
"refund_request_status": "cancelled",
"refund_request_key": "c3e5664f-04bb-4625-9ef3-c8555d210c71"
}
Request Body - Total Acceptance Closure
IMPORTANT

The Refund Request identified by the refund_request_key must have been previously created by the indirect participant.

IMPORTANT

The refund transfer key must have been previously created by the refund receipt mock with a value EQUAL to the original transaction.

{
"refund_request_key": "42035bdd-0551-41c5-aaae-cb27d108160a",
"refund_request_status": "closed",
"analysis_result": "totally_accepted",
"analysis_details": "Teste",
"refund_transfer_key": "6f421127-892f-415f-8efc-4e20cf5d622d"
}
Request Body - Partial Acceptance Closure
IMPORTANT

The Refund Request identified by the refund_request_key must have been previously created by the indirect participant. Additionally, the refunded amount must not be equal to or greater than the total amount of the original transaction.

IMPORTANT

The refund transfer key must have been previously created by the refund receipt mock with a value LESS than the original transaction.

{
"refund_request_key": "42035bdd-0551-41c5-aaae-cb27d108160a",
"refund_request_status": "closed",
"analysis_result": "partially_accepted",
"analysis_details": "Teste",
"refund_transfer_key": "6f421127-892f-415f-8efc-4e20cf5d622d"
}
Request Body - Rejection Closure
IMPORTANT

The Refund Request identified by the refund_request_key must have been previously created by the indirect participant.

{
"refund_request_key": "47633091-7d44-4d10-9d00-1f937104e537",
"refund_request_status": "closed",
"analysis_result": "rejected",
"analysis_details": "Teste",
"reject_reason": "no_balance"
}

Object Request Body

FieldTypeDescriptionMax. Characters
refund_request_status *stringInitial status of the refund request. "cancelled", "closed"36
refund_request_key *stringUnique key of the refund request36
analysis_result *stringResult of the refund request analysis. "totally_accepted", "partially_accepted", "rejected"36
analysis_detailsstringDetails of the refund request analysis2000
refund_transfer_keyfloatIdentifier of the refund transfer, mandatory in case of acceptance20
reject_reasonstringReason for rejecting a refund (only if analysis_result is rejected). "no_balance", "account_closure", or "other"15