### List Wallet Entries API Request Example Source: https://docs.qitech.com.br/documentation/cartao_pos_pago/faturas/carteira/listar_entradas_da_carteira This example demonstrates how to make a GET request to the List Wallet Entries API endpoint. It includes path parameters for the wallet key and query parameters for filtering and pagination. ```bash GET /wallet/**WALLET_KEY**/wallet_entries?wallet_entry_type=revolving_credit&wallet_entry_status=concluded&page=1&page_size=100 ``` -------------------------------- ### List Protests GET Request Example Source: https://docs.qitech.com.br/en/documentation/boletos/instrucoes/protesto/listar_protestos Example of how to make a GET request to the List Protests endpoint. This request retrieves all protests that match the specified query parameters. ```bash curl -X GET \ 'https://api.example.com/account/YOUR_ACCOUNT_KEY/requester_profile/YOUR_REQUESTER_PROFILE_KEY/protests?protest_status=protested&from_date=2024-01-01&to_date=2024-12-31' \ -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' ``` -------------------------------- ### HTTP Request Handling (Python) Source: https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia This Python snippet shows how to make HTTP GET and POST requests using the 'requests' library. It's essential for interacting with web APIs. Install the library using `pip install requests`. The input is a URL and optional data/headers, and the output is an HTTP response object. ```python import requests import json def make_get_request(url, params=None, headers=None): try: response = requests.get(url, params=params, headers=headers) response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx) return response.json() if response.headers.get('content-type') == 'application/json' else response.text except requests.exceptions.RequestException as e: print(f"Error making GET request: {e}") return None def make_post_request(url, data=None, json_data=None, headers=None): try: response = requests.post(url, data=data, json=json_data, headers=headers) response.raise_for_status() return response.json() if response.headers.get('content-type') == 'application/json' else response.text except requests.exceptions.RequestException as e: print(f"Error making POST request: {e}") return None # Example usage: # GET Request Example api_url_get = "https://jsonplaceholder.typicode.com/posts/1" print("--- GET Request ---") get_response = make_get_request(api_url_get) if get_response: print(f"GET Response: {json.dumps(get_response, indent=2)}") # POST Request Example api_url_post = "https://jsonplaceholder.typicode.com/posts" post_payload = { 'title': 'foo', 'body': 'bar', 'userId': 1 } post_headers = {'Content-type': 'application/json; charset=UTF-8'} print("\n--- POST Request ---") post_response = make_post_request(api_url_post, json_data=post_payload, headers=post_headers) if post_response: print(f"POST Response: {json.dumps(post_response, indent=2)}") ``` -------------------------------- ### List Protests (GET Request Example) Source: https://docs.qitech.com.br/documentation/boletos/instrucoes/protesto/listar_protestos This snippet demonstrates how to make a GET request to the List Protests endpoint. It includes the base URL, path parameters (account_key, requester_profile_key), and query parameters for filtering protests. The response body shows the structure of the returned protest data and pagination information. ```http GET /account/YOUR_ACCOUNT_KEY/requester_profile/YOUR_REQUESTER_PROFILE_KEY/protests?protest_status=protested&from_date=2024-01-01&to_date=2024-12-31 HTTP/1.1 Host: api.qitech.com.br Authorization: Bearer YOUR_ACCESS_TOKEN ``` -------------------------------- ### Initialize and Configure QiTech Web OCR SDK in JavaScript Source: https://docs.qitech.com.br/documentation/caas/ocr/web/example This JavaScript snippet demonstrates the complete process of instantiating and initializing the QiTech Web OCR SDK. It includes setting up the SDK with a target HTML component, authentication token, session ID, theme configurations, screen visibility options, sandbox environment, and finally initializing the OCR process with a list of document types. Error handling for the initialization promise is also included. ```javascript ``` -------------------------------- ### Installment Details Example Source: https://docs.qitech.com.br/documentation/manual_inss/fluxo_completo_portabilidade_refin This JSON snippet shows an example of installment details within a credit operation. It includes various financial metrics for each installment, such as due dates, principal amounts, and workdays. ```json { "business_due_date": "2024-07-22", "calendar_days": 31, "due_date": "2024-07-22", "due_principal": 527.9417048484942, "installment_number": 6, "pre_fixed_amount": 6.807113809566991, "principal_amortization_amount": 103.19288619043301, "total_amount": 110.0, "workdays": 20 } ``` -------------------------------- ### List Batch Transactions (GET Request Example) Source: https://docs.qitech.com.br/documentation/baas/ted/batch/listar_transacoes_em_lote_ted_de_uma_conta Example of how to make a GET request to the /account/{ACCOUNT_KEY}/ted_batches endpoint to list batch transactions. This example demonstrates common query parameters for filtering by status and date range. ```HTTP GET /account/{{ACCOUNT_KEY}}/ted_batches?ted_batch_status=approved&date_from=2023-01-01&date_to=2023-12-31&page=1&page_size=30 HTTP/1.1 Host: api.qitech.com.br Authorization: Bearer YOUR_ACCESS_TOKEN ``` -------------------------------- ### Onboarding API Introduction Source: https://docs.qitech.com.br/documentation/caas/onboarding/introduction Introduction to the QI Tech Onboarding API, its purpose, and supported validation types (Natural Person, Legal Person). ```APIDOC ## Introduction Welcome to the QI Tech Onboarding API! This API provides access to Fraud Prevention, Anti-Money Laundering, and KYC services within your platform's registration process. This API can be used for customer registration validation for: * Opening Digital Accounts or Wallets * Card Issuance * Application User Validation * Registration for Credit Granting * Registration for Insurance Contracts * Registration Data Validation You can use our API to access endpoints for evaluating the following registration types: * **Natural Person** - used for registration validation of Individuals * **Legal Person** - used for registration validation of Legal Entities The different registration types above have specific objects and endpoints to cover the particularities of each entity. ``` -------------------------------- ### Onboarding Natural Person with Analysis (HTTP POST Request) Source: https://docs.qitech.com.br/documentation/caas/onboarding/natural_person This example demonstrates how to make an HTTP POST request to the QI Tech API to onboard a Natural Person and trigger an analysis. The 'analyze' query parameter controls whether the data is analyzed. ```http POST https://api.caas.qitech.app/onboarding/natural_person?analyze=true ``` -------------------------------- ### List Bank Slips - GET Request Example Source: https://docs.qitech.com.br/en/documentation/boletos/consulta/listar_boletos This example demonstrates how to make a GET request to list bank slips. It includes placeholder values for account and requester profile keys, and optional query parameters for filtering. ```bash curl -X GET \ 'https://api.example.com/account/YOUR_ACCOUNT_KEY/requester_profile/YOUR_REQUESTER_PROFILE_KEY/bank_slips?request_control_key=YOUR_REQUEST_CONTROL_KEY&bank_slip_status=paid&from_date=2024-01-01&to_date=2024-12-31' \ -H 'Accept: application/json' ``` -------------------------------- ### Environments (Hosts) Source: https://docs.qitech.com.br/en/documentation/iaas/introducao/inicio QI DTVM provides two environments: SANDBOX and PRODUCTION. Both environments have identical code and behavior, but the SANDBOX environment uses fictitious monetary values, while the PRODUCTION environment handles valid financial transactions. ```APIDOC ## Environments (Hosts) QI DTVM offers two distinct environments for interaction: * **Sandbox Environment:** Intended for developers to perform integrations. It uses fictitious monetary values. * **Production Environment:** Handles valid financial transactions. Developers should update environment variables with Production parameters when ready to go live. ### Host URLs by Profile and Environment | Profile | Environment | Host | |--------------|-------------|--------------------------------------------| | Gestores | Sandbox | `https://manager-api.sandbox.qidtvm.com.br/` | | Originadores | Sandbox | `https://originator-api.sandbox.qidtvm.com.br/` | | Cedentes | Sandbox | `https://assignor-api.sandbox.qidtvm.com.br/` | | Investidores | Sandbox | `https://investor-api.sandbox.qidtvm.com.br/` | | Gestores | Produção | `https://manager-api.qidtvm.com.br/` | | Cedentes | Produção | `https://assignor-api.qidtvm.com.br/` | | Originadores | Produção | `https://originator-api.qidtvm.com.br/` | | Investidores | Produção | `https://investor-api.qidtvm.com.br/` | ``` -------------------------------- ### List Wallets GET Request Example Source: https://docs.qitech.com.br/documentation/cartao_pos_pago/faturas/carteira/listar_carteiras This snippet shows an example of a GET request to list wallets. It includes query parameters for filtering by owner document number, wallet status, and pagination. The response body structure is also provided. ```http GET /wallets?owner_document_number=12345678901&wallet_status=active&page=1&page_size=100 HTTP/1.1 Host: example.com ``` -------------------------------- ### QI DTVM Environments (Hosts) Source: https://docs.qitech.com.br/documentation/iaas/introducao/inicio QI DTVM provides two environments: SANDBOX and PRODUCTION. Both environments have identical code and behavior. The SANDBOX environment uses fictitious monetary values for testing, while the PRODUCTION environment handles valid financial transactions. Developers should use the SANDBOX environment for integration and update environment variables for PRODUCTION when ready. ```APIDOC ## Environments (Hosts) QI DTVM offers two distinct environments for API interaction: SANDBOX and PRODUCTION. ### SANDBOX Environment * **Purpose:** For developers to perform integrations and testing. * **Data:** Uses entirely fictitious monetary values. * **Hosts:** * Gestores (Managers): `https://manager-api.sandbox.qidtvm.com.br/` * Originadores (Originators): `https://originator-api.sandbox.qidtvm.com.br/` * Cedentes (Assignors): `https://assignor-api.sandbox.qidtvm.com.br/` * Investidores (Investors): `https://investor-api.sandbox.qidtvm.com.br/` * Distribuidores (Distributors): `https://distributor-api.sandbox.qidtvm.com.br/` * Consultores (Consultants): `https://consultant-api.sandbox.qidtvm.com.br/` ### PRODUCTION Environment * **Purpose:** For live financial transactions. * **Data:** Uses valid financial data. * **Hosts:** * Gestores (Managers): `https://manager-api.qidtvm.com.br/` * Cedentes (Assignors): `https://assignor-api.qidtvm.com.br/` * Originadores (Originators): `https://originator-api.qidtvm.com.br/` * Investidores (Investors): `https://investor-api.qidtvm.com.br/` * Distribuidores (Distributors): `https://distributor-api.qidtvm.com.br/` * Consultores (Consultants): `https://consultant-api.qidtvm.com.br/` * Público (Public): `https://api.qidtvm.com.br/` ### Important Notice **Do not use real personal or corporate data in the QI Tech SANDBOX environments.** ``` -------------------------------- ### POST /renegotiation/proposal Source: https://docs.qitech.com.br/documentation/renegociacao/criacao_de_uma_renegociacao Creates a renegotiation proposal for a debt. Supports different amortization types like installment payment, overdue installment payment, and first installments. It also details payment types and provides example payloads. ```APIDOC ## POST /renegotiation/proposal ### Description Creates a renegotiation proposal for a debt. Supports different amortization types like installment payment, overdue installment payment, and first installments. It also details payment types and provides example payloads. ### Method POST ### Endpoint /renegotiation/proposal ### Parameters #### Request Body - **debt_key** (string) - Required - Unique key of the credit operation within QI. - **payment_type** (string) - Required - Type of payment. Enumerators: `bankslip`, `pix`, `manual`. - **amortization_type** (string) - Required - Type of amortization. Enumerators: `installment_payment`, `overdue_installment_payment`, `first_installments`. - **reference_date** (string) - Required - Reference date for which the present value of the renegotiation will be calculated (must be D+1). - **proposal_due_date** (string) - Required - Due date of the renegotiation proposal. - **discount_percentage** (float) - Optional - Discount percentage to be applied to the present value of the renegotiation. - **discount_amount** (float) - Optional - Discount amount to be applied to the present value of the renegotiation. - **request_control_key** (string) - Required - Request control key for tracking and unique identification (UUID). - **installments** (array of objects) - Required if `amortization_type` is `installment_payment` or `overdue_installment_payment`. Each object must contain: - **installment_key** (string) - Required - Key of the installment to be renegotiated (UUID). - **number_of_installments** (int) - Required if `amortization_type` is `first_installments` and `payment_amount` is not provided. Number of installments to be renegotiated. - **payment_amount** (float) - Required if `amortization_type` is `first_installments` and `number_of_installments` is not provided. The final renegotiated amount the borrower wishes to pay. **Note:** `discount_amount` and `discount_percentage` cannot be sent together in the same payload. ### Request Example (Amortization Type: installment_payment) ```json { "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8", "payment_type": "bank_slip", "amortization_type": "installment_payment", "reference_date": "2022-07-20", "proposal_due_date": "2022-07-20", "discount_percentage": 0.2, "discount_amount": 100, "request_control_key": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "installments": [ { "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88" }, { "installment_key": "0ff87136-b084-44fb-8fc2-d2e3beed483b" }, { "installment_key": "e4101c6a-51b3-435f-a2b7-4a65a005cc15" } ] } ``` ### Request Example (Amortization Type: first_installments with number_of_installments) ```json { "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8", "payment_type": "bank_slip", "amortization_type": "first_installments", "reference_date": "2022-07-20", "proposal_due_date": "2022-07-20", "discount_percentage": 0.2, "discount_amount": 100, "request_control_key": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "number_of_installments": 4 } ``` ### Request Example (Amortization Type: first_installments with payment_amount) ```json { "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8", "payment_type": "bank_slip", "amortization_type": "first_installments", "reference_date": "2022-07-20", "proposal_due_date": "2022-07-20", "discount_percentage": 0.2, "discount_amount": 100, "request_control_key": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "payment_amount": 900 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message of the renegotiation proposal creation. - **renegotiation_id** (string) - Unique identifier for the created renegotiation. #### Response Example ```json { "message": "Renegotiation proposal created successfully.", "renegotiation_id": "xyz789abc-1234-5678-def0-abcdef123456" } ``` #### Error Response (400) - **error** (string) - Description of the error. #### Error Response Example ```json { "error": "Invalid input: discount_amount and discount_percentage cannot be sent together." } ``` ``` -------------------------------- ### Example Usage of QiTechApiClient (C#) Source: https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_completo Demonstrates how to instantiate and use the QiTechApiClient to make API calls. This example shows setting up base URL, API keys, and making a POST request to a '/test' endpoint. It includes basic error handling for HTTP requests. ```csharp public class Program { public static async Task Main() { string response = ""; var baseUrl = "https://api-auth.sandbox.qitech.app"; var method = "POST"; var requestBody = new { name = "QI Tech" }; var apiKey = "SUA API KEY AQUI"; var clientPrivateKey = @"SUA PRIVATE KEY AQUI"; try { var apiClient = new QiTechApiClient(baseUrl, apiKey, clientPrivateKey); if (method.ToUpper() == "GET") { var endpoint = "/test/" + apiKey; response = await apiClient.CallEndpointAsync(endpoint, method, null); } else { var endpoint = "/test"; response = await apiClient.CallEndpointAsync(endpoint, method, requestBody); } Console.WriteLine("\nAPI Response:"); Console.WriteLine(response); } catch (HttpRequestException ex) { Console.WriteLine($"\nHTTP Error: {ex.Message}"); } catch (Exception ex) { Console.WriteLine($"\nAn unexpected error occurred: {ex.Message}"); } } } ``` -------------------------------- ### POST /social_security/reservation/external_key/{CREDIT-OPERATION-KEY}/portability_origin_contract Source: https://docs.qitech.com.br/en/documentation/manual_inss/fluxo_completo_portabilidade_refin Allows querying the origin portability data, including benefit number, portability start date, excluded contracts, un-averbated installment values, last paid installment, and exclusion date. ```APIDOC ## POST /social_security/reservation/external_key/{CREDIT-OPERATION-KEY}/portability_origin_contract ### Description Allows querying the origin portability data, including benefit number, portability start date, excluded contracts, un-averbated installment values, last paid installment, and exclusion date. ### Method POST ### Endpoint `/social_security/reservation/external_key/CREDIT-OPERATION-KEY/portability_origin_contract` ### Parameters #### Path Parameters - **CREDIT-OPERATION-KEY** (string) - Required - The key of the credit operation. #### Request Body - **request_type** (string) - Required - The type of request, e.g., `portability_number`. - **portability_number** (string) - Required - The portability number to query. ### Request Example ```json { "request_type": "portability_number", "portability_number": "202402070000298096242" } ``` ### Response #### Success Response (200) - **origin_contract_request_key** (string) - The key for the origin contract request. - **status** (string) - The status of the request, e.g., `pending_search`. - **status_events** (array) - A list of status events for the request. #### Response Example ```json { "origin_contract_request_key": "9bb68c89-4b88-400d-9359-99ad8d42a69e", "status": "pending_search", "status_events": [ { "status": "pending_search" } ] } ``` ### Webhook Notification (Success) - **WEBHOOK_TYPE**: `social_security_portability_origin_contract_request` - **STATUS**: `Success` #### Webhook Body Example (Success) ```json { "webhook": { "key": "25e93655-4713-488b-8800-7ac4fddf745f", "data": { "portability_number": 9223372036854776000, "portability_status": "open", "benefit_number": 1544326820, "portability_start_date": "2024-02-22", "deleted_contracts": [ { "origin_bank": { "bank_code": 752, "name": "CETELEM-BNP" }, "contract_number": "22-844817807/20", "last_installment_paid": 84, "exclusion_date": "22022024", "period_amount": 165.73 } ] }, "status": "success", "webhook_type": "social_security_portability_origin_contract_request", "event_datetime": "2024-02-26T21:36:22" } } ``` ### Webhook Notification (Failure) - **WEBHOOK_TYPE**: `social_security_portability_origin_contract_request` - **STATUS**: `Failure` #### Webhook Body Example (Failure) ```json { "webhook": { "key": "522b5d7d-2dfc-4e92-99b7-d4df3d97edb2", "data": { "enumerator": "invalid_bank_code", "description": "Invalid bank code" }, "status": "failure", "webhook_type": "social_security_portability_origin_contract_request", "event_datetime": "2024-02-26T21:36:22" } } ``` ``` -------------------------------- ### Error Structure Example (JSON) Source: https://docs.qitech.com.br/documentation/caas/face_recognition/android/collecting_response This snippet shows the JSON structure for errors returned by the QI Tech SDK starting from version 5.0.0. It includes examples for 'InvalidToken' and 'UserCanceled' errors, detailing the status_code, reason, and description for each. ```json { status_code = 401 reason = "INVALID_TOKEN" description = "Authentication token expired or invalid" } { status_code = 0 reason = "USER_CANCELED" description = "User pressed the back button." } ``` -------------------------------- ### Retrieve Onboarding PDF Source: https://docs.qitech.com.br/documentation/caas/onboarding/query_registration Retrieve the PDF document for a given onboarding record. Optionally, the PDF can be returned in base64 format by appending `&base64=true` to the query string. Note that PDF generation is asynchronous; retrying after a few seconds is recommended if a 404 error occurs. ```APIDOC ## GET /onboarding/natural_person/{id}/pdf ### Description Retrieve the PDF document for a specific natural person onboarding record. ### Method GET ### Endpoint `/onboarding/natural_person/{id}/pdf` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the natural person record. #### Query Parameters - **base64** (boolean) - Optional - If true, returns the PDF content in base64 format. ### Request Example ```bash curl "https://api.caas.qitech.app/onboarding/natural_person/12345678/pdf" \ -H "Authorization: EXAMPLE-OF-API-KEY" ``` ### Response #### Success Response (200) - **[PDF File]** - The generated PDF file for the natural person record. - **[String]** - The base64 encoded PDF content if `base64=true` is used. #### Response Example ```json { "example": "PDF content or base64 encoded string" } ``` ## GET /onboarding/legal_person/{id}/pdf ### Description Retrieve the PDF document for a specific legal person onboarding record. ### Method GET ### Endpoint `/onboarding/legal_person/{id}/pdf` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the legal person record. #### Query Parameters - **base64** (boolean) - Optional - If true, returns the PDF content in base64 format. ### Request Example ```bash curl "https://api.caas.qitech.app/onboarding/legal_person/12345678/pdf" \ -H "Authorization: EXAMPLE-OF-API-KEY" ``` ### Response #### Success Response (200) - **[PDF File]** - The generated PDF file for the legal person record. - **[String]** - The base64 encoded PDF content if `base64=true` is used. #### Response Example ```json { "example": "PDF content or base64 encoded string" } ``` ``` -------------------------------- ### Consultar Payment Order - Request Example Source: https://docs.qitech.com.br/documentation/baas/pix_automatico/pagamentos/consultar_payment_order Exemplo de como consultar os detalhes de uma payment order específica usando o método GET. O endpoint requer chaves de conta, recorrência e ordem de pagamento no path. ```bash curl -X GET \ 'https://api.qitech.com.br/account/ACCOUNT_KEY/outgoing_recurrence/OUTGOING_RECURRENCE_KEY/payment_order/PAYMENT_ORDER_KEY' \ -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' ``` -------------------------------- ### Disbursement Webhook Source: https://docs.qitech.com.br/en/documentation/manual_bnpl_ecommerce This webhook indicates the success or failure of the disbursement process for a debt issuance. It includes details about the installments. ```APIDOC ## Disbursement Webhook ### Description This webhook is triggered to notify about the disbursement status of a debt issuance. It can indicate success or failure and provides details about the installments if successful. ### Method POST (or other method as defined by your webhook receiver) ### Endpoint [Your Webhook Endpoint URL] ### Request Body - **webhook** (object) - The main webhook object. - **key** (string) - Unique identifier for the webhook event. - **data** (object) - Contains disbursement-specific data. - **installments** (array) - List of installment details. - **due_date** (string) - The due date for the installment (YYYY-MM-DD). - **total_amount** (number) - The total amount for the installment. - **installment_key** (string) - Unique identifier for the installment. - **pre_fixed_amount** (number) - The pre-fixed amount of the installment. - **installment_number** (integer) - The sequence number of the installment. - **principal_amortization_amount** (number) - The principal amortization amount for the installment. - **ted_receipt_list** (array) - List of TED receipts (if applicable). - **requester_identifier_key** (string|null) - Identifier key of the requester. - **status** (string) - The status of the disbursement, e.g., "disbursed", "failed", "returned". - **webhook_type** (string) - Type of webhook, expected to be "debt". - **event_datetime** (string) - Timestamp of the event (YYYY-MM-DD HH:MM:SS). ### Response Example (Success) ```json { "webhook": { "key": "1ebd4a90-2721-4c39-a399-427fa16bca65", "data": { "installments": [ { "due_date": "2025-11-27", "total_amount": 87.43, "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9", "pre_fixed_amount": 29.26477451, "installment_number": 1, "principal_amortization_amount": 58.16522549 }, { "due_date": "2025-12-27", "total_amount": 87.43, "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f", "pre_fixed_amount": 20.11446867, "installment_number": 2, "principal_amortization_amount": 67.31553133 }, { "due_date": "2026-01-27", "total_amount": 87.43, "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8", "pre_fixed_amount": 11.07075682, "installment_number": 3, "principal_amortization_amount": 76.35924318 } ], "ted_receipt_list": [], "requester_identifier_key": null }, "status": "disbursed", "webhook_type": "debt", "event_datetime": "2025-10-27 17:10:21" } } ``` ### Response Example (Failure/Cancellation) ```json { "webhook": { "key": "another-webhook-key", "data": {}, "status": "cancelled", "webhook_type": "debt", "event_datetime": "2025-10-27 17:15:00" } } ``` ``` -------------------------------- ### GET /v2/credit_operation/{CREDIT-OPERATION-KEY} Source: https://docs.qitech.com.br/documentation/emissao_de_divida/consulta_por_credit_operation_key Consulta detalhes de dívida utilizando a chave única da operação de crédito. ```APIDOC ## GET /v2/credit_operation/{CREDIT-OPERATION-KEY} ### Description Consulta detalhes de dívida utilizando a chave única da operação de crédito. ### Method GET ### Endpoint /v2/credit_operation/{CREDIT-OPERATION-KEY} ### Parameters #### Path Parameters - **credit_operation_key** (string) - Required - Chave da operação de crédito. Formato UUID. ``` -------------------------------- ### File Handling - Reading and Writing (Python) Source: https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia This Python snippet demonstrates basic file operations: reading from a file and writing to a file. It uses the built-in file handling capabilities of Python. Ensure the file paths are correct and you have the necessary permissions. The input is a file path and content, and the output is the file content or confirmation of write. ```python import os def read_file(filepath): try: with open(filepath, 'r', encoding='utf-8') as f: content = f.read() return content except FileNotFoundError: print(f"Error: File not found at {filepath}") return None except Exception as e: print(f"Error reading file {filepath}: {e}") return None def write_file(filepath, content, mode='w'): try: # Ensure directory exists os.makedirs(os.path.dirname(filepath), exist_ok=True) with open(filepath, mode, encoding='utf-8') as f: f.write(content) print(f"Successfully wrote to {filepath}") return True except Exception as e: print(f"Error writing to file {filepath}: {e}") return False # Example usage: # Define file paths read_filepath = 'sample_read.txt' write_filepath = 'output/sample_write.txt' append_filepath = 'output/sample_append.txt' # Create a dummy file for reading dummy_content = "This is the content of the sample file.\nIt has multiple lines." write_file(read_filepath, dummy_content) # Read from the file print(f"--- Reading from {read_filepath} ---") file_content = read_file(read_filepath) if file_content is not None: print(file_content) # Write to a new file print(f"\n--- Writing to {write_filepath} ---") new_content = "This is new content written to a file." write_file(write_filepath, new_content) # Append to an existing file print(f"\n--- Appending to {append_filepath} ---") append_content = "\nThis line is appended." # First, create the file if it doesn't exist for appending demonstration write_file(append_filepath, "Initial content for append.\n") write_file(append_filepath, append_content, mode='a') # Clean up dummy files (optional) # import os # os.remove(read_filepath) # os.remove(write_filepath) # os.remove(append_filepath) # os.rmdir('output') # This will fail if 'output' is not empty ``` -------------------------------- ### Disbursement Webhook Source: https://docs.qitech.com.br/documentation/manual_bnpl_ecommerce This webhook is triggered upon the success or failure of a disbursement, providing installment and disbursement details. ```APIDOC ## Disbursement Webhook ### Description This webhook is triggered upon the success or failure of a disbursement, providing installment and disbursement details. ### Method POST ### Endpoint `/webhooks/disbursement` (Example Endpoint) ### Parameters #### Query Parameters None #### Request Body - **webhook** (object) - Required - Contains webhook details. - **key** (string) - Required - Unique identifier for the webhook event. - **data** (object) - Required - Contains disbursement-specific data. - **installments** (array) - Required - List of installment details. - **due_date** (string) - Required - The due date for the installment. - **total_amount** (number) - Required - The total amount of the installment. - **installment_key** (string) - Required - Unique identifier for the installment. - **pre_fixed_amount** (number) - Required - The pre-fixed amount of the installment. - **installment_number** (integer) - Required - The number of the installment. - **principal_amortization_amount** (number) - Required - The principal amortization amount for the installment. - **ted_receipt_list** (array) - Optional - List of TED receipt details. - **requester_identifier_key** (string) - Optional - Identifier for the requester. - **status** (string) - Required - The status of the disbursement (e.g., `disbursed`, `failed`, `returned`). - **webhook_type** (string) - Required - Type of webhook (e.g., `debt`). - **event_datetime** (string) - Required - Timestamp of the event. ### Request Example ```json { "webhook": { "key": "1ebd4a90-2721-4c39-a399-427fa16bca65", "data": { "installments": [ { "due_date": "2025-11-27", "total_amount": 87.43, "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9", "pre_fixed_amount": 29.26477451, "installment_number": 1, "principal_amortization_amount": 58.16522549 }, { "due_date": "2025-12-27", "total_amount": 87.43, "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f", "pre_fixed_amount": 20.11446867, "installment_number": 2, "principal_amortization_amount": 67.31553133 }, { "due_date": "2026-01-27", "total_amount": 87.43, "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8", "pre_fixed_amount": 11.07075682, "installment_number": 3, "principal_amortization_amount": 76.35924318 } ], "ted_receipt_list": [], "requester_identifier_key": null }, "status": "disbursed", "webhook_type": "debt", "event_datetime": "2025-10-27 17:10:21" } } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Webhook received successfully." } ``` ``` -------------------------------- ### Configuration Loading in Go Source: https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia This Go snippet illustrates a function to load configuration from a file. It likely parses a configuration file format (e.g., JSON, YAML) into a struct. Error handling for file not found or parsing errors is crucial. It might depend on standard library packages like `os` and `encoding/json`. ```go package config import ( "encoding/json" "io/ioutil" "os" ) type AppConfig struct { DatabaseURL string `json:"database_url"` APIKey string `json:"api_key"` } func LoadConfig(filePath string) (*AppConfig, error) { file, err := os.Open(filePath) if err != nil { return nil, err } defer file.Close() bytes, err := ioutil.ReadAll(file) if err != nil { return nil, err } var cfg AppConfig err = json.Unmarshal(bytes, &cfg) if err != nil { return nil, err } return &cfg, nil } // Example usage: // cfg, err := config.LoadConfig("./config.json") // if err != nil { // log.Fatalf("Failed to load config: %v", err) // } // fmt.Printf("Database URL: %s\n", cfg.DatabaseURL) ``` -------------------------------- ### List TED Transactions (GET Request) Source: https://docs.qitech.com.br/documentation/baas/ted/batch/listar_transacoes_de_um_lote_de_transacoes_ted This snippet demonstrates how to make a GET request to the endpoint to list TED transactions. It includes example path and query parameters. The response body contains a list of transactions and pagination information. ```http GET /account/**ACCOUNT_KEY**/ted_batch/**TED_BATCH_KEY**/teds?ted_status=sent&date_from=2023-01-01&date_to=2023-12-31&page=1&page_size=30 HTTP/1.1 Host: api.example.com Authorization: Bearer YOUR_ACCESS_TOKEN ``` -------------------------------- ### List Wallets (GET Request) Source: https://docs.qitech.com.br/en/documentation/cartao_pos_pago/faturas/carteira/listar_carteiras This snippet demonstrates how to make a GET request to the /wallets endpoint to retrieve a list of wallets. It includes example query parameters for filtering and pagination. The response is a JSON object containing wallet data and pagination details. ```http GET /wallets?owner_document_number=12345678901&wallet_status=active&page=1&page_size=100 HTTP/1.1 Host: api.example.com Accept: application/json ``` -------------------------------- ### Response Example for Listing Assignment Configurations Source: https://docs.qitech.com.br/documentation/iaas/negociacao_recebiveis/listagem Exemplo de resposta JSON para a listagem de configurações de cessão. A resposta contém uma lista de objetos, cada um representando uma configuração com detalhes como nome, tipo de registro, tipo de ativo e informações do fundo. ```JSON { "data": [ { "assignment_configuration_key": "UUID", "assignment_configuration_name": "NOME DA CONFIGURAÇÃO", "assignment_contract_key": "UUID", "registry_type": "internal_registry | external_registry", "asset_type": "duplicata_mercantil | duplicata_servico | ccb", "fund_class": { "fund_class_key": "UUID", "name": "SAMPLE FUND NAME", "document_number": "00.000.000/0000-00", "accounting_date": "YYYY-MM-DD", "manager": { "manager_key": "UUID", "document_number": "00.000.000/0000-00", "manager_name": "SAMPLE MANAGER NAME" } }, "assignor": { "assignor_key": "UUID", "document_number": "00.000.000/0000-00", "name": "SAMPLE ASSIGNOR NAME" }, "consultant_decision_type": "automatic_approval | manual_approval", "consultant": { "consultant_key": "UUID", "document_number": "00.000.000/0000-00", "name": "SAMPLE CONSULTANT NAME" } } ], "limit": 10, "page": 0, "is_last_page": true } ``` -------------------------------- ### Disbursement Webhook Response Body Source: https://docs.qitech.com.br/documentation/manual_bnpl_ecommerce This JSON object represents the response body for a disbursement webhook. It confirms the successful disbursement of debt installments and includes details about each installment, such as due date, total amount, and principal amortization. The webhook type is 'debt'. ```json { "webhook": { "key": "1ebd4a90-2721-4c39-a399-427fa16bca65", "data": { "installments": [ { "due_date": "2025-11-27", "total_amount": 87.43, "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9", "pre_fixed_amount": 29.26477451, "installment_number": 1, "principal_amortization_amount": 58.16522549 }, { "due_date": "2025-12-27", "total_amount": 87.43, "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f", "pre_fixed_amount": 20.11446867, "installment_number": 2, "principal_amortization_amount": 67.31553133 }, { "due_date": "2026-01-27", "total_amount": 87.43, "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8", "pre_fixed_amount": 11.07075682, "installment_number": 3, "principal_amortization_amount": 76.35924318 } ], "ted_receipt_list": [], "requester_identifier_key": null }, "status": "disbursed", "webhook_type": "debt", "event_datetime": "2025-10-27 17:10:21" } } ```