### Complete HMAC Implementation Examples Source: https://cartwave-prod.readme.io/reference/hmac-documentation-1 Full script examples demonstrating the end-to-end process of parsing JSON, generating an HMAC signature, and setting environment variables. ```JavaScript (Postman) function generateHMAC(jsonData, secretKey) { const crypto = require('crypto-js'); const hmacSHA512 = crypto.HmacSHA512(jsonData, secretKey); return hmacSHA512.toString(crypto.enc.Hex); } let payload = pm.request.body.raw; let jsonObj = JSON.parse(payload); payload = JSON.stringify(jsonObj); payload = payload.replace(/:\s/g, ':').replace(/,\s/g, ','); const secretKey = "edcb3xxxxf248b744653f052b22cexxxx8d87ad2b2777xxxx35f33d27be6xxxx"; const hmac = generateHMAC(payload, secretKey); pm.collectionVariables.set('generated_hmac', hmac); console.log('Generated HMAC:', hmac); ``` ```Python import hmac import hashlib import json def generate_hmac(json_data, secret_key): hmac_obj = hmac.new(secret_key.encode(), json_data.encode(), hashlib.sha512) return hmac_obj.hexdigest() payload = '{"key1": "value1", "key2": "value2"}' json_obj = json.loads(payload) payload = json.dumps(json_obj, separators=(',', ':')) secret_key = "edcb3xxxxf248b744653f052b22cexxxx8d87ad2b2777xxxx35f33d27be6xxxx" hmac_result = generate_hmac(payload, secret_key) print('Generated HMAC:', hmac_result) ``` -------------------------------- ### List PIX Keys API Request Example Source: https://cartwave-prod.readme.io/reference/lists-pix-keys-for-bank-account This example demonstrates how to make an API request to list PIX keys for a bank account. It includes the necessary query parameters for account and branch identification, and the Authorization header for authentication. The response format is also shown. ```json { "worked": true, "keys": [ { "key": "dccd9074-XXXX-XXXXX-232851c81804", "name_account": "GK XXXXXXE LTDA", "document_account": "51***4290001**" }, { "key": "989549be-1487-XXXX-XXXXX--c821f2db000f", "name_account": "GK XXXXXX LTDA", "document_account": "51***4290001**" } ] } ``` -------------------------------- ### Retrieve Account Statements via HTTP Source: https://cartwave-prod.readme.io/reference/list-account-statement Examples of how to construct GET requests for account statements, including basic filtering and pagination parameters. These requests require a valid Bearer token in the Authorization header. ```HTTP GET /v3/account-statements/1234/567890?start=2023-10-01T00:00:00&end=2023-10-31T23:59:59 ``` ```HTTP GET /v3/account-statements/1234/567890?start=2023-10-01T00:00:00&end=2023-10-31T23:59:59&limit=25&cursor_direction=next ``` -------------------------------- ### Approve PIX Cashout Manual - POST Request Example (JSON) Source: https://cartwave-prod.readme.io/reference/approve-pix-cashout-pix-manual This snippet shows an example JSON payload for the POST request to approve a PIX cashout manually. It includes details about the transaction, recipient, and amount. This endpoint is part of the Bankry API for financial transactions. ```json { "openapi": "3.1.0", "info": { "title": "Bankry API Documentation", "version": "1.0" }, "servers": [ { "url": "https://api.cartwavehub.com.br/v2/finance/" } ], "security": [ {} ], "paths": { "/approve-cashout-manual/": { "post": { "summary": "Approve PIX Cashout Pix Manual", "description": "Approve Transfer funds from the business bank account to other accounts using PIX technology", "operationId": "approve-pix-cashout-pix-manual", "responses": { "200": { "description": "200", "content": { "application/json": { "examples": { "Result": { "value": "{\n \"worked\": true,\n \"id\": 66300134,\n \"transaction_id\": 66300134,\n \"code_transaction\": \"E35535240202******BROEA793YQI\",\n \"status\": \"SUCCESS\",\n \"amount\": 0.01,\n \"fee\": 0.0,\n \"key\": \"14******47\",\n \"tag\": null,\n \"from_accout\": \"900002\",\n \"recipient_instution\": \"0000001\",\n \"recipient_account_id\": \"000001\",\n \"recipient_branch_id\": \"20\",\n \"recipient_legal_id\": \"14******47\",\n \"recipient_name\": \"Fulano de tal\",\n \"recipient_account_type\": \"CURRENT_ACCOUNT\",\n \"operationUuid\": \"E35535240202******BROEA793YQI\",\n \"erro_descriptor\": \"\",\n \"new_erro_descriptor\": \"\"\n}" } }, "schema": { "type": "object", "properties": { "worked": { "type": "boolean", "example": true, "default": true }, "id": { "type": "integer", "example": 66300134, "default": 0 }, "transaction_id": { "type": "integer", "example": 66300134, "default": 0 }, "code_transaction": { "type": "string", "example": "E35535240202******BROEA793YQI" }, "status": { "type": "string", "example": "SUCCESS" }, "amount": { "type": "number", "example": 0.01, "default": 0 }, "fee": { "type": "integer", "example": 0, "default": 0 }, "key": { "type": "string", "example": "14******47" }, "tag": {}, "from_accout": { "type": "string", "example": "900002" }, "recipient_instution": { "type": "string", "example": "0000001" }, "recipient_account_id": { "type": "string", "example": "000001" }, "recipient_branch_id": { "type": "string", "example": "20" }, "recipient_legal_id": { "type": "string", "example": "14******47" }, "recipient_name": { "type": "string", "example": "Fulano de tal" }, "recipient_account_type": { "type": "string", "example": "CURRENT_ACCOUNT" }, "operationUuid": { "type": "string", "example": "E35535240202******BROEA793YQI" }, "erro_descriptor": { "type": "string", "example": "" }, "new_erro_descriptor": { "type": "string", "example": "" } } } } } }, "400": { "description": "400", "content": { "application/json": { "examples": { "Result": { "value": "{\n \"detail\": \"Transaction not found\",\n \"worked\": false\n}" } }, "schema": { "oneOf": [ { "type": "object", } ] } } } } } } } } } ``` -------------------------------- ### Check Account Balance Request Example Source: https://cartwave-prod.readme.io/reference/check-account-balance This snippet demonstrates how to make a request to the Cartwave API to check an account balance. It includes the necessary query parameters for the account branch and number, and the Authorization header with a Bearer token. The example shows a typical structure for such an API call. ```http GET "https://api.cartwave.com/v1/accounts/balance?account_branch_identifier=0001&account_number=401050" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### GET /websites/{website_id}/orders Source: https://cartwave-prod.readme.io/reference/list-meds-endpoint Retrieves a list of orders for a specific website. Supports filtering and pagination. ```APIDOC ## GET /websites/{website_id}/orders ### Description Retrieves a list of orders associated with a specific website. This endpoint allows for filtering orders based on various criteria and supports pagination for handling large datasets. ### Method GET ### Endpoint `/websites/{website_id}/orders` ### Parameters #### Path Parameters - **website_id** (string) - Required - The unique identifier for the website. #### Query Parameters - **status** (string) - Optional - Filters orders by their status (e.g., 'paid', 'pending', 'shipped'). - **limit** (integer) - Optional - The maximum number of orders to return per page. - **offset** (integer) - Optional - The number of orders to skip before starting to collect the result set. ### Request Example ```bash GET /websites/cartwave-prod/orders?status=paid&limit=10&offset=0 ``` ### Response #### Success Response (200) - **orders** (array) - A list of order objects. - **order_id** (string) - The unique identifier for the order. - **customer_id** (string) - The identifier for the customer who placed the order. - **order_date** (string) - The date and time the order was placed. - **total_amount** (number) - The total amount of the order. - **status** (string) - The current status of the order. #### Response Example ```json { "orders": [ { "order_id": "ORD12345", "customer_id": "CUST67890", "order_date": "2024-01-15T10:00:00Z", "total_amount": 50.75, "status": "paid" } ] } ``` #### Error Response (400) - **error** (object) - Contains details about the error. - **code** (string) - The error code. - **message** (string) - A human-readable error message. #### Response Example ```json { "error": { "code": "INVALID_PARAMETER", "message": "Invalid status parameter provided." } } ``` ``` -------------------------------- ### Pagination Flow Example Source: https://cartwave-prod.readme.io/reference/list-account-statement Demonstrates the step-by-step process of fetching the first page of results and subsequently using the cursor parameters to navigate to the next page. ```HTTP # Step 1: First request GET /v3/account-statements/1234/567890?start=2023-10-01T00:00:00&end=2023-10-31T23:59:59&limit=10 # Step 2: Use the "next" URL from response GET /v3/account-statements/1234/567890?start=2023-10-01T00:00:00&end=2023-10-31T23:59:59&limit=10&cursor_id=12345&cursor_datetime=2023-10-15T14:30:00&cursor_direction=next ``` -------------------------------- ### POST /create-pix-copy-and-paste/ Source: https://cartwave-prod.readme.io/reference/generate-a-pix-cash-in-with-all-recommended-fields-copy Generates a PIX Cash In transaction with simplified fields, providing a copy-and-paste string for payment. ```APIDOC ## POST /create-pix-copy-and-paste/ ### Description Generates a PIX Cash In with reduced/simplified fields. This endpoint is useful for creating payment requests that can be easily copied and pasted by the user. ### Method POST ### Endpoint https://api.cartwavehub.com.br/v2/finance/create-pix-copy-and-paste/ ### Parameters #### Request Body (No specific request body parameters are detailed in the provided OpenAPI definition, but typically this would include transaction details like amount, due date, etc.) ### Request Example ```json { "amount": 0.01, "debtor_name": "Fulano de tal", "debtor_document": "15888877743", "expiration_date": "2024-01-01T12:00:00.000Z" } ``` ### Response #### Success Response (200) - **worked** (boolean) - Indicates if the operation was successful. - **pix_copy_and_paste** (string) - The generated PIX copy-and-paste string. - **qr_code_id** (integer) - The unique identifier for the generated QR code. - **debtor_name** (string) - The name of the debtor. - **debtor_document** (string) - The document number (e.g., CPF) of the debtor. - **type_document** (string) - The type of document provided (e.g., "CPF"). - **debtor_institution** (any) - Information about the debtor's institution (can be null). - **debtor_institution_number** (any) - The number of the debtor's institution (can be null). - **expiration_date** (string) - The expiration date for the PIX transaction. - **due_date** (any) - The due date for the payment (can be null). - **amount_chargeback** (integer) - The amount related to chargebacks. - **amount** (number) - The transaction amount. - **fee** (integer) - Any associated fees. - **type_fine** (string) - The type of fine applied (e.g., "NONE"). - **fine** (any) - Details about the fine (can be null). - **fine_date** (any) - The date the fine was applied (can be null). - **status** (string) - The current status of the transaction (e.g., "NEW"). - **base_64_image** (any) - Base64 encoded image of the QR code (can be null). - **base_64_image_url** (string) - URL to the QR code image. - **account_number** (string) - The account number associated with the transaction. - **agency_number** (string) - The agency number associated with the transaction. - **endToEndId** (string) - The end-to-end transaction ID. - **payment_date** (any) - The date the payment was made (can be null). - **tax** (any) - Tax information (can be null). - **tx_id** (string) - The transaction ID. - **tag** (string) - A tag or description for the transaction. #### Response Example ```json { "worked": true, "pix_copy_and_paste": "00020101021226880014br.gov.bcb.pix2566qrcodes.saq.digital/v2/qr/cob/************************************SAQ INSTITUICAO DE PAGAME6009SAO PAULO62070503***6304E39B", "qr_code_id": 1, "debtor_name": "Fulano de tal", "debtor_document": "15888877743", "type_document": "CPF", "debtor_institution": null, "debtor_institution_number": null, "expiration_date": "2024-01-01T12:00:00.000Z", "due_date": null, "amount_chargeback": 0.0, "amount": 0.01, "fee": 0.0, "type_fine": "NONE", "fine": null, "fine_date": null, "status": "NEW", "base_64_image": null, "base_64_image_url": "https://api.saq.digital/v2/finance/image/qrcode/***c.png", "account_number": "0001", "agency_number": "0001", "endToEndId": "", "payment_date": null, "tax": null, "tx_id": "23920262************f770c", "tag": "description" } ``` ``` -------------------------------- ### GET /status-pix-copy-and-paste/ Source: https://cartwave-prod.readme.io/reference/check-status-and-details-of-a-generated-pix-cash-in-by-id Retrieves the current status and detailed information of a specific PIX transaction by its ID. ```APIDOC ## GET /status-pix-copy-and-paste/?id= ### Description Check the status and retrieve full details of a generated PIX Cash In transaction using the transaction ID. ### Method GET ### Endpoint https://api.cartwavehub.com.br/v2/finance/status-pix-copy-and-paste/?id={id} ### Parameters #### Query Parameters - **id** (integer) - Required - The unique identifier of the PIX transaction. ### Response #### Success Response (200) - **worked** (boolean) - Indicates if the request was successful. - **pix_copy_and_paste** (string) - The PIX code string for payment. - **qr_code_id** (integer) - The internal ID of the QR code. - **debtor_name** (string) - Name of the person making the payment. - **status** (string) - Current status of the transaction (e.g., PAID). - **amount** (number) - The transaction amount. - **endToEndId** (string) - The unique PIX end-to-end identifier. #### Response Example { "worked": true, "pix_copy_and_paste": "00020101021226880014br.gov.bcb.pix...", "qr_code_id": 1, "debtor_name": "Fulano de tal", "status": "PAID", "amount": 0.01, "endToEndId": "E303062942025090000000000003AAFM" } ``` -------------------------------- ### POST /create-cashout-manual/ Source: https://cartwave-prod.readme.io/reference/pix-cashout-using-pix-manual-create-payment-for-approval Initiates a PIX cashout transaction, transferring funds from a business bank account to another account using PIX technology. This endpoint is used for manual PIX payments that require approval. ```APIDOC ## POST /create-cashout-manual/ ### Description Transfer funds from the business bank account to other accounts using PIX technology. This endpoint is for creating PIX cashout transactions that require manual approval. ### Method POST ### Endpoint https://api.cartwavehub.com.br/v2/finance//create-cashout-manual/ ### Parameters #### Request Body (The request body schema is not fully defined in the provided OpenAPI spec, but typically includes details like amount, recipient key, etc.) ### Request Example ```json { "amount": 0.01, "key": "14******47", "recipient_name": "Fulano de tal", "recipient_account_type": "CURRENT_ACCOUNT" } ``` ### Response #### Success Response (200) - **worked** (boolean) - Indicates if the operation was successful. - **id** (integer) - The unique identifier for the transaction. - **transaction_id** (integer) - The transaction identifier. - **code_transaction** (string) - A code representing the transaction. - **status** (string) - The status of the transaction (e.g., "SUCCESS"). - **amount** (number) - The transaction amount. - **fee** (integer) - The transaction fee. - **key** (string) - The PIX key used for the transaction. - **tag** (any) - Additional tag information (can be null). - **from_accout** (string) - The source account identifier. - **recipient_instution** (string) - The recipient's institution identifier. - **recipient_account_id** (string) - The recipient's account identifier. - **recipient_branch_id** (string) - The recipient's branch identifier. - **recipient_legal_id** (string) - The recipient's legal identifier. - **recipient_name** (string) - The name of the recipient. - **recipient_account_type** (string) - The type of the recipient's account. - **operationUuid** (string) - The UUID of the operation. - **erro_descriptor** (string) - Descriptor for any errors. - **new_erro_descriptor** (string) - New descriptor for any errors. #### Response Example ```json { "worked": true, "id": 66300134, "transaction_id": 66300134, "code_transaction": "E35535240202******BROEA793YQI", "status": "SUCCESS", "amount": 0.01, "fee": 0.0, "key": "14******47", "tag": null, "from_accout": "900002", "recipient_instution": "0000001", "recipient_account_id": "000001", "recipient_branch_id": "20", "recipient_legal_id": "14******47", "recipient_name": "Fulano de tal", "recipient_account_type": "CURRENT_ACCOUNT", "operationUuid": "E35535240202******BROEA793YQI", "erro_descriptor": "", "new_erro_descriptor": "" } ``` #### Error Response (400) - **message** (string) - A message describing the error. - **worked** (boolean) - Indicates if the operation failed. #### Error Response Example ```json { "message": "Account not found", "worked": false } ``` ``` -------------------------------- ### Generate PIX Copy and Paste Code (OpenAPI) Source: https://cartwave-prod.readme.io/reference/generate-a-pix-cash-in-same-document-receipt This snippet defines the OpenAPI 3.1.0 specification for the '/create-pix-copy-and-paste' POST endpoint. It outlines the request structure, expected responses, and provides an example of a successful PIX copy-and-paste code generation, including details like the PIX code, QR code ID, debtor information, and amounts. ```json { "openapi": "3.1.0", "info": { "title": "Bankry API Documentation", "version": "1.0" }, "servers": [ { "url": "https://api.cartwavehub.com.br/v2/finance/" } ], "security": [ {} ], "paths": { "/create-pix-copy-and-paste": { "post": { "summary": "Generate a PIX Cash In with Rule for Same Document Receipt", "description": "", "operationId": "generate-a-pix-cash-in-same-document-receipt", "responses": { "200": { "description": "200", "content": { "application/json": { "examples": { "Result": { "value": "{\n \"worked\": true,\n \"pix_copy_and_paste\": \"00020101021226880014br.gov.bcb.pix2566qrcodes.saq.digital/v2/qr/cob/************************************SAQ INSTITUICAO DE PAGAME6009SAO PAULO62070503***6304E39B\",\n \"qr_code_id\": 1,\n \"debtor_name\": \"Fulano de tal\",\n \"debtor_document\": \"15888877743\",\n \"type_document\": \"CPF\",\n \"debtor_institution\": null,\n \"debtor_institution_number\": null,\n \"expiration_date\": \"2024-01-01T12:00:00.000Z\",\n \"due_date\": null,\n \"amount_chargeback\": 0.0,\n \"amount\": 0.01,\n \"fee\": 0.0,\n \"type_fine\": \"NONE\",\n \"fine\": null,\n \"fine_date\": null,\n \"status\": \"NEW\",\n \"base_64_image\": null,\n \"base_64_image_url\": \"https://api.saq.digital/v2/finance/image/qrcode/***c.png\",\n \"account_number\": \"0001\",\n \"agency_number\": \"0001\",\n \"endToEndId\": \"\",\n \"payment_date\": null,\n \"tax\": null,\n \"tx_id\": \"23920262************f770c\",\n \"tag\": \"description\"\n}" } }, "schema": { "type": "object", "properties": { "worked": { "type": "boolean", "example": true, "default": true }, "pix_copy_and_paste": { "type": "string", "example": "00020101021226880014br.gov.bcb.pix2566qrcodes.saq.digital/v2/qr/cob/************************************SAQ INSTITUICAO DE PAGAME6009SAO PAULO62070503***6304E39B" }, "qr_code_id": { "type": "integer", "example": 1, "default": 0 }, "debtor_name": { "type": "string", "example": "Fulano de tal" }, "debtor_document": { "type": "string", "example": "15888877743" }, "type_document": { "type": "string", "example": "CPF" }, "debtor_institution": {}, "debtor_institution_number": {}, "expiration_date": { "type": "string", "example": "2024-01-01T12:00:00.000Z" }, "due_date": {}, "amount_chargeback": { "type": "integer", "example": 0, "default": 0 }, "amount": { "type": "number", "example": 0.01, "default": 0 }, "fee": { "type": "integer", "example": 0, "default": 0 }, "type_fine": { "type": "string", "example": "NONE" }, "fine": {}, "fine_date": {}, "status": { "type": "string", "example": "NEW" }, "base_64_image": {}, "base_64_image_url": { "type": "string", "example": "https://api.saq.digital/v2/finance/image/qrcode/***c.png" }, "account_number": { "type": "string", "example": "0001" }, "agency_number": { "type": "string", "example": "0001" }, "endToEndId": { "type": "string", "example": "" }, "payment_date": {}, "tax": {}, "tx_id": { "type": "string" } } } } } } } } } } } ``` -------------------------------- ### GET /pix/cashin/status Source: https://cartwave-prod.readme.io/reference/check-status-and-details-of-a-generated-pix-cash-in-by-tag Fetches the status and details of a PIX Cash In transaction using the provided tag. ```APIDOC ## GET /pix/cashin/status ### Description Retrieves the status and details of a generated PIX Cash In transaction by its tag. ### Method GET ### Endpoint /pix/cashin/status ### Parameters #### Query Parameters - **tag** (Number) - Required - The client-generated tag ID for the PIX Cash In transaction. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **status** (String) - The current status of the PIX Cash In transaction. - **details** (Object) - An object containing further details about the transaction. ``` -------------------------------- ### POST /v2/pix/generate Source: https://cartwave-prod.readme.io/reference/generate-a-pix-cash-in-with-all-recommended-fields-copy Generates a new PIX payment request, returning a QR code and copy-and-paste string for the debtor. ```APIDOC ## POST /v2/pix/generate ### Description Generates a PIX Cash In request. This endpoint creates a payment record and returns the necessary data for the customer to perform the payment, such as the QR code image URL and the copy-and-paste string. ### Method POST ### Endpoint /v2/pix/generate ### Response #### Success Response (200) - **worked** (boolean) - Confirmation status of the request. - **pix_copy_and_paste** (string) - The generated copy and paste code for payment. - **qr_code_id** (integer) - Unique payment identifier. - **debtor_name** (string) - Name of the payer. - **debtor_document** (string) - Document number of the payer. - **status** (string) - Current status (NEW, PAID, CANCELED). - **base_64_image_url** (string) - URL to the generated QR code image. - **tx_id** (string) - Conciliation ID for the QR Code. #### Response Example { "worked": true, "pix_copy_and_paste": "00020101021226880014br.gov.bcb.pix...", "qr_code_id": 1, "debtor_name": "Fulano de tal", "debtor_document": "15888877743", "status": "NEW", "base_64_image_url": "https://api.saq.digital/v2/finance/image/qrcode/***c.png", "tx_id": "23920262************f770c" } ``` -------------------------------- ### Import Cryptographic Libraries Source: https://cartwave-prod.readme.io/reference/hmac-documentation-1 Imports the necessary modules or namespaces required for HMAC generation in various programming environments. ```JavaScript (Postman) const crypto = require('crypto-js'); ``` ```Python import hmac import hashlib ``` ```Java import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; ``` ```JavaScript (Node.js) const crypto = require('crypto'); ``` ```C# using System.Security.Cryptography; ``` ```PHP // No need to import any additional library for HMAC in PHP ``` -------------------------------- ### GET /status-cashout/tag Source: https://cartwave-prod.readme.io/reference/check-status-of-a-pix-cash-out-by-tag Retrieves the status of a specific PIX cash-out transaction by providing a unique tag identifier. ```APIDOC ## GET /status-cashout/tag ### Description Retrieve the current status and details of a PIX cash-out transaction using a specific tag. ### Method GET ### Endpoint https://api.cartwavehub.com.br/v2/finance/status-cashout/tag ### Parameters #### Query Parameters - **tag** (string) - Required - The unique tag identifier associated with the cash-out transaction. ### Request Example GET /status-cashout/tag?tag=YOUR_TAG_HERE ### Response #### Success Response (200) - **worked** (boolean) - Indicates if the request was successful. - **id** (integer) - The internal transaction ID. - **status** (string) - The current status of the transaction (e.g., SUCCESS). - **amount** (number) - The transaction amount. - **code_transaction** (string) - The unique transaction code. #### Response Example { "worked": true, "id": 66300134, "transaction_id": 66300134, "code_transaction": "E35535240202******BROEA793YQI", "status": "SUCCESS", "amount": 0.01, "recipient_name": "Fulano de tal" } ``` -------------------------------- ### POST /create-pix-copy-and-paste/ Source: https://cartwave-prod.readme.io/reference/generate-a-pix-cash-in-with-all-recommended-fields-copy-1 Generates a PIX 'Copy and Paste' payment code for financial transactions. ```APIDOC ## POST /create-pix-copy-and-paste/ ### Description Generates a PIX Cash In transaction with all recommended fields, returning the copy-and-paste string and QR code details. ### Method POST ### Endpoint https://api.cartwavehub.com.br/v2/finance/create-pix-copy-and-paste/ ### Response #### Success Response (200) - **worked** (boolean) - Indicates if the operation was successful. - **pix_copy_and_paste** (string) - The PIX code string for payment. - **qr_code_id** (integer) - Unique identifier for the generated QR code. - **debtor_name** (string) - Name of the debtor. - **amount** (number) - The transaction amount. - **status** (string) - Current status of the transaction (e.g., NEW). - **base_64_image_url** (string) - URL to the QR code image. - **tx_id** (string) - Transaction ID. #### Response Example { "worked": true, "pix_copy_and_paste": "00020101021226880014br.gov.bcb.pix...", "qr_code_id": 1, "debtor_name": "Fulano de tal", "amount": 0.01, "status": "NEW", "base_64_image_url": "https://api.saq.digital/v2/finance/image/qrcode/***c.png", "tx_id": "23920262************f770c" } ``` -------------------------------- ### GET /pix/cash-out/status Source: https://cartwave-prod.readme.io/reference/check-status-of-a-pix-cash-out-by-tag Retrieves the status of a PIX cash out operation based on a custom identifier provided by the client. ```APIDOC ## GET /pix/cash-out/status ### Description Check the current status of a PIX cash out transaction using a custom tag ID. ### Method GET ### Endpoint /pix/cash-out/status ### Parameters #### Query Parameters - **tag** (Number) - Required - The custom identifier generated by the client for internal control. ### Headers - **Authorization** (String) - Required - Bearer + Access_token ### Request Example GET /pix/cash-out/status?tag=w000196980001 Authorization: Bearer ### Response #### Success Response (200) - **status** (String) - The current status of the cash out request. - **tag** (Number) - The identifier used for the lookup. #### Response Example { "tag": "w000196980001", "status": "completed" } ``` -------------------------------- ### Define OpenAPI Specification for Bankry API Source: https://cartwave-prod.readme.io/reference/pix-cashout-using-pix-manual-create-payment-for-approval This snippet provides the base OpenAPI 3.1.0 configuration for the Bankry API. It defines the server base URL and the structure for the PIX manual cashout endpoint. ```json { "openapi": "3.1.0", "info": { "title": "Bankry API Documentation", "version": "1.0" }, "servers": [ { "url": "https://api.cartwavehub.com.br/v2/finance/" } ], "paths": { "/create-cashout-manual/": { "post": { "summary": "PIX Cashout using Pix Manual", "description": "Transfer funds from the business bank account to other accounts using PIX technology" } } } } ``` -------------------------------- ### GET /websites/cartwave-prod/check-pix-cash-in-status Source: https://cartwave-prod.readme.io/reference/check-status-and-details-of-a-generated-pix-cash-in-by-id Retrieves the status and details of a specific PIX Cash In transaction using its unique identifier. ```APIDOC ## GET /websites/cartwave-prod/check-pix-cash-in-status ### Description Retrieves the status and details of a generated PIX Cash In transaction by its ID. This endpoint is useful for confirming the completion or current state of a cash-in operation. ### Method GET ### Endpoint /websites/cartwave-prod/check-pix-cash-in-status ### Parameters #### Query Parameters - **id** (Number) - Required - The unique identifier generated in the response of the 'Generate a PIX Cash In' endpoint. #### Headers - **Authorization** (String) - Required - Bearer token for authentication. Example: Bearer [your_access_token] ### Request Example ``` GET /websites/cartwave-prod/check-pix-cash-in-status?id=113562 Host: api.cartwave.com Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzEzMzAwOTMxLCJpYXQiOjE3MTMyOTczMzEsImp0aSI6Ijc2ZWI4ZTE5ZjM4YjQ4NmZiODdmNzNjNTdkMWVmNDJhIiwidXNlcl9pZCI6MjQ2fQ.5zekMa7CUj9p-MvNHns5ke4ZPhYV3Y1CLOsYL7hDUUo ``` ### Response #### Success Response (200) - **status** (String) - The current status of the PIX Cash In transaction (e.g., 'completed', 'pending', 'failed'). - **transactionId** (String) - The unique identifier for the transaction. - **amount** (Number) - The amount of the cash-in transaction. - **currency** (String) - The currency of the transaction (e.g., 'BRL'). - **createdAt** (String) - Timestamp when the transaction was initiated. - **updatedAt** (String) - Timestamp when the transaction was last updated. #### Response Example ```json { "status": "completed", "transactionId": "pix_cashin_abc123xyz789", "amount": 100.50, "currency": "BRL", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:05:00Z" } ``` ``` -------------------------------- ### Retrieve HMAC Secret Key Source: https://cartwave-prod.readme.io/reference/hmac-documentation-1 Demonstrates how to securely retrieve the HMAC secret key from environment variables. Hardcoding keys is discouraged; using environment-specific variables ensures security and portability. ```JavaScript (Postman) const secretKey = pm.environment.get('secret_key'); ``` ```Python import os secret_key = os.getenv('SECRET_KEY') ``` ```Java String secretKey = System.getenv("SECRET_KEY"); ``` ```JavaScript (Node.js) const secretKey = process.env.SECRET_KEY; ``` ```C# string secretKey = Environment.GetEnvironmentVariable("SECRET_KEY"); ``` ```PHP $secretKey = getenv('SECRET_KEY'); ``` -------------------------------- ### GET /meds Source: https://cartwave-prod.readme.io/reference/list-meds-endpoint Retrieves a paginated list of PIX MED cases for the authenticated company, with optional filtering capabilities. ```APIDOC ## GET /meds ### Description This endpoint allows listing PIX MED cases for a specific company using cursor-based pagination. It provides filtering capabilities by date range, status, reason, and infraction report status. ### Method GET ### Endpoint /meds ### Parameters #### Query Parameters - **limit** (integer) - Optional - Number of records per page (Min: 1, Max: 100, Default: 5) - **id** (string) - Optional - Cursor ID for pagination navigation - **dt** (string) - Optional - Cursor datetime for pagination navigation (ISO 8601 format) - **direction** (string) - Optional - Pagination direction: next or previous (Default: next) - **filter_start_date** (date) - Optional - Start date for filtering MEDs (YYYY-MM-DD format) - **filter_end_date** (date) - Optional - End date for filtering MEDs (YYYY-MM-DD format) - **status** (enum) - Optional - Filter by MED status (WAITING, CANCELLED_BY_USER, CANCELLED_BY_PSP, ACCEPTED_BY_USER, ACCEPTED_BY_PSP, REJECTED_BY_USER, REJECTED_BY_PSP) - **reason** (enum) - Optional - Filter by MED reason (RETURN_REQUEST, RETURN_CANCELLATION) - **infraction_report_status** (enum) - Optional - Filter by infraction report status (OPEN, RECEIVED, CANCELLED, ANALYZED) ### Request Example GET /meds?limit=10&status=WAITING ### Response #### Success Response (200) - **data** (array) - List of MED objects - **pagination** (object) - Cursor information for next/previous pages #### Response Example { "data": [], "pagination": { "next_id": "med-456-def", "next_dt": "2024-01-16T10:00:00" } } ``` -------------------------------- ### POST /api/v2/finance/pix Source: https://cartwave-prod.readme.io/reference/generate-a-pix-cash-in-same-document-receipt Generates a new PIX payment request, returning the QR code, copy-and-paste string, and transaction metadata. ```APIDOC ## POST /api/v2/finance/pix ### Description Generates a PIX payment request. This endpoint returns the necessary data for a customer to complete a payment, including the QR code image URL and the copy-and-paste string. ### Method POST ### Endpoint /api/v2/finance/pix ### Response #### Success Response (200) - **worked** (Boolean) - Confirms if the query was successfully submitted. - **pix_copy_and_paste** (String) - The generated copy and paste code for bank payments. - **qr_code_id** (Int) - Unique payment identifier. - **debtor_name** (String) - Payer's name. - **debtor_document** (String) - Payer's document. - **type_document** (String) - Payer's document type. - **amount** (Decimal) - Transaction amount. - **status** (String) - Payment status (NEW, PAID, CANCELED). - **base_64_image_url** (String) - URL for the generated QR code image. - **tx_id** (String) - Conciliation ID. #### Response Example { "worked": true, "pix_copy_and_paste": "00020101021226880014br.gov.bcb.pix2566qrcodes/v2/qr/cob/example", "qr_code_id": 1, "debtor_name": "Fulano de tal", "debtor_document": "144******47", "type_document": "CPF", "amount": 0.01, "status": "NEW", "base_64_image_url": "https://api/v2/finance/image/qrcode/example.png", "tx_id": "bae44c6d8ed34*****fe0d526e2c" } ``` -------------------------------- ### GET /receipts/generate Source: https://cartwave-prod.readme.io/reference/check-status-of-a-pix-cash-out-by-tag-copy Generates a receipt for a completed PIX transfer transaction using the transaction ID and EndToEnd ID. ```APIDOC ## GET /receipts/generate ### Description Generates a receipt for a specific PIX transfer transaction. Requires an authorization token and specific transaction identifiers. ### Method GET ### Endpoint /receipts/generate ### Parameters #### Query Parameters - **id** (Number) - Required - The unique identifier generated in the PIX Transfer (Cash Out) response. - **uuid** (String) - Required - The EndToEnd ID generated for the transaction. - **language** (String) - Required - The language for the receipt (e.g., portuguese, english, chinese). #### Headers - **Authorization** (String) - Required - Bearer + Access_token ### Request Example GET /receipts/generate?id=113562&uuid=E0000002025000000YVCD4SNVVM&language=english ### Response #### Success Response (200) - **receipt** (Binary/Image) - The generated receipt document. #### Response Example [Binary Image Data] ```