Skip to main content

Integration Scripts - BNPL Full

Summary

We provide ready-to-use Python scripts that demonstrate the complete BNPL Full integration flow with the QI Tech Sandbox API. Each script corresponds to a tested and validated API call.

All payloads and responses shown in this documentation reflect the actual Sandbox API responses obtained through these scripts.

Download

The scripts are available in the project repository:

Access scripts on GitLab

Prerequisites

  • Python 3.8+
  • Dependencies: requests, python-jose, python-dotenv
  • A _local.env file with your Sandbox credentials:
    • API_KEY - Your API client key
    • QI_PUBLIC_KEY - QI Tech public key
    • CLIENT_PRIVATE_KEY - Your EC private key (PEM)

Available Scripts

Issuance

#ScriptEndpointMethodDescription
0101_issuance_simulation.py/v2/credit_operation/simulationPOSTSimulate a credit operation before issuance
0202_issuance_issuance.py/signed_debtPOSTIssue the debt with opt-in contract signature
0303_issuance_query.py/v2/credit_operation/requester_identifier_key/{key}GETQuery the issued operation

Reversal

#ScriptEndpointMethodDescription
0404_reversal_cancel_before_disbursement.py/debt/{debt_key}/cancelPATCHCancel an operation before disbursement
0505_reversal_cancel_after_disbursement.py/debt/reversalPOSTReverse an operation after disbursement (generates Pix refund)

Renegotiation

#ScriptEndpointMethodDescription
0606_renegotiation_simulation.py/renegotiation/batch_proposal_simulationPOSTSimulate a batch renegotiation
0707_renegotiation_proposal.py/renegotiation/batch_proposalPOSTCreate a batch renegotiation proposal
0808_renegotiation_query.py/renegotiation/batch_proposal/{key}GETQuery a batch proposal by key
0909_renegotiation_list.py/renegotiation/batch_proposalGETList all batch proposals
1010_renegotiation_cancel.py/renegotiation/batch_proposal/{key}DELETECancel a pending batch proposal

Refinancing

#ScriptEndpointMethodDescription
1111_refinancing_present_value.py/debtGETQuery present value for refinancing calculation
1212_refinancing_simulation.py/debt_simulationPOSTSimulate a refinancing operation
1313_refinancing_issuance.py/signed_debtPOSTCreate a refinancing (issues new debt, settles the previous one)

How to Use

  1. Download the scripts from the repository
  2. Create a _local.env file with your Sandbox credentials
  3. Run the scripts in numerical order
  4. Update keys (DEBT_KEY, BATCH_PROPOSAL_KEY, etc.) between scripts as needed
About the documentation examples

Each script includes the actual API response as a comment block at the end of the file. These examples are the source of truth for the payloads displayed on the pages of this documentation.