### Install @openpix/react Source: https://github.com/woovibr/woovi-developers/blob/main/i18n/en/docusaurus-plugin-content-docs/current/plugin/plugin-react.md Install the @openpix/react package using pnpm. ```jsx pnpm install @openpix/react ``` -------------------------------- ### React Integration Example Source: https://github.com/woovibr/woovi-developers/blob/main/i18n/en/docusaurus-plugin-content-docs/current/plugin/plugin-react.md Example of using the useOpenPix hook in a React component to create charges and handle payment callbacks. Ensure 'core-js/stable' is imported. ```jsx import 'core-js/stable'; import { useState } from 'react'; import { useOpenPix } from '@openpix/react'; import QRCode from 'qrcode.react'; const App = () => { const [charge, setCharge] = useState(null); const onPay = (charge) => { // TODO do something console.log('charge was paid'); } const { chargeCreate } = useOpenPix({ appID: process.env.APP_ID, onPay, }); const newCharge = async () => { const payload = { correlationID: 'myCorrelationID', value: 1, // one cent comment: 'Donate', } const { charge, error } = await chargeCreate(payload); if (error) { setError(error); return; } setCharge(charge); } if (charge) { return ( ); } return ( <> ) } ``` -------------------------------- ### Install core-js for Polyfills Source: https://github.com/woovibr/woovi-developers/blob/main/i18n/en/docusaurus-plugin-content-docs/current/plugin/plugin-react.md Install core-js to polyfill Promises, which is required by the plugin. ```jsx pnpm install core-js ``` -------------------------------- ### Example Subscription Response Source: https://github.com/woovibr/woovi-developers/blob/main/i18n/en/docusaurus-plugin-content-docs/current/subscription-recurrence/subscription-with-interests-and-fines-create-api.mdx An example of a successful response when creating a subscription with interests and fines. ```json { "subscription": { "customer": { "name": "Fernando Silva", "email": "fernando@woovi.com", "phone": "+5531988472275", "taxID": { "taxID": "13225476617", "type": "BR:CPF" }, "correlationID": "1b112444-6530-46dd-934b-71d50d6c84bc", "address": { "zipcode": "30421322", "street": "Street", "number": "100", "neighborhood": "Neighborhood", "city": "Belo Horizonte", "state": "MG", "complement": "APTO", "country": "BR", "location": { "coordinates": [] }, "_id": "64b7d32db5a5555c9b750bc0" } }, "dayGenerateCharge": 5, "value": 1500, "globalID": "UGF5bWVudFN1YnNjcmlwdGlvbjo2M2UzYjJiNzczZDNkOTNiY2RkMzI5OTM=" } } ``` -------------------------------- ### Instalar core-js para Polyfills Source: https://github.com/woovibr/woovi-developers/blob/main/docs/plugin/plugin-react.md Instale o core-js para garantir a compatibilidade de Promises em seu aplicativo. ```bash pnpm add core-js ``` -------------------------------- ### React Native/Expo Integration Example Source: https://github.com/woovibr/woovi-developers/blob/main/i18n/en/docusaurus-plugin-content-docs/current/plugin/plugin-react.md Example of using the useOpenPix hook in a React Native or Expo component to create charges and handle payment callbacks. Ensure 'core-js/stable' is imported. ```jsx import 'core-js/stable'; import { useState } from 'react'; import { useOpenPix } from '@openpix/react'; import QRCode from 'react-native-qrcode-svg'; const App = () => { const [charge, setCharge] = useState(null); const onPay = (charge) => { // TODO do something console.log('charge was paid'); } const { chargeCreate } = useOpenPix({ appID: process.env.APP_ID, onPay, }); const newCharge = async () => { const payload = { correlationID: 'myCorrelationID', value: 1, // one cent comment: 'Donate', } const { charge, error } = await chargeCreate(payload); if (error) { setError(error); return; } setCharge(charge); } if (charge) { return ( ); } return ( <> ) } ``` -------------------------------- ### Basic HTML Structure with Woovi Plugin Source: https://github.com/woovibr/woovi-developers/blob/main/docs/plugin/plugin.md Example of a basic HTML file structure that includes the Woovi plugin script. Ensure the script is loaded before any custom JavaScript that utilizes the `$openpix` object. ```html Demo Woovi Plugin
``` -------------------------------- ### Instalar @openpix/react Source: https://github.com/woovibr/woovi-developers/blob/main/docs/plugin/plugin-react.md Adicione o pacote @openpix/react ao seu projeto usando pnpm. ```bash pnpm add @openpix/react ``` -------------------------------- ### Manage Woovi Customers with Ruby SDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/sdk/ruby/ruby-sdk-resources.md This code demonstrates how to list, fetch, create, and find Customers using the Woovi Ruby SDK. Initialize the client with your app_id before use. ```ruby require 'woovi/ruby_sdk' app_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' client = woovi::RubySdk::Client.new(app_id) # Listar Customers response = client.customers.fetch(skip: 0, limit: 10) # Buscar próxima página response = client.customers.fetch_next_page! # Buscar página anterior response = client.customers.fetch_previous_page! # Criar um Customer customer_params = { name: 'Client Name', tax_id: 12306252832 } # inicializar o body client.customers.init_body(params: customer_params) # faz o request para criar o recurso response = client.customers.save # Buscar um Customer específico response = client.customers.find(id: "id-do-customer") ``` -------------------------------- ### Get a Charge (GET /api/v1/charge/{id}) Source: https://context7.com/woovibr/woovi-developers/llms.txt Retrieves details of an existing charge by its correlationID or globalID. Use this to check payment status, get QR code data, or verify charge details. ```APIDOC ## Get a Charge (GET /api/v1/charge/{id}) Retrieves details of an existing charge by its correlationID or globalID. Use this to check payment status, get QR code data, or verify charge details. ### Method GET ### Endpoint /api/v1/charge/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The correlationID or globalID of the charge. ### Request Example ```bash # Get charge by correlationID curl --request GET \ --url https://api.woovi.com/api/v1/charge/c782e0ac-833d-4a89-9e73-9b60b2b41d3a \ --header 'Authorization: YOUR_APPID' ``` ### Response #### Success Response (200) - **charge** (object) - Details of the charge. - **value** (integer) - The charge amount in centavos. - **status** (string) - The current status of the charge. - **correlationID** (string) - The correlation ID of the charge. - **paymentLinkUrl** (string) - A URL for the payment link. - **qrCodeImage** (string) - A URL for the QR code image. - **paidAt** (string) - The date and time the charge was paid. #### Response Example ```json { "charge": { "value": 1500, "status": "COMPLETED", "correlationID": "c782e0ac-833d-4a89-9e73-9b60b2b41d3a", "paymentLinkUrl": "https://woovi.com/pay/...", "qrCodeImage": "https://api.woovi.com/openpix/charge/brcode/image/...", "paidAt": "2023-02-24T21:15:30.000Z" } } ``` ``` -------------------------------- ### Bootstrap do CDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/integrations/aws-lambda.md Prepara o ambiente AWS para o CDK, criando recursos necessários como buckets S3. Substitua ACCOUNT-NUMBER e REGION pelos seus valores. ```bash cdk boostrap aws://ACCOUNT-NUMBER/REGION ``` -------------------------------- ### Get Charge Details Source: https://context7.com/woovibr/woovi-developers/llms.txt Retrieves details of an existing charge using its correlationID or globalID. Use this to check payment status, get QR code data, or verify charge details. ```bash # Get charge by correlationID curl --request GET \ --url https://api.woovi.com/api/v1/charge/c782e0ac-833d-4a89-9e73-9b60b2b41d3a \ --header 'Authorization: YOUR_APPID' ``` -------------------------------- ### Initialize OpenPix Plugin Source: https://github.com/woovibr/woovi-developers/blob/main/i18n/en/docusaurus-plugin-content-docs/current/plugin/plugin.md Initialize the plugin by creating a `$openpix` array on the window object and pushing your appID. This is necessary to communicate with the plugin. ```jsx window.$openpix = []; window.$openpix.push(['config', { appID: 'YourOpenPixAppId' }]); ``` -------------------------------- ### Full Payload Example for Charge Created via Checkout Source: https://github.com/woovibr/woovi-developers/blob/main/docs/checkout/checkout-how-to-identify-a-charge-created-by-checkout-via-webhook.md This is a comprehensive example of a webhook payload for a 'woovi:CHARGE_CREATED' event originating from a Checkout. It includes all charge details along with the embedded checkout information. ```json { "event": "woovi:CHARGE_CREATED", "charge": { "customer": null, "value": 1200, "comment": "Webhook de Evento de Cobrança criada", "identifier": "c2cc9e8cd68442b0a41ee26534bef534", "paymentLinkID": "429762a4-4bef-4b00-8cc1-f0d3acb676d3", "transactionID": "c2cc9e8cd68442b0a41ee26534bef534", "status": "ACTIVE", "additionalInfo": [], "fee": 50, "discount": 0, "valueWithDiscount": 1200, "expiresDate": "2024-03-15T18:00:32.466Z", "type": "DYNAMIC", "correlationID": "c5820a0a-8abd-46a9-ab9b-ac5a9a68f463", "createdAt": "2024-03-14T18:00:34.413Z", "updatedAt": "2024-03-14T18:00:34.413Z", "brCode": "00020101021226990014br.gov.bcb.pix2577pix-h.bpp.com.br/23114447/qrs1/v2/011sMBpqAGIcbBqf1L8lqJxnJ8gzX6ZGGa22ycXMQ7Q520400005303986540512.005802BR5904demo6009SAO_PAULO61080455630062290525c2cc9e8cd68442b0a41ee265363047835", "checkout": { "title": "Título do Checkout", "paymentLinkID": "ff3e1bjk-9c7d-49eb-933a-8a47423ee928", "paymentLinkURL": "https://woovi.com.br/pay/ff3e1bjk-9c7d-49eb-933a-8a47423ee928" }, "expiresIn": 86400, "pixKey": "676bd1f8-93cb-4389-b094-5587179d56bf", "paymentLinkUrl": "http://woovi.com.br/pay/429762a4-4bef-4b00-8cc1-f0d3acb676d3", "qrCodeImage": "http://woovi.com.br/woovi/charge/brcode/image/429762a4-4bef-4b00-8cc1-f0d3acb676d3.png", "globalID": "Q2hhcmdlOjY1ZjMzYjQyZmNkYjRlZWMyMmY4YTdjYg==" }, "company": { "id": "65ba3d42675443db3debd9f9", "name": "Teste", "taxID": "75800612000168" }, "account": { "clientId": "AE11101E-FBE5-7EC8-130F-D9E6794894F9" } } ``` -------------------------------- ### Manage Woovi Webhooks with Ruby SDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/sdk/ruby/ruby-sdk-resources.md This Ruby code demonstrates how to list, fetch, and create Webhooks using the Woovi SDK. Initialize the client with your app_id. ```ruby require 'woovi/ruby_sdk' app_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' client = woovi::RubySdk::Client.new(app_id) # Listar Webhooks response = client.webhooks.fetch(skip: 0, limit: 10) # Buscar próxima página response = client.webhooks.fetch_next_page! # Buscar página anterior response = client.webhooks.fetch_previous_page! # Criar um Webhook webhook_params = { name: "nome do webhook", event: "woovi:CHARGE_CREATED", url: "https://meu-endpoint/woovi/webhooks" } ``` -------------------------------- ### GET /api/v1/account/ Source: https://context7.com/woovibr/woovi-developers/llms.txt Lists all accounts associated with your company. ```APIDOC ## GET /api/v1/account/ ### Description Lists all accounts associated with your company. Supports filtering by email and pagination. ### Method GET ### Endpoint https://api.woovi.com/api/v1/account/ ### Parameters #### Query Parameters - **skip** (integer) - Optional - The number of records to skip for pagination. - **limit** (integer) - Optional - The maximum number of records to return per page. ### Response #### Success Response (200) - **accounts** (array) - A list of account objects. - **accountId** (string) - The ID of the account. - **isDefault** (boolean) - Indicates if this is the default account. - **balance** (object) - Balance information. - **total** (integer) - The total balance in cents. - **blocked** (integer) - The blocked amount in cents. - **available** (integer) - The available balance in cents. - **pageInfo** (object) - Pagination information. - **skip** (integer) - The number of records skipped. - **limit** (integer) - The limit of records per page. - **hasNextPage** (boolean) - Indicates if there is a next page of results. #### Response Example ```json { "accounts": [ { "accountId": "6290ccfd42831958a405debc", "isDefault": true, "balance": {"total": 129430, "blocked": 0, "available": 129430} }, { "accountId": "6286b467a7910113577e00ce", "isDefault": false, "balance": {"total": 130, "blocked": 100, "available": 30} } ], "pageInfo": {"skip": 0, "limit": 10, "hasNextPage": false} } ``` ``` -------------------------------- ### GET /api/v1/account/{accountId} Source: https://context7.com/woovibr/woovi-developers/llms.txt Retrieves account details including balance information. ```APIDOC ## GET /api/v1/account/{accountId} ### Description Retrieves account details including balance information. Shows total balance, available balance, and any blocked amounts. ### Method GET ### Endpoint https://api.woovi.com/api/v1/account/{accountId} ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account to retrieve. ### Response #### Success Response (200) - **account** (object) - Details of the account. - **accountId** (string) - The ID of the account. - **isDefault** (boolean) - Indicates if this is the default account. - **balance** (object) - Balance information. - **total** (integer) - The total balance in cents. - **blocked** (integer) - The blocked amount in cents. - **available** (integer) - The available balance in cents. - **blockedBySecurity** (integer) - The amount blocked by security measures. - **blockedByWithdrawSafety** (integer) - The amount blocked by withdrawal safety measures. - **taxId** (string) - The tax ID associated with the account. - **officialName** (string) - The official name of the account holder. - **tradeName** (string) - The trade name of the account holder. #### Response Example ```json { "account": { "accountId": "6290ccfd42831958a405debc", "isDefault": true, "balance": { "total": 129430, "blocked": 0, "available": 129430, "blockedBySecurity": 0, "blockedByWithdrawSafety": 0 }, "taxId": "12345678901", "officialName": "Company Name LLC", "tradeName": "Company Trade Name" } } ``` ``` -------------------------------- ### GET /api/v1/statement Source: https://context7.com/woovibr/woovi-developers/llms.txt Retrieves the account statement, listing all transactions within a specified date range. ```APIDOC ## GET /api/v1/statement ### Description Retrieves a statement of all transactions within a specified date range. This endpoint is useful for financial reconciliation and reporting. ### Method GET ### Endpoint https://api.woovi.com/api/v1/statement ### Parameters #### Query Parameters - **start** (string) - Required - The start of the date range in ISO 8601 format (e.g., `YYYY-MM-DDTHH:MM:SSZ`). - **end** (string) - Required - The end of the date range in ISO 8601 format (e.g., `YYYY-MM-DDTHH:MM:SSZ`). - **skip** (integer) - Optional - Number of records to skip for pagination. Defaults to 0. - **limit** (integer) - Optional - Maximum number of records to return per page. Defaults to 100. ### Request Example ```bash curl --request GET \ --url 'https://api.woovi.com/api/v1/statement?start=2024-01-01T00:00:00Z&end=2024-01-31T23:59:59Z&skip=0&limit=100' \ --header 'Authorization: YOUR_APPID' ``` ### Response #### Success Response (200) - **statement** (array) - An array of transaction objects. - **type** (string) - The type of transaction (e.g., CREDIT, DEBIT). - **value** (integer) - The transaction value in cents. - **time** (string) - The timestamp of the transaction. - **endToEndId** (string) - The end-to-end ID for Pix transactions. - **description** (string) - A description of the transaction. #### Response Example ```json { "statement": [ { "type": "CREDIT", "value": 1500, "time": "2024-01-15T14:30:00Z", "endToEndId": "E12345678202401151430abc123", "description": "Pix received" }, { "type": "DEBIT", "value": 500, "time": "2024-01-16T10:00:00Z", "description": "Payment made" } ] } ``` ``` -------------------------------- ### GET /api/v1/transaction/{id} Source: https://context7.com/woovibr/woovi-developers/llms.txt Retrieves the details of a specific Pix transaction using its unique identifier. ```APIDOC ## GET /api/v1/transaction/{id} ### Description Retrieves detailed information about a specific Pix transaction using its `endToEndId` or a transaction ID. ### Method GET ### Endpoint https://api.woovi.com/api/v1/transaction/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The `endToEndId` or transaction ID of the transaction to retrieve. ### Request Example ```bash curl --request GET \ --url https://api.woovi.com/api/v1/transaction/E12345678202401151430abc123 \ --header 'Authorization: YOUR_APPID' ``` ### Response #### Success Response (200) - **transaction** (object) - Details of the transaction. - **endToEndId** (string) - The unique end-to-end ID of the transaction. - **value** (integer) - The transaction value in cents. - **time** (string) - The timestamp when the transaction occurred. - **payer** (object) - Information about the payer. - **name** (string) - The name of the payer. - **taxID** (string) - The tax ID of the payer. #### Response Example ```json { "transaction": { "endToEndId": "E12345678202401151430abc123", "value": 1500, "time": "2024-01-15T14:30:00Z", "payer": { "name": "John Doe", "taxID": "12345678901" } } } ``` ``` -------------------------------- ### Deploy da stack CDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/integrations/aws-lambda.md Realiza o deploy da sua stack CDK na AWS, tornando seus recursos como API Gateway e Lambda acessíveis. ```bash cdk deploy ``` -------------------------------- ### Importar Polyfills no Entrypoint Source: https://github.com/woovibr/woovi-developers/blob/main/docs/plugin/plugin-react.md Importe 'core-js/stable' no entrypoint da sua aplicação para aplicar os polyfills. ```jsx import 'core-js/stable'; ``` -------------------------------- ### Get Transaction Details Source: https://context7.com/woovibr/woovi-developers/llms.txt Retrieves details of a specific Pix transaction using its endToEndId or transaction ID. ```bash curl --request GET \ --url https://api.woovi.com/api/v1/transaction/E12345678202401151430abc123 \ --header 'Authorization: YOUR_APPID' ``` -------------------------------- ### Get Account Statement Source: https://context7.com/woovibr/woovi-developers/llms.txt Retrieves the account statement with all transactions within a specified date range. Useful for reconciliation. ```bash curl --request GET \ --url 'https://api.woovi.com/api/v1/statement?start=2024-01-01T00:00:00Z&end=2024-01-31T23:59:59Z&skip=0&limit=100' \ --header 'Authorization: YOUR_APPID' ``` -------------------------------- ### Manage Woovi Charges with Ruby SDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/sdk/ruby/ruby-sdk-resources.md Use this snippet to list, fetch, create, find, and destroy Charges. Ensure the SDK is required and a client is initialized with your app_id. ```ruby require 'woovi/ruby_sdk' app_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' client = woovi::RubySdk::Client.new(app_id) # Listar Charges response = client.charges.fetch(skip: 0, limit: 10) # Buscar próxima página response = client.charges.fetch_next_page! # Buscar página anterior response = client.charges.fetch_previous_page! # Criar um Charge charge_params = { correlation_id: 'my-correlation-id', value: 50000 } # inicializar o body client.charges.init_body(params: charge_params) # faz o request para criar o recurso response = client.charges.save # Metodos auxiliares para ajudar a construir body de criaçao # adicionar additional_info key = "minha-chave#123" value = "valor desejado" client.charges.add_additional_info(key, value) # adicionar interests interest = 0.5 client.charges.set_interests(interest) # adicionar fines fine = 0.2 client.charges.set_fines(fine) # Buscar um Charge específico response = client.charges.find(id: "id-do-charge") # Deletar um Charge específico response = client.charges.destroy(id: "id-do-charge") ``` -------------------------------- ### Get Payment by ID Source: https://github.com/woovibr/woovi-developers/blob/main/docs/sdk/java/resources.md Retrieves payment details using a payment ID. A correlation ID is required for the request. ```java // Obtém um pagamento pelo ID. string. sdk.getPaymentAsync(correlationID).get(); ``` -------------------------------- ### Register New Account Source: https://context7.com/woovibr/woovi-developers/llms.txt Initiates a BaaS account registration for KYC compliance. This is used for creating subaccounts that require verification. Ensure all required documents and representative information are provided. ```bash curl --request POST \ --url https://api.woovi.com/api/v1/account-register \ --header 'Authorization: YOUR_APPID' \ --header 'Content-Type: application/json' \ --data '{ "officialName": "Company Official Name", "tradeName": "Company Trade Name", "taxID": "12345678000199", "correlationID": "register-001", "documents": [ {"url": "https://example.com/social-contract.pdf", "type": "SOCIAL_CONTRACT"} ], "representatives": [{ "name": "John Doe", "birthDate": "1985-01-15", "email": "john@example.com", "phone": "+5511999999999", "taxID": "12345678901", "type": "ADMIN", "documents": [ {"url": "https://example.com/id-front.jpg", "type": "IDENTITY_FRONT"}, {"url": "https://example.com/id-back.jpg", "type": "IDENTITY_BACK"} ], "address": { "zipcode": "01310100", "street": "Av Paulista", "number": "1000", "neighborhood": "Bela Vista", "city": "Sao Paulo", "state": "SP", "taxID": "12345678901" } }] }' ``` -------------------------------- ### Manage Woovi Payments with Ruby SDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/sdk/ruby/ruby-sdk-resources.md Use this Ruby SDK snippet to list, fetch, create, and find Payments. Ensure the Woovi SDK is required and the client is initialized with your application ID. ```ruby require 'woovi/ruby_sdk' app_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' client = woovi::RubySdk::Client.new(app_id) # Listar Payments response = client.payments.fetch(skip: 0, limit: 10) # Buscar próxima página response = client.payments.fetch_next_page! # Buscar página anterior response = client.payments.fetch_previous_page! # Criar um Payment payment_params = { value: 100, correlation_id: "my-correlation-id-123-!@#" } # inicializar o body client.payments.init_body(params: payment_params) # faz o request para criar o recurso response = client.payments.save # Buscar um Payment específico response = client.payments.find(id: "id-do-payment") ``` -------------------------------- ### Manage Woovi Subscriptions with Ruby SDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/sdk/ruby/ruby-sdk-resources.md This snippet shows how to create and find Subscriptions using the Woovi Ruby SDK. Ensure the client is initialized with your app_id. ```ruby require 'woovi/ruby_sdk' app_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' client = woovi::RubySdk::Client.new(app_id) # Criar um Subscription subscription_params = { client: { name: "Cliente Legal", tax_id: "123456" }, value: 1234 } # inicializar o body client.refunds.init_body(params: subscription_params) # faz o request para criar o recurso response = client.subscriptions.save # Buscar um Subscription específico response = client.subscriptions.find(id: "id-do-subscription") ``` -------------------------------- ### Get Customer by ID Source: https://github.com/woovibr/woovi-developers/blob/main/docs/sdk/java/resources.md Retrieves a customer's information using their unique ID. Requires a correlation ID for tracking. ```java // Obtém um customer pelo ID. string. sdk.getCustomerAsync(correlationID).get(); ``` -------------------------------- ### Webhook Event Types Source: https://context7.com/woovibr/woovi-developers/llms.txt Examples of different webhook event payloads. Your endpoint should return HTTP 200 to acknowledge receipt. ```json { "event": "OPENPIX:CHARGE_COMPLETED", "charge": { "value": 1500, "correlationID": "charge-001", "status": "COMPLETED", "paidAt": "2024-01-15T14:30:00Z" }, "pix": { "endToEndId": "E12345678202401151430abc123", "value": 1500 } } ``` ```json { "event": "OPENPIX:CHARGE_EXPIRED", "charge": { "value": 1500, "correlationID": "charge-002", "status": "EXPIRED" } } ``` ```json { "event": "OPENPIX:TRANSACTION_RECEIVED", "transaction": { "value": 1500, "endToEndId": "E12345678202401151430abc123", "time": "2024-01-15T14:30:00Z" } } ``` -------------------------------- ### Instalar AWS CDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/integrations/aws-lambda.md Instala o toolkit da AWS CDK globalmente usando npm. Certifique-se de ter o npm instalado previamente. ```bash npm install --global aws-cdk ``` -------------------------------- ### Pix Transaction Payload Example Source: https://github.com/woovibr/woovi-developers/blob/main/i18n/en/docusaurus-plugin-content-docs/current/flows/webhook/flow-creating-webhook.mdx This is the payload structure received by your API when a Pix transaction is intercepted by the webhook. Note that the 'value' field is in cents. ```js payload { charge: { status: 'COMPLETED', customer: { name: 'Antonio Victor', taxID: { taxID: '12345678976', type: 'BR:CPF' }, email: 'antoniocliente@example.com', correlationID: '4979ceba-2132-4292-bd90-bee7fb2125e4' }, value: 1000, comment: 'Pagamento OpenPix', transactionID: 'ea83401ed4834b3ea6f1f283b389af29', correlationID: '417bae21-3d08-4cdb-9c2d-fee63c89e9e4', paymentLinkID: '34697ed2-3790-4b60-8512-e7465b142d84', createdAt: '2021-03-12T12:43:54.528Z', updatedAt: '2021-03-12T12:44:09.360Z', brCode: 'http://localhost:5001/openpix/testing?transactionID=ea83401ed4834b3ea6f1f283b389af29' }, pix: { charge: { status: 'COMPLETED', customer: { name: 'Antonio Victor', taxID: { taxID: '12345678976', type: 'BR:CPF' }, email: 'antoniocliente@example.com', correlationID: '4979ceba-2132-4292-bd90-bee7fb2125e4' }, value: 1000, comment: 'Pagamento OpenPix', transactionID: 'ea83401ed4834b3ea6f1f283b389af29', correlationID: '417bae21-3d08-4cdb-9c2d-fee63c89e9e4', paymentLinkID: '34697ed2-3790-4b60-8512-e7465b142d84', createdAt: '2021-03-12T12:43:54.528Z', updatedAt: '2021-03-12T12:44:09.360Z' }, time: '2021-03-12T12:44:09.269Z', value: 1, transactionID: 'ea83401ed4834b3ea6f1f283b389af29', infoPagador: 'OpenPix testing' } } ``` -------------------------------- ### Sintetizar aplicação CDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/integrations/aws-lambda.md Converte a aplicação CDK para um formato YML compatível com o AWS CloudFormation, preparando-a para o deploy. ```bash cdk synth ``` -------------------------------- ### Verificar versão do CDK Source: https://github.com/woovibr/woovi-developers/blob/main/docs/integrations/aws-lambda.md Valida se a instalação do AWS CDK ocorreu corretamente verificando a versão instalada. ```bash cdk --version ``` -------------------------------- ### Get Account Details Source: https://context7.com/woovibr/woovi-developers/llms.txt Retrieves detailed information about a specific account, including balance, tax ID, and official names. Requires the account ID. ```bash curl --request GET \ --url https://api.woovi.com/api/v1/account/6290ccfd42831958a405debc \ --header 'Authorization: YOUR_APPID' ``` -------------------------------- ### List Charges (GET /api/v1/charge) Source: https://context7.com/woovibr/woovi-developers/llms.txt Lists all charges with optional filtering by date range, status, customer, or subscription. Supports pagination with skip and limit parameters. ```APIDOC ## List Charges (GET /api/v1/charge) Lists all charges with optional filtering by date range, status, customer, or subscription. Supports pagination with skip and limit parameters. ### Method GET ### Endpoint /api/v1/charge ### Parameters #### Query Parameters - **start** (string) - Optional - Start date and time for filtering charges (ISO 8601 format). - **end** (string) - Optional - End date and time for filtering charges (ISO 8601 format). - **status** (string) - Optional - Filter charges by status (e.g., "COMPLETED"). - **skip** (integer) - Optional - Number of charges to skip for pagination. - **limit** (integer) - Optional - Maximum number of charges to return per page. ### Request Example ```bash # List charges with filters curl --request GET \ --url 'https://api.woovi.com/api/v1/charge?start=2024-01-01T00:00:00Z&end=2024-12-31T23:59:59Z&status=COMPLETED&skip=0&limit=20' \ --header 'Authorization: YOUR_APPID' ``` ### Response #### Success Response (200) - **charges** (array) - A list of charges. - **value** (integer) - The charge amount in centavos. - **status** (string) - The status of the charge. - **correlationID** (string) - The correlation ID of the charge. - **paidAt** (string) - The date and time the charge was paid. - **pageInfo** (object) - Information about the pagination. - **skip** (integer) - The number of charges skipped. - **limit** (integer) - The limit of charges per page. - **hasPreviousPage** (boolean) - Indicates if there is a previous page. - **hasNextPage** (boolean) - Indicates if there is a next page. #### Response Example ```json { "charges": [ { "value": 1500, "status": "COMPLETED", "correlationID": "charge-001", "paidAt": "2024-01-15T14:30:00Z" }, { "value": 2500, "status": "COMPLETED", "correlationID": "charge-002", "paidAt": "2024-01-16T10:00:00Z" } ], "pageInfo": { "skip": 0, "limit": 20, "hasPreviousPage": false, "hasNextPage": true } } ``` ```