### Pix Transaction Example Source: https://app.paguelink.app/docs/intro/postbacks-format This example demonstrates the structure of a Pix transaction request, including all necessary fields for a successful transaction. ```APIDOC ## POST /transactions ### Description Initiates a new transaction using the Pix payment method. ### Method POST ### Endpoint /transactions ### Parameters #### Request Body - **type** (string) - Required - The type of the transaction, typically 'transaction'. - **url** (string) - Required - The webhook URL to receive transaction updates. - **objectId** (string) - Required - A unique identifier for the object. - **data** (object) - Required - Contains the transaction details. - **tenantId** (string) - Required - The ID of the tenant. - **companyId** (integer) - Required - The ID of the company. - **amount** (integer) - Required - The transaction amount in cents. - **currency** (string) - Required - The currency of the transaction (e.g., 'BRL'). - **paymentMethod** (string) - Required - The payment method, must be 'pix'. - **status** (string) - Required - The initial status of the transaction (e.g., 'waiting_payment'). - **installments** (integer) - Optional - The number of installments. - **paidAt** (string) - Optional - The date and time the transaction was paid. - **paidAmount** (integer) - Optional - The amount paid. - **refundedAt** (string) - Optional - The date and time the transaction was refunded. - **refundedAmount** (integer) - Optional - The amount refunded. - **postbackUrl** (string) - Required - The URL for postback notifications. - **metadata** (string) - Optional - Additional metadata for the transaction. - **ip** (string) - Optional - The IP address of the payer. - **externalRef** (string) - Optional - An external reference ID for the transaction. - **secureId** (string) - Optional - A secure ID for the transaction. - **secureUrl** (string) - Optional - A secure URL for the transaction. - **createdAt** (string) - Required - The creation date and time of the transaction. - **updatedAt** (string) - Required - The last update date and time of the transaction. - **payer** (object) - Optional - Information about the payer. - **traceable** (boolean) - Optional - Indicates if the transaction is traceable. - **authorizationCode** (string) - Optional - The authorization code. - **basePrice** (integer) - Optional - The base price of the transaction. - **interestRate** (integer) - Optional - The interest rate. - **items** (array) - Optional - A list of items in the transaction. - **title** (string) - Required - The title of the item. - **quantity** (integer) - Required - The quantity of the item. - **tangible** (boolean) - Required - Indicates if the item is tangible. - **unitPrice** (integer) - Required - The unit price of the item. - **externalRef** (string) - Optional - An external reference ID for the item. - **customer** (object) - Required - Information about the customer. - **id** (integer) - Required - The customer ID. - **name** (string) - Required - The customer's name. - **email** (string) - Required - The customer's email. - **phone** (string) - Optional - The customer's phone number. - **birthdate** (string) - Optional - The customer's birthdate. - **createdAt** (string) - Required - The creation date and time of the customer. - **externalRef** (string) - Optional - An external reference ID for the customer. - **document** (object) - Required - The customer's document. - **type** (string) - Required - The document type (e.g., 'cpf'). - **number** (string) - Required - The document number. - **address** (object) - Required - The customer's address. - **street** (string) - Required - The street name. - **streetNumber** (string) - Required - The street number. - **complement** (string) - Optional - The address complement. - **zipCode** (string) - Required - The zip code. - **neighborhood** (string) - Required - The neighborhood. - **city** (string) - Required - The city. - **state** (string) - Required - The state. - **country** (string) - Required - The country. - **fee** (object) - Optional - Fee details. - **netAmount** (integer) - Required - The net amount. - **estimatedFee** (integer) - Required - The estimated fee. - **fixedAmount** (integer) - Required - The fixed amount. - **spreadPercent** (integer) - Required - The spread percentage. - **currency** (string) - Required - The currency of the fee. - **splits** (array) - Optional - A list of splits for the transaction. - **amount** (integer) - Required - The split amount. - **netAmount** (integer) - Required - The net split amount. - **recipientId** (integer) - Required - The recipient ID. - **chargeProcessingFee** (boolean) - Required - Indicates if the processing fee is charged. - **refunds** (array) - Optional - A list of refunds. - **pix** (object) - Required - Pix specific details. - **qrcode** (string) - Required - The Pix QR code. - **end2EndId** (string) - Optional - The end-to-end ID. - **receiptUrl** (string) - Optional - The receipt URL. - **expirationDate** (string) - Required - The expiration date of the Pix payment. - **boleto** (object) - Optional - Boleto specific details. - **card** (object) - Optional - Card specific details. - **refusedReason** (string) - Optional - The reason for refusal. - **shipping** (object) - Optional - Shipping details. - **delivery** (object) - Optional - Delivery details. - **threeDS** (object) - Optional - 3D Secure details. - **redirectUrl** (string) - Required - The redirect URL for 3D Secure. - **returnUrl** (string) - Required - The return URL after 3D Secure authentication. - **token** (string) - Required - The 3D Secure token. ### Request Example ```json { "type": "transaction", "url": "https://webhook.exemplo.com", "objectId": "123456", "data": { "tenantId": "abcd1234-5678-90ab-cdef-1234567890ab", "companyId": 99, "amount": 750, "currency": "BRL", "paymentMethod": "pix", "status": "waiting_payment", "installments": 1, "paidAt": null, "paidAmount": 0, "refundedAt": null, "refundedAmount": 0, "postbackUrl": "https://webhook.exemplo.com", "metadata": "{ orderId: 123 }", "ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "externalRef": "pedido-abc123", "secureId": "fake-secure-id-0001", "secureUrl": "https://pagamento.exemplo.com/pagar/fake-secure-id-0001", "createdAt": "2025-04-29T10:00:00.000Z", "updatedAt": "2025-04-29T10:00:00.000Z", "payer": null, "traceable": false, "authorizationCode": null, "basePrice": 750, "interestRate": 0, "items": [ { "title": "Produto Teste Fictício", "quantity": 1, "tangible": true, "unitPrice": 750, "externalRef": "item-test-001" } ], "customer": { "id": 789, "name": "Carlos Exemplar", "email": "carlos.exemplar@exemplo.com", "phone": "11987654321", "birthdate": "1995-08-20", "createdAt": "2025-01-01T12:00:00.000Z", "externalRef": null, "document": { "type": "cpf", "number": "00011122233" }, "address": { "street": "Rua Fictícia", "streetNumber": "100", "complement": "Apto 10", "zipCode": "12345678", "neighborhood": "Bairro Teste", "city": "Cidade Exemplo", "state": "EX", "country": "BR" } }, "fee": { "netAmount": 738, "estimatedFee": 12, "fixedAmount": 12, "spreadPercent": 1, "currency": "BRL" }, "splits": [ { "amount": 750, "netAmount": 738, "recipientId": 999, "chargeProcessingFee": false } ], "refunds": [], "pix": { "qrcode": "00020101021226870014br.gov.bcb.pix2569pix.pagamento.exemplo.com/pix/v2/abc1234504000053039865802BR5909Carlos EX6008EXEMPLO62070503***6304FAKE", "end2EndId": null, "receiptUrl": null, "expirationDate": "2025-04-30" }, "boleto": null, "card": null, "refusedReason": null, "shipping": null, "delivery": null, "threeDS": { "redirectUrl": "https://minhaapi.com/redirect", "returnUrl": "https://minhaapi.com/return", "token": "jkhasdJHKHJKUASJKHhjksadhjkjkhHJjsfhd43ASasdfuih23jkKHBASVLdasfkjlh43" } } } ``` ### Response #### Success Response (200) - **type** (string) - The type of the response object. - **url** (string) - The URL for the transaction. - **objectId** (string) - The unique identifier for the transaction object. - **data** (object) - Contains the transaction details, similar to the request body but with updated status and payment information. #### Response Example ```json { "type": "transaction", "url": "https://pagamento.exemplo.com/transacao/123456", "objectId": "123456", "data": { "id": 123456, "tenantId": "abcd1234-5678-90ab-cdef-1234567890ab", "companyId": 99, "amount": 750, "currency": "BRL", "paymentMethod": "pix", "status": "waiting_payment", "installments": 1, "paidAt": null, "paidAmount": 0, "refundedAt": null, "refundedAmount": 0, "postbackUrl": "https://webhook.exemplo.com", "metadata": "{ orderId: 123 }", "ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "externalRef": "pedido-abc123", "secureId": "fake-secure-id-0001", "secureUrl": "https://pagamento.exemplo.com/pagar/fake-secure-id-0001", "createdAt": "2025-04-29T10:00:00.000Z", "updatedAt": "2025-04-29T10:00:00.000Z", "payer": null, "traceable": false, "authorizationCode": null, "basePrice": 750, "interestRate": 0, "items": [ { "title": "Produto Teste Fictício", "quantity": 1, "tangible": true, "unitPrice": 750, "externalRef": "item-test-001" } ], "customer": { "id": 789, "name": "Carlos Exemplar", "email": "carlos.exemplar@exemplo.com", "phone": "11987654321", "birthdate": "1995-08-20", "createdAt": "2025-01-01T12:00:00.000Z", "externalRef": null, "document": { "type": "cpf", "number": "00011122233" }, "address": { "street": "Rua Fictícia", "streetNumber": "100", "complement": "Apto 10", "zipCode": "12345678", "neighborhood": "Bairro Teste", "city": "Cidade Exemplo", "state": "EX", "country": "BR" } }, "fee": { "netAmount": 738, "estimatedFee": 12, "fixedAmount": 12, "spreadPercent": 1, "currency": "BRL" }, "splits": [ { "amount": 750, "netAmount": 738, "recipientId": 999, "chargeProcessingFee": false } ], "refunds": [], "pix": { "qrcode": "00020101021226870014br.gov.bcb.pix2569pix.pagamento.exemplo.com/pix/v2/abc1234504000053039865802BR5909Carlos EX6008EXEMPLO62070503***6304FAKE", "end2EndId": null, "receiptUrl": null, "expirationDate": "2025-04-30" }, "boleto": null, "card": null, "refusedReason": null, "shipping": null, "delivery": null, "threeDS": { "redirectUrl": "https://minhaapi.com/redirect", "returnUrl": "https://minhaapi.com/return", "token": "jkhasdJHKHJKUASJKHhjksadhjkjkhHJjsfhd43ASasdfuih23jkKHBASVLdasfkjlh43" } } } ``` ``` -------------------------------- ### List Anticipations (GET) Source: https://app.paguelink.app/docs/antecipation/list-antecipations The GET /antecipation route allows listing all anticipations. It supports pagination through 'page' and 'pageSize' query parameters. 'page' defaults to 1, and 'pageSize' defaults to 20 with a maximum of 50. ```Shell curl --request GET \ --url https://api.paguelink.app/v1/antecipation \ --header 'accept: application/json' \ --header 'authorization: Basic Og==' ``` -------------------------------- ### Get Available Balance - Python Source: https://app.paguelink.app/docs/balance/get-balance Retrieves the available balance using the `/balance/available` endpoint in Python. This example utilizes the 'requests' library for making the GET request. It includes headers and basic error handling. ```python import requests url = "https://api.paguelink.app/v1/balance/available" headers = { 'accept': 'application/json', 'authorization': 'Basic Og==' } try: response = requests.get(url, headers=headers) response.raise_for_status() # Raise an exception for bad status codes print(response.json()) except requests.exceptions.RequestException as e: print(f"Error fetching balance: {e}") ``` -------------------------------- ### Get Available Balance - Ruby Source: https://app.paguelink.app/docs/balance/get-balance Retrieves the available balance using the `/balance/available` endpoint in Ruby. This example uses the 'net/http' library to perform a GET request with specified headers. Error handling is included. ```ruby require 'net/http' require 'uri' uri = URI.parse('https://api.paguelink.app/v1/balance/available') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Get.new(uri.request_uri) request['accept'] = 'application/json' request['authorization'] = 'Basic Og==' response = http.request(request) if response.code == '200' puts response.body else puts "Error: #{response.code} - #{response.body}" end ``` -------------------------------- ### Get Available Balance - Node.js Source: https://app.paguelink.app/docs/balance/get-balance Retrieves the available balance using the `/balance/available` endpoint in Node.js. This example uses the 'axios' library to make a GET request. It includes necessary headers and handles potential errors. ```javascript const axios = require('axios'); const getBalance = async () => { try { const response = await axios.get('https://api.paguelink.app/v1/balance/available', { headers: { 'accept': 'application/json', 'authorization': 'Basic Og==' } }); console.log(response.data); } catch (error) { console.error('Error fetching balance:', error); } }; getBalance(); ``` -------------------------------- ### Withdrawal Transaction Example Source: https://app.paguelink.app/docs/intro/postbacks-format This section provides an example of a withdrawal transaction, detailing the request and response structure. ```APIDOC ## POST /transactions/withdraw ### Description Initiates a withdrawal transaction. ### Method POST ### Endpoint /transactions/withdraw ### Request Body - **id** (integer) - Required - Unique identifier for the transaction. - **type** (string) - Required - Type of transaction, e.g., "withdraw". - **objectId** (string) - Required - Object ID associated with the transaction. - **url** (string) - Required - URL for transaction callbacks. - **data** (object) - Required - Contains detailed transaction data. - **id** (integer) - Required - Internal transaction ID. - **tenantId** (string) - Required - Tenant identifier. - **companyId** (integer) - Required - Company identifier. - **amount** (integer) - Required - Total amount of the transaction. - **netAmount** (integer) - Required - Net amount after fees. - **fee** (integer) - Required - Transaction fee. - **currency** (string) - Required - Currency of the transaction (e.g., "BRL"). - **method** (string) - Required - Payment method (e.g., "fiat"). - **status** (string) - Required - Current status of the transaction (e.g., "COMPLETED"). - **externalRef** (string) - Optional - External reference ID. - **isExternal** (boolean) - Required - Indicates if the transaction is external. - **pixKey** (string) - Optional - Pix key for the transaction. - **pixKeyType** (string) - Optional - Type of Pix key. - **pixEnd2EndId** (string) - Optional - Pix End-to-End ID. - **cryptoWallet** (string) - Optional - Cryptocurrency wallet address. - **cryptoNetwork** (string) - Optional - Cryptocurrency network. - **cryptoAddress** (string) - Optional - Cryptocurrency address. - **description** (string) - Optional - Description of the transaction. - **metadata** (string) - Optional - Additional metadata, often a JSON string. - **postbackUrl** (string) - Required - URL for postback notifications. - **history** (array) - Required - Transaction history log. - **transferredAt** (string) - Optional - Timestamp of transfer. - **processedAt** (string) - Optional - Timestamp of processing. - **canceledAt** (string) - Optional - Timestamp of cancellation. - **createdAt** (string) - Required - Timestamp of creation. - **updatedAt** (string) - Required - Timestamp of last update. ### Request Example ```json { "id": 999, "type": "withdraw", "objectId": "999", "url": "https://webhook.exemplo.com/retorno", "data": { "id": 999, "tenantId": "abcd1234-ef56-7890-abcd-1234567890ef", "companyId": 77, "amount": 500, "netAmount": 450, "fee": 50, "currency": "BRL", "method": "fiat", "status": "COMPLETED", "externalRef": null, "isExternal": true, "pixKey": "00011122233", "pixKeyType": "cpf", "pixEnd2EndId": null, "cryptoWallet": null, "cryptoNetwork": null, "cryptoAddress": null, "description": "Pagamento efetuado", "metadata": "{\"notaFiscal\":\"NF-0001\"}", "postbackUrl": "https://webhook.exemplo.com/retorno", "history": [], "transferredAt": "2025-04-28T15:30:45.000Z", "processedAt": "2025-04-28T15:30:30.000Z", "canceledAt": null, "createdAt": "2025-04-28T15:30:00.000Z", "updatedAt": "2025-04-28T15:30:45.001Z" } } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Withdrawal initiated successfully." } ``` ``` -------------------------------- ### Prepare 3DS Authentication Parameters Source: https://app.paguelink.app/docs/sales/using-3ds Prepares the necessary parameters for 3DS authentication. This function should be called before `encrypt` and whenever `amount`, `installments`, or `currency` change. It's recommended to convert decimal amounts to cents using `convertDecimalToCents` before calling. ```javascript const currency = "BRL"; const amount = window["ShieldHelper"].convertDecimalToCents(3.50, currency); // Valor em centavos: 350 await window["ShieldHelper"].prepareThreeDS({ amount: 350, // Valor da transação em centavos da moeda "currency" installments: 1, // Número de parcelas }); ``` -------------------------------- ### Prepare 3DS Authentication Source: https://app.paguelink.app/docs/sales/using-3ds Call the `prepareThreeDS()` function to set up transaction parameters for 3DS authentication. It's recommended to call this function whenever `amount`, `installments`, or `currency` change. Ensure `amount` is converted to cents before calling. ```APIDOC ## POST /prepareThreeDS ### Description Prepares the necessary parameters for 3DS transaction authentication. ### Method POST ### Endpoint /prepareThreeDS ### Parameters #### Request Body - **amount** (integer) - Required - The transaction amount in cents. - **installments** (integer) - Required - The number of installments. - **currency** (string) - Required - The currency code (e.g., 'BRL'). ### Request Example ```json { "amount": 350, "installments": 1, "currency": "BRL" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "prepared" } ``` ``` -------------------------------- ### Get Anticipation Details (Shell) Source: https://app.paguelink.app/docs/antecipation/find-antecipation Retrieves the details of an anticipation by its ID using a GET request. Requires 'id' as a path parameter. Returns a JSON object on success or failure. ```Shell curl --request GET \ --url https://api.paguelink.app/v1/antecipation/%7Bid%7D \ --header 'accept: application/json' \ --header 'authorization: Basic Og==' ``` -------------------------------- ### Boleto Transaction Example (JSON) Source: https://app.paguelink.app/docs/intro/postbacks-format This JSON object represents a transaction initiated with the 'boleto' payment method. It includes details about the transaction, customer, payment specifics, and boleto information such as URL, barcode, and digitable line. ```json { "type": "transaction", "url": "https://webhook.exemplo.com/retorno", "objectId": "123457", "data": { "id": 123457, "tenantId": "abcd1111-2222-3333-4444-555566667777", "companyId": 99, "amount": 890, "currency": "BRL", "paymentMethod": "boleto", "status": "waiting_payment", "installments": 1, "paidAt": null, "paidAmount": 0, "refundedAt": null, "refundedAmount": 0, "postbackUrl": "https://webhook.exemplo.com/retorno", "returnUrl": "https://minhaapi.com/return", "redirectUrl": "https://minhaapi.com/redirect", "metadata": "{ orderId: 123 }", "ip": "198.51.100.10", "externalRef": "pedido-xyz-002", "secureId": "fake-secure-id-0002", "secureUrl": "https://pagamento.exemplo.com/pagar/fake-secure-id-0002", "createdAt": "2025-04-29T16:00:00.000Z", "updatedAt": "2025-04-29T16:00:00.000Z", "payer": null, "traceable": false, "authorizationCode": null, "basePrice": null, "interestRate": null, "items": [ { "title": "Assinatura Premium", "quantity": 1, "tangible": false, "unitPrice": 890, "externalRef": "item-premium-001" } ], "customer": { "id": 101, "name": "Ana Teste da Silva", "email": "ana.silva@exemplo.com", "phone": "11991234567", "birthdate": "1988-04-10", "createdAt": "2025-01-10T10:30:00.000Z", "externalRef": null, "document": { "type": "cpf", "number": "00011122233" }, "address": { "street": "Av. Fictícia", "streetNumber": "500", "complement": "Apto 101", "zipCode": "01234567", "neighborhood": "Bairro Legal", "city": "São Paulo", "state": "SP", "country": "BR" } }, "fee": { "netAmount": 880, "estimatedFee": 10, "fixedAmount": 10, "spreadPercent": 1, "currency": "BRL" }, "splits": [ { "amount": 890, "netAmount": 880, "recipientId": 888, "chargeProcessingFee": false } ], "refunds": [], "pix": null, "boleto": { "url": "https://pagamentos.exemplo.com/boletos/123457.pdf", "barcode": "https://pagamentos.exemplo.com/boletos/123457/barcode", "digitableLine": "23790123000000008901234560000000012345670000", "instructions": "Pagar até o vencimento. Após, sujeito a juros.", "expirationDate": "2025-05-02" }, "card": null, "refusedReason": null, "shipping": { "fee": 0, "address": { "street": "Av. Fictícia", "streetNumber": "500", "complement": "Apto 101", "neighborhood": "Bairro Legal", "zipCode": "01234567", "city": "São Paulo", "state": "SP", "country": "BR" } }, "delivery": { "status": "waiting", "trackingCode": null, "createdAt": "2025-04-29T16:00:00.000Z", "updatedAt": "2025-04-29T16:00:00.000Z" }, "threeDS": { "redirectUrl": "https://minhaapi.com/redirect", "returnUrl": "https://minhaapi.com/return", "token": "jkhasdJHKHJKUASJKHhjksadhjkjkhHJjsfhd43ASasdfuih23jkKHBASVLdasfkjlh43" } } } ``` -------------------------------- ### Get Available Balance - PHP Source: https://app.paguelink.app/docs/balance/get-balance Retrieves the available balance using the `/balance/available` endpoint in PHP. This example uses cURL to make the GET request, setting the necessary headers. It outputs the JSON response or an error message. ```php ``` -------------------------------- ### Get Anticipation Details (Node.js) Source: https://app.paguelink.app/docs/antecipation/find-antecipation Retrieves the details of an anticipation by its ID using a GET request. Requires 'id' as a path parameter. Returns a JSON object on success or failure. -------------------------------- ### Configurar Chave Pública e Obter Configurações 3DS Source: https://app.paguelink.app/docs/sales/using-3ds Configura a chave pública da sua aplicação e realiza uma requisição GET para o endpoint `get3dsSettings` para obter as configurações necessárias para o processo de autenticação 3DS. A chave pública é passada como parâmetro na URL. ```javascript const publicKey = "pk_..."; const moduleName = window["ShieldHelper"].getModuleName(); await window[moduleName].setPublicKey(publicKey); const response = await fetch('https://api.paguelink.app/api/v1/js/get3dsSettings?publicKey=${publicKey}', { method: "GET", headers: { "Content-Type": "application/json", "Accept": "application/json", }, } ); const data = await response.json(); console.log("Resultado da API ao carregar:", data); ``` -------------------------------- ### Transaction Example - Credit Card (JSON) Source: https://app.paguelink.app/docs/intro/postbacks-format This JSON object represents a sample transaction where the payment method is a credit card. It includes details about the transaction ID, amount, status, payment method, customer information, and card details. This format is used when a transaction is processed via credit card. ```json { "id": 123456, "type": "transaction", "objectId": "999", "url": "https://minhaapi.com/retorno", "data": { "id": 999, "amount": 15000, "refundedAmount": 0, "companyId": 99, "installments": 3, "paymentMethod": "credit_card", "status": "paid", "postbackUrl": "https://minhaapi.com/webhook", "metadata": "{ orderId: 123 }", "traceable": true, "secureId": "abc12345-def6-7890-ghij-klmnopqrstuv", "secureUrl": "https://pagamento.ficticio.com.br/pagar/abc12345-def6-7890-ghij-klmnopqrstuv", "createdAt": "2025-04-20T10:00:00.000Z", "updatedAt": "2025-04-20T10:01:00.000Z", "paidAt": "2025-04-20T10:02:00.000Z", "ip": "192.0.2.1", "externalRef": "trans-xyz-001", "customer": { "id": 50, "externalRef": "cliente-xyz", "name": "João da Silva", "email": "joao@emailficticio.com", "phone": "11912345678", "birthdate": "1990-05-10", "createdAt": "2025-01-01T12:00:00.000Z", "document": { "number": "98765432100", "type": "cpf" }, "address": { "street": "Av. Exemplo", "streetNumber": "123", "complement": "Bloco B", "zipCode": "01001000", "neighborhood": "Centro", "city": "São Paulo", "state": "SP", "country": "BR" } }, "card": { "id": 88, "brand": "mastercard", "holderName": "JOÃO DA SILVA", "lastDigits": "4321", "expirationMonth": 12, "expirationYear": 2030, "reusable": false, "createdAt": "2025-04-19T15:00:00.000Z" }, "boleto": null, "pix": null, "shipping": null, "refusedReason": null, "items": [ { "externalRef": "item-abc-01", "title": "Camisa Personalizada", "unitPrice": 15000, "quantity": 1, "tangible": true } ], "splits": [ { "recipientId": 10, "amount": 15000, "netAmount": 14100 } ], "refunds": [], "delivery": null, "fee": { "fixedAmount": 300, "spreadPercentage": 4, "estimatedFee": 600, "netAmount": 14100 }, "threeDS": { "redirectUrl": "https://minhaapi.com/redirect", "returnUrl": "https://minhaapi.com/return", "token": "jkhasdJHKHJKUASJKHhjksadhjkjkhHJjsfhd43ASasdfuih23jkKHBASVLdasfkjlh43" } } } ``` -------------------------------- ### Pix Transaction JSON Example Source: https://app.paguelink.app/docs/intro/postbacks-format This JSON object represents a sample Pix transaction. It includes details such as transaction type, webhook URL, object ID, and comprehensive data about the transaction, including payment method, status, amounts, customer information, and Pix-specific details like the QR code and expiration date. This structure is useful for understanding the data payload for Pix transactions. ```json { "type": "transaction", "url": "https://webhook.exemplo.com", "objectId": "123456", "data": { "id": 123456, "tenantId": "abcd1234-5678-90ab-cdef-1234567890ab", "companyId": 99, "amount": 750, "currency": "BRL", "paymentMethod": "pix", "status": "waiting_payment", "installments": 1, "paidAt": null, "paidAmount": 0, "refundedAt": null, "refundedAmount": 0, "postbackUrl": "https://webhook.exemplo.com", "metadata": "{ orderId: 123 }", "ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "externalRef": "pedido-abc123", "secureId": "fake-secure-id-0001", "secureUrl": "https://pagamento.exemplo.com/pagar/fake-secure-id-0001", "createdAt": "2025-04-29T10:00:00.000Z", "updatedAt": "2025-04-29T10:00:00.000Z", "payer": null, "traceable": false, "authorizationCode": null, "basePrice": 750, "interestRate": 0, "items": [ { "title": "Produto Teste Fictício", "quantity": 1, "tangible": true, "unitPrice": 750, "externalRef": "item-test-001" } ], "customer": { "id": 789, "name": "Carlos Exemplar", "email": "carlos.exemplar@exemplo.com", "phone": "11987654321", "birthdate": "1995-08-20", "createdAt": "2025-01-01T12:00:00.000Z", "externalRef": null, "document": { "type": "cpf", "number": "00011122233" }, "address": { "street": "Rua Fictícia", "streetNumber": "100", "complement": "Apto 10", "zipCode": "12345678", "neighborhood": "Bairro Teste", "city": "Cidade Exemplo", "state": "EX", "country": "BR" } }, "fee": { "netAmount": 738, "estimatedFee": 12, "fixedAmount": 12, "spreadPercent": 1, "currency": "BRL" }, "splits": [ { "amount": 750, "netAmount": 738, "recipientId": 999, "chargeProcessingFee": false } ], "refunds": [], "pix": { "qrcode": "00020101021226870014br.gov.bcb.pix2569pix.pagamento.exemplo.com/pix/v2/abc1234504000053039865802BR5909Carlos EX6008EXEMPLO62070503***6304FAKE", "end2EndId": null, "receiptUrl": null, "expirationDate": "2025-04-30" }, "boleto": null, "card": null, "refusedReason": null, "shipping": null, "delivery": null, "threeDS": { "redirectUrl": "https://minhaapi.com/redirect", "returnUrl": "https://minhaapi.com/return", "token": "jkhasdJHKHJKUASJKHhjksadhjkjkhHJjsfhd43ASasdfuih23jkKHBASVLdasfkjlh43" } } } ``` -------------------------------- ### Get Available Balance - Shell Source: https://app.paguelink.app/docs/balance/get-balance Retrieves the available balance using the `/balance/available` endpoint. Requires 'accept: application/json' and 'authorization: Basic Og==' headers. Returns a JSON object with balance details on success or an error object on failure. ```shell curl --request GET \ --url https://api.paguelink.app/v1/balance/available \ --header 'accept: application/json' \ --header 'authorization: Basic Og==' ``` -------------------------------- ### List Sales Transactions (Shell) Source: https://app.paguelink.app/docs/sales/list-sales This snippet demonstrates how to list all sales transactions using the Paguelink API. It utilizes a GET request to the `/transactions` endpoint and includes necessary headers for authentication and content type. ```Shell curl --request GET \ --url https://api.paguelink.app/v1/transactions \ --header 'accept: application/json' \ --header 'authorization: Basic Og==' ``` -------------------------------- ### Create Sale Transaction Source: https://app.paguelink.app/docs/sales/create-sale Process a transaction using the /transactions route. Supports credit card, boleto, and PIX payments. Requires amount, paymentMethod, and items. Optional fields include installments, card details, PIX/boleto details, shipping, customer, subMerchant, postbackUrl, returnUrl, metadata, externalRef, and IP. ```Shell curl --request POST \ --url https://api.paguelink.app/v1/transactions \ --header 'accept: application/json' \ --header 'authorization: Basic Og==' \ --header 'content-type: application/json' ``` -------------------------------- ### Estrutura de Resposta das Configurações 3DS Source: https://app.paguelink.app/docs/sales/using-3ds Exemplo da estrutura JSON retornada pela API ao solicitar as configurações 3DS. Contém informações sobre a necessidade e o tipo de autenticação 3DS, além de uma URL para iframe, se aplicável. ```json { "threeDSSecurity": false, "threeDSSecurityType": "NONE", "iframeUrl": null, "hideCardForm": false } ``` -------------------------------- ### Create Anticipation using API Source: https://app.paguelink.app/docs/antecipation/create-antecipation This endpoint allows you to request an anticipation. It requires the 'x-withdraw-key' header with your external withdrawal key. The body must include the 'amount' in cents. ```shell curl --request POST \ --url https://api.paguelink.app/v1/antecipation \ --header 'accept: application/json' \ --header 'authorization: Basic Og==' \ --header 'content-type: application/json' \ --header 'x-withdraw-key: wk_SUA-CHAVE-DE-SAQUE-EXTERNO' ``` -------------------------------- ### POST /v1/antecipation - Create Anticipation Source: https://app.paguelink.app/docs/antecipation/create-antecipation Allows requesting an anticipation through a POST request to the /antecipation endpoint. Requires the 'x-withdraw-key' header for external withdrawal key association. ```APIDOC ## POST /v1/antecipation ### Description Requests an anticipation through a POST request to the `/antecipation` endpoint. It is necessary to use the `x-withdraw-key` header containing the external withdrawal key associated with your account to perform anticipations via the API. ### Method POST ### Endpoint https://api.paguelink.app/v1/antecipation ### Parameters #### Request Body - **amount** (integer) - Required - The value in cents of the anticipation. (Ex: 100 = R$1,00). ### Request Example ```json { "amount": 100 } ``` ### Response #### Success Response (200) An object in case of success in creating the anticipation. #### Response Example ```json { "message": "Anticipation created successfully" } ``` #### Error Response (400) An object in case of failure. #### Error Response Example ```json { "error": "Invalid amount" } ``` ```