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 GitLabPrerequisites
- Python 3.8+
- Dependencies:
requests,python-jose,python-dotenv - A
_local.envfile with your Sandbox credentials:API_KEY- Your API client keyQI_PUBLIC_KEY- QI Tech public keyCLIENT_PRIVATE_KEY- Your EC private key (PEM)
Available Scripts
Issuance
| # | Script | Endpoint | Method | Description |
|---|---|---|---|---|
| 01 | 01_issuance_simulation.py | /v2/credit_operation/simulation | POST | Simulate a credit operation before issuance |
| 02 | 02_issuance_issuance.py | /signed_debt | POST | Issue the debt with opt-in contract signature |
| 03 | 03_issuance_query.py | /v2/credit_operation/requester_identifier_key/{key} | GET | Query the issued operation |
Reversal
| # | Script | Endpoint | Method | Description |
|---|---|---|---|---|
| 04 | 04_reversal_cancel_before_disbursement.py | /debt/{debt_key}/cancel | PATCH | Cancel an operation before disbursement |
| 05 | 05_reversal_cancel_after_disbursement.py | /debt/reversal | POST | Reverse an operation after disbursement (generates Pix refund) |
Renegotiation
| # | Script | Endpoint | Method | Description |
|---|---|---|---|---|
| 06 | 06_renegotiation_simulation.py | /renegotiation/batch_proposal_simulation | POST | Simulate a batch renegotiation |
| 07 | 07_renegotiation_proposal.py | /renegotiation/batch_proposal | POST | Create a batch renegotiation proposal |
| 08 | 08_renegotiation_query.py | /renegotiation/batch_proposal/{key} | GET | Query a batch proposal by key |
| 09 | 09_renegotiation_list.py | /renegotiation/batch_proposal | GET | List all batch proposals |
| 10 | 10_renegotiation_cancel.py | /renegotiation/batch_proposal/{key} | DELETE | Cancel a pending batch proposal |
Refinancing
| # | Script | Endpoint | Method | Description |
|---|---|---|---|---|
| 11 | 11_refinancing_present_value.py | /debt | GET | Query present value for refinancing calculation |
| 12 | 12_refinancing_simulation.py | /debt_simulation | POST | Simulate a refinancing operation |
| 13 | 13_refinancing_issuance.py | /signed_debt | POST | Create a refinancing (issues new debt, settles the previous one) |
How to Use
- Download the scripts from the repository
- Create a
_local.envfile with your Sandbox credentials - Run the scripts in numerical order
- 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.