### API Response Example (JSON) Source: https://pagouai.readme.io/reference/criar-plano Provides an example of a successful API response (200 OK) for retrieving plan details. This JSON object includes plan information such as ID, title, amount, interval, and detailed settings for default payment methods (pix, card, boleto). ```json { "id": 6, "alias": "planogold", "title": "PLano Gold (Trimestral)", "description": null, "amount": 100000, "interval": 3, "intervalType": "month", "status": "active", "deleted": false, "createdAt": "2021-10-18T01:06:44.000Z", "updatedAt": "2021-10-18T01:06:44.000Z", "settings": { "defaultPaymentMethod": "pix", "requestAddress": true, "requestPhone": true, "requestDocument": false, "traceable": true, "card": { "enabled": true, "freeInstallments": 3, "maxInstallments": 12 }, "pix": { "enabled": true, "expiresInDays": 2 }, "boleto": { "enabled": false, "expiresInDays": 2 } } } ``` -------------------------------- ### Authentication and Transaction Endpoint Source: https://pagouai.readme.io/reference This section details how to authenticate with the Pagou.ai API using Basic Access Authentication and provides an example for the transactions endpoint. ```APIDOC ## Introduction Welcome to the Pagou.ai API documentation! Our API follows REST standards, and all responses will be in JSON format. ## Authentication To authenticate with our API, you must pass your secret key following the Basic Access Authentication standard. You can find your keys by navigating to Settings -> API Credentials. After finding your keys, you should pass the secret key in the request headers in the **authorization** field, following the pattern below: ### Node.js Example ```javascript const options = { method: "POST", url: "https://api.conta.pagou.ai/v1/transactions", headers: { authorization: 'Basic ' + new Buffer("{SECRET_KEY}:x").toString('base64') } } ``` ## POST /v1/transactions ### Description This endpoint is used to create a new transaction. ### Method POST ### Endpoint `/v1/transactions` ### Parameters #### Query Parameters None #### Request Body * **amount** (number) - Required - The amount of the transaction. * **currency** (string) - Required - The currency of the transaction (e.g., 'BRL'). * **description** (string) - Optional - A description for the transaction. ### Request Example ```json { "amount": 100.50, "currency": "BRL", "description": "Payment for services rendered" } ``` ### Response #### Success Response (201 Created) * **id** (string) - The unique identifier for the transaction. * **status** (string) - The status of the transaction (e.g., 'pending', 'completed', 'failed'). * **created_at** (string) - The timestamp when the transaction was created. #### Response Example ```json { "id": "txn_12345abcde", "status": "pending", "created_at": "2023-10-27T10:00:00Z" } ``` #### Error Response (400 Bad Request) * **error** (string) - A message describing the error. #### Error Response Example ```json { "error": "Invalid amount provided." } ``` ``` -------------------------------- ### Payment Configuration Source: https://pagouai.readme.io/reference/criar-checkout This section details the structure for configuring payment methods like Boleto, Pix, and Card, including their respective enabled states, expiration periods, and installment options. ```APIDOC ## Payment Configuration Object ### Description Represents the configuration for various payment methods including Boleto, Pix, and Card. ### Properties - **boleto** (object) - Optional - Configuration for Boleto payments. - **enabled** (boolean) - Required - Whether the Boleto option is enabled. - **expiresInDays** (integer) - Required - The number of days until the Boleto expires. - **pix** (object) - Optional - Configuration for Pix payments. - **enabled** (boolean) - Required - Whether the Pix option is enabled. - **expiresInDays** (integer) - Required - The number of days until the Pix expires. - **card** (object) - Optional - Configuration for Card payments. - **enabled** (boolean) - Required - Whether the Card option is enabled. - **freeInstallments** (integer) - Required - The number of interest-free installments. - **maxInstallments** (integer) - Required - The maximum number of installments allowed. - **description** (string) - Optional - A description for internal use, not visible to the client. - **splits** (array) - Optional - Rules for transaction splitting. - **items** (object) - Represents a single split rule. - **recipientId** (integer) - Required - The ID of the recipient. - **amount** (integer) - Required - The transaction amount in cents. - **chargeProcessingFee** (boolean) - Optional - Whether the recipient is charged processing fees. Defaults to true. ### Request Example ```json { "boleto": { "enabled": true, "expiresInDays": 5 }, "pix": { "enabled": true, "expiresInDays": 1 }, "card": { "enabled": true, "freeInstallments": 3, "maxInstallments": 12 }, "description": "Payment configuration for a new product", "splits": [ { "recipientId": 123, "amount": 5000, "chargeProcessingFee": false }, { "recipientId": 456, "amount": 2500 } ] } ``` ### Response Example (Success 200) ```json { "message": "Payment configuration updated successfully." } ``` ``` -------------------------------- ### GET /company Source: https://pagouai.readme.io/reference/dados-da-empresa Retrieves detailed information about the company, including legal and commercial details, user information, financial permissions, and revenue data. ```APIDOC ## GET /company ### Description Retrieves detailed information about the company, including legal and commercial details, user information, financial permissions, and revenue data. ### Method GET ### Endpoint https://api.conta.pagou.ai/v1/company ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the company. - **userId** (integer) - The identifier for the associated user. - **legalName** (string) - The legal name of the company. - **blocked** (boolean) - Indicates if the company account is blocked. - **invoiceDescriptor** (string) - Descriptor used for invoices. - **commercialName** (string) - The commercial name of the company (can be null). - **createdAt** (string) - The timestamp when the company record was created. - **uploadedDocuments** (boolean) - Indicates if company documents have been uploaded. - **user** (object) - Details of the associated user. - **id** (integer) - User ID. - **email** (string) - User's email address. - **phone** (string) - User's phone number. - **name** (string) - User's name. - **isEmailVerified** (boolean) - Whether the user's email is verified. - **isPhoneVerified** (boolean) - Whether the user's phone is verified. - **isAdmin** (boolean) - Whether the user has admin privileges. - **isMaster** (boolean) - Whether the user has master privileges. - **createdAt** (string) - Timestamp of user creation. - **document** (object) - Company's identification document details. - **id** (integer) - Document ID. - **number** (string) - Document number (e.g., CPF or CNPJ). - **type** (string) - Type of document (e.g., "cpf", "cnpj"). - **permissions** (object) - Financial permissions granted to the company. - **id** (integer) - Permissions ID. - **companyId** (integer) - Company ID associated with these permissions. - **isCreditCardAvailable** (boolean) - Whether credit card payments are enabled. - **isBoletoAvailable** (boolean) - Whether boleto payments are enabled. - **isPixAvailable** (boolean) - Whether Pix payments are enabled. - **transferEnabled** (boolean) - Whether transfers are enabled. - **transferPriceCents** (integer) - The price of transfers in cents. - **anticipationEnabled** (boolean) - Whether anticipation of receivables is enabled. - **anticipatableVolumePercentage** (integer) - The percentage of volume that can be anticipated. - **anticipationPricePercent** (number) - The percentage fee for anticipation. - **minAnticipatableDays** (integer) - The minimum number of days for anticipation. - **createdAt** (string) - Timestamp of permissions creation. - **details** (object) - Additional details about the company's operations. - **id** (integer) - Details ID. - **averageRevenue** (integer) - Average monthly revenue. - **averageTicket** (integer) - Average ticket value. - **physicalProducts** (boolean) - Whether the company sells physical products. - **productsDescription** (string) - Description of the company's products. - **siteUrl** (string) - Company website URL. - **phone** (string) - Company contact phone number. - **email** (string) - Company contact email address. - **createdAt** (string) - Timestamp of details creation. - **legalRepresentative** (object) - Information about the company's legal representative. - **id** (integer) - Legal representative ID. - **name** (string) - Name of the legal representative. - **phone** (string) - Phone number of the legal representative. - **motherName** (string) - Mother's name of the legal representative. - **birthdate** (string) - Birthdate of the legal representative. - **createdAt** (string) - Timestamp of legal representative record creation. - **document** (object) - Document details of the legal representative. - **id** (integer) - Document ID. - **number** (string) - Document number. - **type** (string) - Type of document. - **socialContract** (object) - Details of the social contract (can be null). - **partnerDocument** (object) - Details of partner documents (can be null). - **address** (object) - Company's address details. - **id** (integer) - Address ID. - **street** (string) - Street name. - **streetNumber** (string) - Street number. - **complement** (string) - Complement to the address (can be null). - **zipCode** (string) - Postal code. - **neighborhood** (string) - Neighborhood. - **city** (string) - City. - **state** (string) - State. - **country** (string) - Country. - **revenue** (object) - Summary of company revenue and transactions. - **totalAmount** (integer) - Total revenue amount. - **totalCount** (integer) - Total number of transactions. - **cardAmount** (integer) - Revenue from card payments. - **cardCount** (integer) - Number of card transactions. - **pixAmount** (integer) - Revenue from Pix payments. - **pixCount** (integer) - Number of Pix transactions. - **boletoAmount** (integer) - Revenue from Boleto payments. - **boletoCount** (integer) - Number of Boleto transactions. - **chargebackAmount** (integer) - Amount of chargebacks. - **chargebackCount** (integer) - Number of chargebacks. - **refundAmount** (integer) - Amount of refunds. - **refundCount** (integer) - Number of refunds. - **createdAt** (string) - Timestamp of revenue data creation. - **defaultRecipient** (object) - Default recipient information for transactions. - **id** (integer) - Recipient ID. - **legalName** (string) - Legal name of the recipient. - **createdAt** (string) - Timestamp of recipient creation. - **document** (object) - Document details of the recipient. - **id** (integer) - Document ID. - **number** (string) - Document number. - **type** (string) - Type of document. - **transferSettings** (object) - Transfer settings for the recipient. - **id** (integer) - Transfer settings ID. - **transferEnabled** (boolean) - Whether transfers are enabled. - **automaticAnticipationEnabled** (boolean) - Whether automatic anticipation is enabled. - **anticipatableVolumePercentage** (integer) - Percentage of volume that can be anticipated. - **createdAt** (string) - Timestamp of transfer settings creation. - **balance** (object) - Current balance of the recipient. - **available** (integer) - Available balance amount. - **updatedAt** (string) - Timestamp when the balance was last updated. #### Response Example ```json { "id": 2, "userId": 1, "legalName": "Gabryel Ferreira", "blocked": false, "invoiceDescriptor": "Gabryel", "commercialName": null, "createdAt": "2022-05-26T19:06:35.000Z", "uploadedDocuments": false, "user": { "id": 1, "email": "gabryel.ferreira@hotmail.com", "phone": "11999999999", "name": "Gabryel", "isEmailVerified": true, "isPhoneVerified": false, "isAdmin": true, "isMaster": true, "createdAt": "2022-05-26T19:03:23.000Z" }, "document": { "id": 3, "number": "12345678910", "type": "cpf" }, "permissions": { "id": 1, "companyId": 2, "isCreditCardAvailable": true, "isBoletoAvailable": true, "isPixAvailable": true, "transferEnabled": true, "transferPriceCents": 200, "anticipationEnabled": true, "anticipatableVolumePercentage": 100, "anticipationPricePercent": 2, "minAnticipatableDays": 2, "createdAt": "2022-05-26T19:06:35.000Z" }, "details": { "id": 1, "averageRevenue": 5000, "averageTicket": 500, "physicalProducts": true, "productsDescription": "Produtos fera", "siteUrl": "www.fera.com", "phone": "11999999999", "email": "gabryel.ferreira@hotmail.com", "createdAt": "2022-05-26T19:06:35.000Z" }, "legalRepresentative": { "id": 1, "name": "Gabryel Ferreira", "phone": "11999999999", "motherName": "Ana Paula do Nascimento", "birthdate": "1998-07-03", "createdAt": "2022-05-26T19:06:35.000Z", "document": { "id": 4, "number": "12345678910", "type": "cpf" } }, "socialContract": null, "partnerDocument": null, "address": { "id": 2, "street": "Avenida Presidente Wilson", "streetNumber": "42", "complement": null, "zipCode": "11065200", "neighborhood": "Gonzaga", "city": "Santos", "state": "SP", "country": "br" }, "revenue": { "totalAmount": 133501, "totalCount": 20, "cardAmount": 103501, "cardCount": 17, "pixAmount": 30000, "pixCount": 3, "boletoAmount": 0, "boletoCount": 0, "chargebackAmount": 0, "chargebackCount": 0, "refundAmount": 66979, "refundCount": 11, "createdAt": "2022-05-26T19:06:35.000Z" }, "defaultRecipient": { "id": 1, "legalName": "Gabryel Ferreira", "createdAt": "2022-05-26T19:06:35.000Z", "document": { "id": 5, "number": "12345678910", "type": "cpf" }, "transferSettings": { "id": 1, "transferEnabled": true, "automaticAnticipationEnabled": true, "anticipatableVolumePercentage": 100, "createdAt": "2022-05-26T19:06:35.000Z" }, "balance": { "available": 6470, "updatedAt": "2022-06-02T01:37:48.000Z" } } } ``` ``` -------------------------------- ### Authentication and Transactions Source: https://pagouai.readme.io/index This section covers how to authenticate with the Pagou.ai API using Basic Access Authentication and provides an example for the transactions endpoint. ```APIDOC ## Introduction Our API follows REST standards, and all responses will be in JSON format. To authenticate with our API, you must pass your secret key following the Basic Access Authentication standard. You can find your keys by navigating to Settings -> API Credentials. After finding your keys, you should pass the secret key in the request headers in the **authorization** field, following the pattern below: ### POST /v1/transactions #### Description This endpoint is used to create a new transaction. #### Method POST #### Endpoint `https://api.conta.pagou.ai/v1/transactions` #### Parameters ##### Request Body (No specific request body fields are detailed in the provided text, but it's implied for a POST transaction request.) ### Request Example (Node.js) ```javascript const options = { method: "POST", url: "https://api.conta.pagou.ai/v1/transactions", headers: { authorization: 'Basic ' + new Buffer("{SECRET_KEY}:x").toString('base64') } } ``` ### Response #### Success Response (200) (No specific success response fields are detailed in the provided text.) #### Error Response (No specific error response details are provided in the text.) ``` -------------------------------- ### Create Checkout Source: https://pagouai.readme.io/reference/criar-checkout Creates a new checkout session. You need to provide the total amount, items in the cart, and the payment methods to be offered. After creation, the user will be redirected to the `secureUrl` provided in the response. ```APIDOC ## POST /checkout ### Description Creates a new checkout session. You need to provide the total amount, items in the cart, and the payment methods to be offered. After creation, the user will be redirected to the `secureUrl` provided in the response. Optionally, you can provide a `postbackUrl` to receive updates when a transaction is confirmed. ### Method POST ### Endpoint /checkout ### Parameters #### Query Parameters - **postbackUrl** (string) - Optional - The URL to receive postback notifications for transaction updates. #### Request Body - **amount** (integer) - Required - The total amount for the checkout in cents. - **items** (array) - Required - A list of items included in the cart. - **name** (string) - Required - The name of the item. - **quantity** (integer) - Required - The quantity of the item. - **price** (integer) - Required - The price of the item in cents. - **paymentMethods** (array) - Required - A list of payment methods available for this checkout. - **type** (string) - Required - The type of payment method (e.g., "credit_card", "pix"). ### Request Example ```json { "amount": 10000, "items": [ { "name": "Product A", "quantity": 1, "price": 5000 }, { "name": "Product B", "quantity": 2, "price": 2500 } ], "paymentMethods": [ { "type": "credit_card" }, { "type": "pix" } ] } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the checkout. - **secureUrl** (string) - The URL where the user will be redirected to complete the payment. - **status** (string) - The current status of the checkout (e.g., "open", "paid"). #### Response Example ```json { "id": "ch_12345abcde", "secureUrl": "https://secure.example.com/checkout/ch_12345abcde", "status": "open" } ``` ``` -------------------------------- ### Card Settings API Source: https://pagouai.readme.io/reference/criar-plano This section details the configuration for card payment methods within the website settings. It includes options for enabling card payments, setting free installment limits, and defining the maximum number of installments. ```APIDOC ## GET /websites/pagouai_readme_io/settings/card ### Description Retrieves the current card payment settings for the website. ### Method GET ### Endpoint /websites/pagouai_readme_io/settings/card ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **enabled** (boolean) - Indicates if card payments are enabled. - **freeInstallments** (integer) - The number of interest-free installments allowed. - **maxInstallments** (integer) - The maximum number of installments available. #### Response Example ```json { "enabled": true, "freeInstallments": 3, "maxInstallments": 12 } ``` ## PUT /websites/pagouai_readme_io/settings/card ### Description Updates the card payment settings for the website. ### Method PUT ### Endpoint /websites/pagouai_readme_io/settings/card ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **enabled** (boolean) - Required - If the card option will be enabled. - **freeInstallments** (integer) - Required - Interest-free installments. - **maxInstallments** (integer) - Required - Maximum number of installments. ### Request Example ```json { "enabled": true, "freeInstallments": 3, "maxInstallments": 12 } ``` ### Response #### Success Response (200) - **enabled** (boolean) - Indicates if card payments are enabled. - **freeInstallments** (integer) - The number of interest-free installments allowed. - **maxInstallments** (integer) - The maximum number of installments available. #### Response Example ```json { "enabled": true, "freeInstallments": 3, "maxInstallments": 12 } ``` ``` -------------------------------- ### Authenticate API Request with Node.js Source: https://pagouai.readme.io/reference This snippet demonstrates how to authenticate an API request using Node.js. It shows how to set up the request options, including the HTTP method, URL, and the 'authorization' header with the secret key formatted for Basic Access Authentication. Ensure you replace '{SECRET_KEY}' with your actual API secret key. ```javascript const options = { method: "POST", url: "https://api.conta.pagou.ai/v1/transactions", headers: { authorization: 'Basic ' + new Buffer("{SECRET_KEY}:x").toString('base64') } } ``` -------------------------------- ### GET /transactions Source: https://pagouai.readme.io/reference/listar-transacoes Retrieves a list of transactions based on various filtering criteria. ```APIDOC ## GET /transactions ### Description Retrieves a list of transactions based on various filtering criteria such as transaction ID, payment methods, status, delivery status, installments, customer details, and traceability. ### Method GET ### Endpoint https://api.conta.pagou.ai/v1/transactions ### Parameters #### Query Parameters - **id** (integer) - Optional - ID da transação. - **paymentMethods** (string) - Optional - Forma de pagamento. Valores possíveis: **credit_card, boleto, pix**. Caso envie mais de 1, enviar separado por vírgula. - **status** (string) - Optional - Status da transação. Valores possíveis: **processing, authorized, paid, refunded, waiting_payment, refused, chargedback, canceled, in_protest, partially_paid**. Caso envie mais de 1, enviar separado por vírgula. - **deliveryStatus** (string) - Optional - Status de entrega. Valores possíveis: **waiting, in_transit, delivered**. Caso envie mais de 1, enviar separado por vírgula. - **installments** (string) - Optional - Número de parcelas (de 1 a 12). Caso envie mais de 1, enviar separado por vírgula. - **name** (string) - Optional - Nome do cliente. - **email** (string) - Optional - E-mail do cliente. - **documentNumber** (string) - Optional - Número do documento do cliente. - **phone** (string) - Optional - Telefone do cliente. - **traceable** (boolean) - Optional - Status de entrega da transação gerenciada pelo painel. ### Response #### Success Response (200) - **transactions** (array) - List of transactions. - **id** (integer) - Transaction ID. - **amount** (number) - Transaction amount. - **status** (string) - Transaction status. - **paymentMethod** (string) - Payment method used. - **createdAt** (string) - Date and time the transaction was created. #### Response Example ```json { "transactions": [ { "id": 12345, "amount": 100.50, "status": "paid", "paymentMethod": "credit_card", "createdAt": "2023-10-27T10:00:00Z" } ] } ``` ``` -------------------------------- ### POST /checkouts Source: https://pagouai.readme.io/reference/criar-checkout Creates a new checkout session. You can specify the total amount, items, payment methods, and a postback URL for transaction updates. After creation, you will be redirected to a secure URL to complete the payment. ```APIDOC ## POST /checkouts ### Description Creates a new checkout session. You can specify the total amount, items, payment methods, and a postback URL for transaction updates. After creation, you will be redirected to a secure URL to complete the payment. ### Method POST ### Endpoint https://api.conta.pagou.ai/v1/checkouts ### Parameters #### Request Body - **amount** (integer) - Required - The total amount in cents (e.g., 500 for R$ 5.00). - **postbackUrl** (string) - Optional - The URL of your API that will receive checkout updates. - **items** (array) - Required - An array of items included in the checkout. - **title** (string) - Required - The title of the item. - **unitPrice** (integer) - Required - The unit price in cents (e.g., 500 for R$ 5.00). - **quantity** (integer) - Required - The quantity of the item. - **tangible** (boolean) - Required - Whether the item is physical. - **externalRef** (string) - Optional - The item's reference in your API. - **settings** (object) - Required - Checkout settings. - **defaultPaymentMethod** (string) - Required - The default payment method (e.g., "credit_card", "boleto", "pix"). - **requestAddress** (boolean) - Required - Whether to request the user's address. - **requestPhone** (boolean) - Required - Whether to request the user's phone number. - **traceable** (boolean) - Required - Whether to manage delivery status in the panel. - **boleto** (object) - Optional - Boleto payment settings. - **enabled** (boolean) - Required - Whether boleto is enabled. - **expiresInDays** (integer) - Required - The number of days until the boleto expires. - **splits** (array) - Required - An array of split payment configurations. ### Request Example ```json { "amount": 10000, "postbackUrl": "https://your-api.com/pagouai/webhook", "items": [ { "title": "Example Product", "unitPrice": 5000, "quantity": 2, "tangible": true, "externalRef": "PROD-123" } ], "settings": { "defaultPaymentMethod": "credit_card", "requestAddress": true, "requestPhone": false, "traceable": true, "boleto": { "enabled": true, "expiresInDays": 5 } }, "splits": [ { "amount": 8000, "recipient": "recipient_id_1" }, { "amount": 2000, "recipient": "recipient_id_2" } ] } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the checkout. - **secureUrl** (string) - The URL where the user can complete the payment. - **status** (string) - The current status of the checkout. #### Response Example ```json { "id": "ch_12345abcde", "secureUrl": "https://secure.pagou.ai/checkout/ch_12345abcde", "status": "created" } ``` ``` -------------------------------- ### GET /customers/{id} Source: https://pagouai.readme.io/reference/buscar-cliente Retrieves a specific customer's information using their unique ID. ```APIDOC ## GET /customers/{id} ### Description Retrieves a specific customer's information using their unique ID. ### Method GET ### Endpoint https://api.conta.pagou.ai/v1/customers/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - ID do cliente. ### Request Example ```json { "example": "No request body needed for GET request." } ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the customer. - **externalRef** (any) - External reference identifier for the customer. - **name** (string) - The name of the customer. - **email** (string) - The email address of the customer. - **phone** (any) - Phone number of the customer. - **createdAt** (string) - The date and time when the customer was created. - **document** (object) - Document details of the customer. - **id** (integer) - The unique identifier for the document. - **number** (string) - The document number. - **type** (string) - The type of document (e.g., 'cpf'). - **address** (object) - Address details of the customer. - **id** (integer) - The unique identifier for the address. - **street** (string) - The street name. - **streetNumber** (string) - The street number. - **complement** (any) - Additional address information. - **zipCode** (string) - The postal code. - **neighborhood** (string) - The neighborhood. - **city** (string) - The city. - **state** (string) - The state. - **country** (string) - The country. - **revenue** (object) - Revenue details associated with the customer. - **totalAmount** (integer) - Total revenue amount. - **totalCount** (integer) - Total number of revenue transactions. - **cardAmount** (integer) - Revenue amount from card payments. - **cardCount** (integer) - Number of card payment transactions. - **pixAmount** (integer) - Revenue amount from Pix payments. - **pixCount** (integer) - Number of Pix payment transactions. - **boletoAmount** (integer) - Revenue amount from Boleto payments. - **boletoCount** (integer) - Number of Boleto payment transactions. - **chargebackAmount** (integer) - Total chargeback amount. - **chargebackCount** (integer) - Total number of chargebacks. - **refundAmount** (integer) - Total refund amount. - **refundCount** (integer) - Total number of refunds. - **createdAt** (string) - The date and time when the revenue data was recorded. #### Response Example ```json { "id": 23, "externalRef": null, "name": "Bruce Wayne", "email": "atendimento@peterparker.com", "phone": null, "createdAt": "2021-09-19T04:05:55.000Z", "document": { "id": 3, "number": "11111111111", "type": "cpf" }, "address": { "id": 99, "street": "Avenida Paulista", "streetNumber": "807", "complement": null, "zipCode": "01311941", "neighborhood": "Bela Vista", "city": "São Paulo", "state": "SP", "country": "br" }, "revenue": { "totalAmount": 990, "totalCount": 1, "cardAmount": 990, "cardCount": 1, "pixAmount": 0, "pixCount": 0, "boletoAmount": 0, "boletoCount": 0, "chargebackAmount": 0, "chargebackCount": 0, "refundAmount": 0, "refundCount": 0, "createdAt": "2021-09-19T04:05:55.000Z" } } ``` ``` -------------------------------- ### GET /customers Source: https://pagouai.readme.io/reference/listar-clientes Retrieves a list of customers. This endpoint allows you to fetch all customer records available in the system. ```APIDOC ## GET /customers ### Description Retrieves a list of customers. This endpoint allows you to fetch all customer records available in the system. ### Method GET ### Endpoint https://api.conta.pagou.ai/v1/customers ### Parameters #### Query Parameters (No query parameters defined) #### Request Body (No request body defined) ### Request Example (No request example provided) ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the customer. - **externalRef** (any) - An external reference identifier for the customer. - **name** (string) - The name of the customer. - **email** (string) - The email address of the customer. - **phone** (any) - The phone number of the customer. - **createdAt** (string) - The timestamp when the customer was created. - **revenue** (object) - An object containing revenue-related details for the customer. - **totalAmount** (integer) - The total revenue amount. - **totalCount** (integer) - The total number of transactions. - **cardAmount** (integer) - The revenue amount from card payments. - **cardCount** (integer) - The number of card payment transactions. - **pixAmount** (integer) - The revenue amount from Pix payments. - **pixCount** (integer) - The number of Pix payment transactions. - **boletoAmount** (integer) - The revenue amount from Boleto payments. - **boletoCount** (integer) - The number of Boleto payment transactions. - **chargebackAmount** (integer) - The total chargeback amount. - **chargebackCount** (integer) - The total number of chargebacks. - **refundAmount** (integer) - The total refund amount. - **refundCount** (integer) - The total number of refunds. - **createdAt** (string) - The timestamp when the revenue data was recorded. #### Response Example ```json [ { "id": 23, "externalRef": null, "name": "Bruce Wayne", "email": "atendimento@peterparker.com", "phone": null, "createdAt": "2021-09-19T04:05:55.000Z", "revenue": { "totalAmount": 990, "totalCount": 1, "cardAmount": 990, "cardCount": 1, "pixAmount": 0, "pixCount": 0, "boletoAmount": 0, "boletoCount": 0, "chargebackAmount": 0, "chargebackCount": 0, "refundAmount": 0, "refundCount": 0, "createdAt": "2021-09-19T04:05:55.000Z" } } ] ``` ``` -------------------------------- ### GET /balance/available Source: https://pagouai.readme.io/reference/obter-saldo Retrieves the available balance for a recipient. If no recipient ID is provided, the company's primary recipient will be used. ```APIDOC ## GET /balance/available ### Description Retrieves the available balance for a recipient. If no recipient ID is provided, the company's primary recipient will be used. ### Method GET ### Endpoint https://api.conta.pagou.ai/v1/balance/available ### Parameters #### Query Parameters - **recipientId** (integer) - Optional - ID do recebedor. Caso não seja enviado, será usado o recebedor principal da empresa. ### Request Example ```json { "recipientId": 327 } ``` ### Response #### Success Response (200) - **amount** (integer) - The available amount. - **recipientId** (integer) - The ID of the recipient. #### Response Example ```json { "amount": 1000, "recipientId": 327 } ``` #### Error Response (400) - An empty JSON object is returned for bad requests. #### Error Response Example ```json {} ``` ``` -------------------------------- ### GET /recipients/{recipientId}/bank-accounts/{id} Source: https://pagouai.readme.io/reference/buscar-conta-bancaria-por-id Retrieves a specific bank account associated with a recipient by their IDs. ```APIDOC ## GET /recipients/{recipientId}/bank-accounts/{id} ### Description Retrieves a specific bank account associated with a recipient using both the recipient's ID and the bank account's ID. ### Method GET ### Endpoint /recipients/{recipientId}/bank-accounts/{id} ### Parameters #### Path Parameters - **recipientId** (integer) - Required - ID do recebedor. - **id** (integer) - Required - ID da conta bancária. ### Request Example ```json { "example": "No request body for GET request" } ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the bank account. - **bankCode** (string) - The code representing the bank. - **agencyNumber** (string) - The bank agency number. - **agencyDigit** (null) - The agency digit (can be null). - **accountNumber** (string) - The bank account number. - **accountDigit** (string) - The bank account digit. - **type** (string) - The type of bank account (e.g., 'conta_corrente'). - **legalName** (string) - The legal name associated with the account holder. - **documentNumber** (string) - The document number (e.g., CPF) of the account holder. - **documentType** (string) - The type of document provided (e.g., 'cpf'). - **isActive** (boolean) - Indicates if the bank account is active. - **createdAt** (string) - The timestamp when the bank account was created. #### Response Example ```json { "id": 14, "bankCode": "123", "agencyNumber": "0001", "agencyDigit": null, "accountNumber": "123456", "accountDigit": "0", "type": "conta_corrente", "legalName": "Gabryel Ferreira", "documentNumber": "12345678901", "documentType": "cpf", "isActive": true, "createdAt": "2022-06-15T14:56:54.000Z" } ``` ```