### Installment Response Example Source: https://dev.efipay.com.br/docs/api-cobrancas/cartao Example of a successful response when querying for credit card installment information. ```json { "rate": 0, "name": "brand", "installments": [{ "installment": 1, "has_interest": false, "value": 500, "currency": "5,00", "interest_percentage": 0 }] } ``` -------------------------------- ### Install Efí Module using modgit Source: https://dev.efipay.com.br/docs/modulos/OpenMage Use this command to initialize modgit and add the Efí payment module repository to your OpenMage installation. ```bash $ cd /path/to/openmage $ modgit init $ modgit add gerencianet https://github.com/gerencianet/gn-api-magento.git ``` -------------------------------- ### Create Boleto (One Step) - Individual Customer Source: https://dev.efipay.com.br/docs/api-cobrancas/boleto Example of creating a bank slip transaction with an individual customer's details. Ensure all required fields for 'items' and 'payment.banking_billet.customer' are provided. ```json { "items": [ { "name": "Meu Produto", "value": 5990, "amount": 1 } ], "payment": { "banking_billet": { "customer": { "name": "Gorbadoc Oldbuck", "cpf": "94271564656", "email": "email_do_cliente@servidor.com.br", "phone_number": "5144916523", "address": { "street": "Avenida Juscelino Kubitschek", "number": "909", "neighborhood": "Bauxita", "zipcode": "35400000", "city": "Ouro Preto", "complement": "", "state": "MG" } }, "expire_at": "2023-12-15", "configurations": { "fine": 200, "interest": 33 }, "message": "Usando o atributo message, este conteúdo é exibido no campo OBSERVAÇÃO da cobrança emitida via API e também no campo OBSERVAÇÃO DO VENDEDOR nos e-mails de cobrança enviados ao cliente É possível utilizar até 4 linhas de conteúdo, com no máximo 100 caracteres por linha Essa mensagem poderá ser vista nos e-mails relacionados à cobrança, no boleto ou carnê" } } } ``` -------------------------------- ### Set File Permissions for OpenMage Module Source: https://dev.efipay.com.br/docs/modulos/OpenMage These commands set the appropriate file permissions for directories and files after manual installation of the Efí module. Ensure correct permissions for security and functionality. ```bash sudo find . -type d -exec chmod 755 {} \; ``` ```bash sudo find . -type f -exec chmod 644 {} \; ``` ```bash sudo chmod 777 -R app/etc/; ``` ```bash sudo chmod 777 -R var/; ``` ```bash sudo chmod 777 -R media/; ``` -------------------------------- ### Create Boleto (One Step) - Corporate Customer Source: https://dev.efipay.com.br/docs/api-cobrancas/boleto Example of creating a bank slip transaction with a corporate customer's details. This includes the 'juridical_person' object for company information. ```json { "items": [ { "name": "Meu Produto", "value": 5990, "amount": 1 } ], "payment": { "banking_billet": { "customer": { "email": "email_do_cliente@servidor.com.br", "phone_number": "5144916523", "juridical_person":{ "corporate_name": "Nome da Empresa", "cnpj": "99794567000144" }, "address": { "street": "Avenida Juscelino Kubitschek", "number": "909", "neighborhood": "Bauxita", ``` -------------------------------- ### Natural Person Data with Statistics Example Source: https://dev.efipay.com.br/docs/pix-indireto/diretorio This JSON object includes detailed statistics related to a natural person's account activity, fraud markers, infraction reports, and SPI settlements. Use this when you need a comprehensive view including risk and activity metrics. ```json { "correlationId": "abcdef01-2345-6789-0123-456789012345", "entry": { "OpenClaimCreationDate": "2023-01-01T10:00:00.000Z", "account": { "accountNumber": "0007654321", "accountType": "CACC", "branch": "0001", "openingDate": "2010-01-10T03:00:00Z", "participant": "12345678" }, "creationDate": "2023-01-01T10:00:00.000Z", "key": "11122233300", "keyOwnershipDate": "2023-01-01T10:00:00.000Z", "keyType": "cpf", "owner": { "name": "João Silva", "taxIdNumber": "11122233300", "type": "NATURAL_PERSON" } }, "keyStatistics": { "entries": { "distinctAccounts": { "d90": 0, "m12": 0, "m60": 0 }, "watermark": "2023-01-01T10:00:00.000Z" }, "fraudMarkers": { "applicationFrauds": { "d90": 0, "m12": 0, "m60": 0 }, "distinctFraudReporters": { "d90": 0, "m12": 0, "m60": 0 }, "muleAccounts": { "d90": 0, "m12": 0, "m60": 0 }, "otherFrauds": { "d90": 0, "m12": 0, "m60": 0 }, "scammerAccounts": { "d90": 0, "m12": 0, "m60": 0 }, "totalFraudTransactionAmount": { "d90": 0, "m12": 0, "m60": 0 }, "unknownFrauds": { "d90": 0, "m12": 0, "m60": 0 }, "watermark": "2023-01-01T10:00:00.000Z" }, "infractionReports": { "openReports": 0, "openReportsDistinctReporters": 0, "rejectedReports": { "d90": 0, "m12": 0, "m60": 0 }, "watermark": "2023-01-01T10:00:00.000Z" }, "spi": { "settlements": { "d90": 0, "m12": 0, "m60": 0 }, "watermark": "2023-01-01T10:00:00.000Z" } }, "ownerStatistics": { "entries": { "registeredAccounts": 0, "watermark": "2023-01-01T10:00:00.000Z" }, "fraudMarkers": { "applicationFrauds": { "d90": 0, "m12": 0, "m60": 0 }, "distinctFraudReporters": { "d90": 0, "m12": 0, "m60": 0 }, "muleAccounts": { "d90": 0, "m12": 0, "m60": 0 }, "otherFrauds": { "d90": 0, "m12": 0, "m60": 0 }, "scammerAccounts": { "d90": 0, "m12": 0, "m60": 0 }, "totalFraudTransactionAmount": { "d90": 0, "m12": 0, "m60": 0 }, "unknownFrauds": { "d90": 0, "m12": 0, "m60": 0 }, "watermark": "2023-01-01T10:00:00.000Z" }, "infractionReports": { "openReports": 0, "openReportsDistinctReporters": 0, "rejectedReports": { "d90": 0, "m12": 0, "m60": 0 }, "watermark": "2023-01-01T10:00:00.000Z" }, "spi": { "settlements": { "d90": 0, "m12": 0, "m60": 0 }, "watermark": "2023-01-01T10:00:00.000Z" } }, "responseTime": 0 } ``` -------------------------------- ### Natural Person Data Example Source: https://dev.efipay.com.br/docs/pix-indireto/diretorio This JSON object represents the data for a natural person, including account details and ownership information. It is used when retrieving information about an individual. ```json { "correlationId": "abcdef01-2345-6789-0123-456789012345", "entry": { "OpenClaimCreationDate": "2023-01-01T10:00:00.000Z", "account": { "accountNumber": "0007654321", "accountType": "CACC", "branch": "0001", "openingDate": "2010-01-10T03:00:00Z", "participant": "12345678" }, "creationDate": "2023-01-01T10:00:00.000Z", "key": "11122233300", "keyOwnershipDate": "2023-01-01T10:00:00.000Z", "keyType": "cpf", "owner": { "name": "João Silva", "taxIdNumber": "11122233300", "type": "NATURAL_PERSON" } }, "responseTime": 800 } ``` -------------------------------- ### List Installment Information Source: https://dev.efipay.com.br/docs/api-cobrancas/cartao Retrieves available installment options for a credit card transaction based on account settings. Requires payee code, environment, brand, and total amount. ```javascript async function listInstallments() { try { const installments = await EfiPay.CreditCard .setAccount("Identificador_de_conta_aqui") .setEnvironment("production") // 'production' or 'sandbox' .setBrand("visa") .setTotal(28990) .getInstallments(); console.log("Parcelas", installments); } catch (error) { console.log("Código: ", error.code); console.log("Nome: ", error.error); console.log("Mensagem: ", error.error_description); } } ``` -------------------------------- ### Bad Request Error Response Example Source: https://dev.efipay.com.br/docs/pix-indireto/diretorio This JSON object illustrates a typical error response for a bad request. It includes details about the error, such as a status code and a descriptive title. This is returned when the API cannot process the request due to invalid input. ```json { "correlationId": "abcdef01-2345-6789-0123-456789012345", "error": { "detail": "Could not parse request body", "status": 400, "title": "Bad Request", "type": "https://dict.pi.rsfn.net.br/api/v2/error/BadRequest" }, "responseTime": 0 } ``` -------------------------------- ### POST /v1/charge/one-step Source: https://dev.efipay.com.br/docs/api-cobrancas/boleto Creates a bank slip (boleto) transaction in one step. This endpoint requires the request body to contain all minimum mandatory attributes for issuing the title. Ensure your SDK is updated for optimal performance. ```APIDOC ## POST /v1/charge/one-step ### Description Creates a bank slip (boleto) transaction in one step. This endpoint requires the request body to contain all minimum mandatory attributes for issuing the title. It allows associating a payment method, such as a bank slip or credit card, in a single step. ### Method POST ### Endpoint /v1/charge/one-step ### Parameters #### Request Body - **items** (array) - Required - List of items included in the charge. - **name** (string) - Required - Name of the item. - **value** (integer) - Required - Value of the item in cents. - **amount** (integer) - Required - Quantity of the item. - **marketplace** (object) - Optional - Marketplace configuration. - **payee_code** (string) - Required if marketplace is present - Code of the payee. - **percentage** (integer) - Required if marketplace is present - Percentage of the marketplace fee. - **shippings** (array) - Optional - List of shipping information. - **name** (string) - Required - Name of the shipping service. - **value** (integer) - Required - Value of the shipping in cents. - **payee_code** (string) - Required - Code of the payee for shipping. - **metadata** (object) - Optional - Metadata for the charge. - **custom_id** (string) - Optional - Custom identifier for the charge. - **notification_url** (string) - Optional - URL to receive notifications. - **payment** (object) - Required - Payment details. - **banking_billet** (object) - Required - Configuration for bank slip payment. - **customer** (object) - Required - Customer information. - **name** (string) - Required - Customer's full name. - **cpf** (string) - Required if juridical_person is not present - Customer's CPF. - **email** (string) - Required - Customer's email address. - **phone_number** (string) - Required - Customer's phone number. - **birth** (string) - Optional - Customer's birth date (YYYY-MM-DD). - **address** (object) - Required - Customer's address. - **street** (string) - Required - Street name. - **number** (string) - Required - Street number. - **neighborhood** (string) - Required - Neighborhood. - **zipcode** (string) - Required - Postal code. - **city** (string) - Required - City name. - **complement** (string) - Optional - Complementary address information. - **state** (string) - Required - State abbreviation (e.g., MG, SP). - **juridical_person** (object) - Required if cpf is not present - Corporate customer information. - **corporate_name** (string) - Required - Company's legal name. - **cnpj** (string) - Required - Company's CNPJ. - **expire_at** (string) - Required - Expiration date of the bank slip (YYYY-MM-DD). - **discount** (object) - Optional - Discount configuration. - **type** (string) - Required - Type of discount ('percentage' or 'currency'). - **value** (integer) - Required - Value of the discount. - **conditional_discount** (object) - Optional - Conditional discount configuration. - **type** (string) - Required - Type of discount ('percentage' or 'currency'). - **value** (integer) - Required - Value of the discount. - **until_date** (string) - Required - Date until which the conditional discount is valid (YYYY-MM-DD). - **configurations** (object) - Optional - Additional configurations for the bank slip. - **days_to_write_off** (integer) - Optional - Number of days after expiration for automatic write-off (0-120). If 0, payment is not possible after expiration. - **fine** (integer) - Optional - Fine amount in cents. - **interest** (object) - Optional - Interest configuration. - **value** (integer) - Required - Interest rate value. - **type** (string) - Optional - Interest type ('monthly'). Defaults to daily if not specified. - **message** (string) - Optional - Message to be displayed on the bank slip and in customer emails. ### Request Example (CPF) ```json { "items": [ { "name": "Meu Produto", "value": 5990, "amount": 1 } ], "payment": { "banking_billet": { "customer": { "name": "Gorbadoc Oldbuck", "cpf": "94271564656", "email": "email_do_cliente@servidor.com.br", "phone_number": "5144916523", "address": { "street": "Avenida Juscelino Kubitschek", "number": "909", "neighborhood": "Bauxita", "zipcode": "35400000", "city": "Ouro Preto", "complement": "", "state": "MG" } }, "expire_at": "2023-12-15", "configurations": { "fine": 200, "interest": 33 }, "message": "Usando o atributo message, este conteúdo é exibido no campo OBSERVAÇÃO da cobrança emitida via API\n e também no campo OBSERVAÇÃO DO VENDEDOR nos e-mails de cobrança enviados ao cliente \n É possível utilizar até 4 linhas de conteúdo, com no máximo 100 caracteres por linha \n Essa mensagem poderá ser vista nos e-mails relacionados à cobrança, no boleto ou carnê" } } } ``` ### Request Example (CNPJ) ```json { "items": [ { "name": "Meu Produto", "value": 5990, "amount": 1 } ], "payment": { "banking_billet": { "customer": { "email": "email_do_cliente@servidor.com.br", "phone_number": "5144916523", "juridical_person":{ "corporate_name": "Nome da Empresa", "cnpj": "99794567000144" }, "address": { "street": "Avenida Juscelino Kubitschek", "number": "909", "neighborhood": "Bauxita", "zipcode": "35400000", "city": "Ouro Preto", "complement": "", "state": "MG" } }, "expire_at": "2023-12-15" } } } ``` ### Request Example (days_to_write_off) ```json { "items": [ { "name": "Meu Produto", "value": 5990, "amount": 1 } ], "payment": { "banking_billet": { "customer": { "name": "Gorbadoc Oldbuck", "cpf": "94271564656", "email": "email_do_cliente@servidor.com.br", "phone_number": "5144916523", "address": { "street": "Avenida Juscelino Kubitschek", "number": "909", "neighborhood": "Bauxita", "zipcode": "35400000", "city": "Ouro Preto", "complement": "", "state": "MG" } }, "expire_at": "2023-12-15", "configurations": { "days_to_write_off": 30 } } } } ``` ### Request Example (Monthly Interest) ```json { "items": [ { "name": "Meu Produto", "value": 5990, "amount": 1 } ], "payment": { "banking_billet": { "customer": { "name": "Gorbadoc Oldbuck", "cpf": "94271564656", "email": "email_do_cliente@servidor.com.br", "phone_number": "5144916523", "address": { "street": "Avenida Juscelino Kubitschek", "number": "909", "neighborhood": "Bauxita", "zipcode": "35400000", "city": "Ouro Preto", "complement": "", "state": "MG" } }, "expire_at": "2023-12-15", "configurations": { "interest": { "value": 33, "type": "monthly" } } } } } ``` ### Response #### Success Response (200) - **charge_id** (string) - The unique identifier for the created charge. - **status** (string) - The current status of the charge (e.g., 'waiting_payment'). - **bank_slip_url** (string) - URL to access the generated bank slip. - **created_at** (string) - Timestamp when the charge was created. #### Response Example ```json { "charge_id": "ch_12345abcde", "status": "waiting_payment", "bank_slip_url": "https://www.efipay.com.br/boleto/view/ch_12345abcde", "created_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Separate Private Key using OpenSSL Source: https://dev.efipay.com.br/docs/api-pix/credenciais This OpenSSL command can be used to separate the private key from a certificate during the conversion process. ```shell # Separar chave privada do certificado openssl rsa -in certificado.pem -out certificado_key.pem -nodes ``` -------------------------------- ### Convert P12 to PEM using OpenSSL Source: https://dev.efipay.com.br/docs/api-pix/credenciais Use this OpenSSL command to convert a P12 certificate to PEM format. The -nodes flag prevents encrypting the private key. ```shell # Gerar certificado e chave em único arquivo openssl pkcs12 -in certificado.p12 -out certificado.pem -nodes -password pass:"" ``` -------------------------------- ### Resposta de Erro (400) - Operação Inválida Source: https://dev.efipay.com.br/docs/api-pix/envio-pagamento-pix Exemplo de resposta de erro quando a operação de pagamento de QR Code Pix é inválida, como saldo insuficiente. Detalha a violação e a propriedade afetada. ```json { "type": "https://pix.bcb.gov.br/api/v2/error/QrcodeOperacaoInvalida", "title": "Operação Inválida", "status": 400, "detail": "A requisição que busca pagar um qrcode não respeita o schema ou está semanticamente errada.", "violacoes": [ { "razao": "Saldo insuficiente para realizar o pagamento", "propriedade": "qrcode.pagador" } ] } ``` -------------------------------- ### Requisição para Pagar QR Code Pix Source: https://dev.efipay.com.br/docs/api-pix/envio-pagamento-pix Exemplo de corpo de requisição para o endpoint de pagamento de QR Code Pix. Inclui informações do pagador e o QR Code Copia e Cola. ```json { "pagador": { "chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1", "infoPagador": "Pagamento de QR Code via API Pix" }, "pixCopiaECola": "00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.sejaefi.com.br/v2 41e0badf811a4ce6ad8a80b306821fce5204000053000065802BR5905EFISA6008SAOPAULO60070503***61040000" } ``` -------------------------------- ### Resposta de Sucesso (201) ao Pagar QR Code Pix Source: https://dev.efipay.com.br/docs/api-pix/envio-pagamento-pix Exemplo de resposta bem-sucedida do endpoint de pagamento de QR Code Pix. Indica o `idEnvio`, `e2eId`, `valor` e o `status` do pagamento. ```json { "idEnvio": "12453567890123456789", "e2eId": "E09089356202011251226APIff82f2e5", "valor": "12.31", "horario": { "solicitacao": "2021-11-25T12:26:42.905Z" }, "status":"EM_PROCESSAMENTO" } ``` -------------------------------- ### Idempotent Pix Send Update Source: https://dev.efipay.com.br/docs/api-pix/envio-pagamento-pix The `PUT /v3/gn/pix/:idEnvio` endpoint is idempotent. Use the same `idEnvio` for retries if a transaction fails. A new `idEnvio` should be used only for new transactions. ```APIDOC ## PUT /v3/gn/pix/:idEnvio ### Description Updates the status of a Pix transfer or retries a failed transaction using the same `idEnvio` for idempotency. ### Method PUT ### Endpoint /v3/gn/pix/:idEnvio ### Parameters #### Path Parameters - **idEnvio** (string) - Required - The unique identifier for the transaction. #### Request Body - **status** (string) - Required - The new status of the transaction (e.g., 'RETRY', 'CANCEL'). ### Request Example ```json { "status": "RETRY" } ``` ### Response #### Success Response (200) - **status** (string) - The updated status of the Pix transfer. - **message** (string) - Confirmation message. #### Response Example ```json { "status": "PROCESSING", "message": "Pix transfer retry initiated." } ``` ``` -------------------------------- ### Resposta de Erro (500) - Erro Interno Source: https://dev.efipay.com.br/docs/api-pix/envio-pagamento-pix Exemplos de respostas de erro interno do servidor, indicando que a funcionalidade pode estar desabilitada em ambiente de homologação ou um erro genérico do servidor. ```json { "type": "https://pix.bcb.gov.br/api/v2/error/QrcodeErroInterno", "title": "Erro Interno", "status": 500, "detail": "Funcionalidade desabilitada em ambiente de homologação." } ``` ```json { "nome": "erro_interno_servidor", "mensagem": "Erro Interno do servidor" } ``` -------------------------------- ### Unauthorized Error Response (401) Source: https://dev.efipay.com.br/docs/pix-indireto/diretorio This response indicates that the participant is not authenticated. Ensure valid authentication credentials are provided. ```json { "correlationId": "abcdef01-2345-6789-0123-456789012345", "error": { "detail": "Participant is not authenticated", "status": 401, "title": "Unauthorized" }, "responseTime": 0 } ``` -------------------------------- ### Card Brand Identification Response Source: https://dev.efipay.com.br/docs/api-cobrancas/cartao Possible string outputs for the identified credit card brand, including 'undefined' or 'unsupported'. ```string "visa" ou "mastercard" ou "amex" ou "elo" ou "undefined" ou "unsupported" ``` -------------------------------- ### EfiPay Boleto Schema Structure Source: https://dev.efipay.com.br/docs/api-cobrancas/boleto Hierarchical structure of attributes for creating a charge via the One Step API. Includes items, shipping, metadata, and payment details for banking billets. ```json "items" "name" "value" "amount" "marketplace" "payee_code" "percentage" "shippings" "name" "value" "payee_code" "metadata" "custom_id" "notification_url" "payment" "banking_billet" "customer" "name" "cpf" "email" "phone_number" "birth" "address" "street" "number" "neighborhood" "zipcode" "city" "complement" "state" "juridical_person" "corporate_name" "cnpj" "expire_at" "discount" "type" "percentage", "currency" "value" "conditional_discount" "type" "percentage", "currency" "value" "until_date" "configurations" "days_to_write_off" "fine" "interest" "value" "type" "message" ``` -------------------------------- ### Script Blocking Status Response Source: https://dev.efipay.com.br/docs/api-cobrancas/cartao Possible string outputs indicating whether the EfiPay fingerprint script is blocked or not. ```string "true" se o script de fingerprint estiver bloqueado, ou "false" caso contrário. ``` -------------------------------- ### Resposta de Erro (403) - Escopo Insuficiente Source: https://dev.efipay.com.br/docs/api-pix/envio-pagamento-pix Exemplo de resposta de erro indicando que o token de acesso não possui o escopo necessário para realizar a operação. ```json { "error": "insufficient_scope", "error_description": "Access token has insufficient scope" } ``` -------------------------------- ### 403 Forbidden Error Response Source: https://dev.efipay.com.br/docs/pix-indireto/diretorio Indicates that the participant is not allowed to access the requested resource. Check authentication and authorization. ```json { "correlationId": "abcdef01-2345-6789-0123-456789012345", "error": { "detail": "Participant is not allowed to access this resource", "status": 403, "title": "Forbidden" }, "responseTime": 0 } ``` -------------------------------- ### Pay Pix QR Code Source: https://dev.efipay.com.br/docs/api-pix/envio-pagamento-pix Endpoint to pay a Pix QR Code via API. This operation is similar to sending Pix, but targets a specific charge defined in `pixCopiaECola`. Ensure the `gn.qrcodes.pay` scope is enabled and the payer's Pix key has an associated webhook for payment status updates. ```APIDOC ## PUT /v2/gn/pix/:idEnvio/qrcode ### Description Allows payment of a Pix QR Code using the API. This endpoint requires the `gn.qrcodes.pay` scope and a webhook configured for the payer's Pix key. ### Method PUT ### Endpoint `/v2/gn/pix/:idEnvio/qrcode` ### Parameters #### Path Parameters - **idEnvio** (string) - Required - Unique identifier for the transaction. #### Request Body - **pagador** (object) - Required - Information about the payer. - **chave** (string) - Required - The Pix key of the payer. - **infoPagador** (string) - Optional - Additional information from the payer. - **pixCopiaECola** (string) - Required - The Pix Copy and Paste code representing the QR Code. ### Request Example ```json { "pagador": { "chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1", "infoPagador": "Pagamento de QR Code via API Pix" }, "pixCopiaECola": "00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.sejaefi.com.br/v2 41e0badf811a4ce6ad8a80b306821fce5204000053000065802BR5905EFISA6008SAOPAULO60070503***61040000" } ``` ### Response #### Success Response (201) - **idEnvio** (string) - The unique identifier for the transaction. - **e2eId** (string) - The End-to-End ID of the Pix transaction. - **valor** (string) - The amount of the transaction. - **horario** (object) - Object containing the transaction time. - **solicitacao** (string) - The timestamp when the transaction was requested. - **status** (string) - The current status of the transaction (e.g., EM_PROCESSAMENTO). #### Response Example (Success) ```json { "idEnvio": "12453567890123456789", "e2eId": "E09089356202011251226APIff82f2e5", "valor": "12.31", "horario": { "solicitacao": "2021-11-25T12:26:42.905Z" }, "status":"EM_PROCESSAMENTO" } ``` #### Error Responses - **400 Bad Request**: Indicates an invalid request, such as incorrect schema or semantic errors. Example: Insufficient balance. - **403 Forbidden**: Indicates insufficient scope for the access token. - **500 Internal Server Error**: Indicates an internal server error on Efí's side or a disabled feature in the sandbox environment. #### Response Example (400 Bad Request) ```json { "type": "https://pix.bcb.gov.br/api/v2/error/QrcodeOperacaoInvalida", "title": "Operação Inválida", "status": 400, "detail": "A requisição que busca pagar um qrcode não respeita o schema ou está semanticamente errada.", "violacoes": [ { "razao": "Saldo insuficiente para realizar o pagamento", "propriedade": "qrcode.pagador" } ] } ``` #### Response Example (403 Forbidden) ```json { "error": "insufficient_scope", "error_description": "Access token has insufficient scope" } ``` #### Response Example (500 Internal Server Error) ```json { "type": "https://pix.bcb.gov.br/api/v2/error/QrcodeErroInterno", "title": "Erro Interno", "status": 500, "detail": "Funcionalidade desabilitada em ambiente de homologação." } ``` OR ```json { "nome": "erro_interno_servidor", "mensagem": "Erro Interno do servidor" } ``` ``` -------------------------------- ### Request Pix Send Source: https://dev.efipay.com.br/docs/api-pix/envio-pagamento-pix Endpoint to perform a direct Pix transfer to a registered Pix key. This endpoint may be subject to BACEN standardization changes. A webhook must be associated with the Pix key for status notifications. For applications created before July 29, 2024, re-enabling the 'pix.send' scope is required. ```APIDOC ## POST /v3/gn/pix ### Description Initiates a direct Pix transfer to a registered Pix key. ### Method POST ### Endpoint /v3/gn/pix ### Parameters #### Request Body - **idEnvio** (string) - Required - Unique identifier for the transaction to ensure idempotency. - **valor** (number) - Required - The amount to be transferred. - **chave** (string) - Required - The Pix key of the recipient. - **descricao** (string) - Optional - A description for the transaction. ### Request Example ```json { "idEnvio": "unique-transaction-id-123", "valor": 10.50, "chave": "recipient-pix-key@example.com", "descricao": "Payment for services" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the Pix transfer (e.g., 'PENDING', 'COMPLETED', 'FAILED'). - **message** (string) - A confirmation message. #### Response Example ```json { "status": "PENDING", "message": "Pix transfer initiated successfully." } ``` ``` -------------------------------- ### 503 Service Unavailable Error Response Source: https://dev.efipay.com.br/docs/pix-indireto/diretorio Indicates that the service is temporarily unavailable, often due to scheduled maintenance. Check for maintenance announcements. ```json { "responseTime": 0, "correlationId": "abcdef01-2345-6789-0123-456789012345", "error": { "detail": "Service is under scheduled maintenance", "status": 503, "title": "Service Unavailable", "type": "https://dict.pi.rsfn.net.br/api/v2/error/ServiceUnavailable" } } ``` -------------------------------- ### Check Script Blocking Status Source: https://dev.efipay.com.br/docs/api-cobrancas/cartao Use this function to verify if the EfiPay fingerprint script is blocked by browser extensions or configurations. It's recommended to run this on checkout page load to ensure transaction security. ```javascript async function checkScriptBlocking() { const isBlocked = await EfiPay.CreditCard.isScriptBlocked(); if (isBlocked) { console.log("O script está bloqueado!"); } else { console.log("O script não está bloqueado."); } } ``` -------------------------------- ### Rate Limited Error Response (429) Source: https://dev.efipay.com.br/docs/pix-indireto/diretorio This response indicates that the client has sent too many requests in a given amount of time. Implement rate limiting on your client to avoid this. ```json { "correlationId": "abcdef01-2345-6789-0123-456789012345", "error": { "status": 429, "title": "Rate limited", "type": "https://dict.pi.rsfn.net.br/api/v2/error/RateLimited" }, "responseTime": 0 } ``` -------------------------------- ### 500 Internal Server Error Response Source: https://dev.efipay.com.br/docs/pix-indireto/diretorio Signifies an unexpected condition encountered by the server. This is a generic server-side error. Contact support if persistent. ```json { "responseTime": 0, "correlationId": "abcdef01-2345-6789-0123-456789012345", "error": { "detail": "Our service is currently experiencing an issue. We apologize for the inconvenience and are working to resolve it as soon as possible.", "status": 500, "title": "Internal Server Error" } } ``` -------------------------------- ### Update Carnet Metadata (Notification URL, Custom ID) Source: https://dev.efipay.com.br/docs/api-cobrancas/carne Use this endpoint to update the `notification_url` and `custom_id` for existing carnet transactions. This is essential if your notification server IP changes or if you initially omitted the notification URL. ```json { "notification_url": "htttp://www.meusite.com.br/notificacoes/", "custom_id": "258789877" } ``` ```json { "code": 200 } ``` -------------------------------- ### 504 Timeout Error Response Source: https://dev.efipay.com.br/docs/pix-indireto/diretorio Occurs when the server did not receive a timely response from an upstream server. This may indicate network issues or server load. ```json { "correlationId": "abcdef01-2345-6789-0123-456789012345", "error": { "detail": "Service took to ong to respond", "status": 504, "title": "Timeout Error" }, "responseTime": 0 } ``` -------------------------------- ### Check Sent Pix Status Source: https://dev.efipay.com.br/docs/api-pix/envio-pagamento-pix Consult this endpoint to verify the status of an original Pix send if a webhook notification is not received within the expected time. ```APIDOC ## GET /v2/gn/pix/enviados/id-envio/:idEnvio ### Description Retrieves the status of a previously sent Pix transfer using its unique `idEnvio`. ### Method GET ### Endpoint /v2/gn/pix/enviados/id-envio/:idEnvio ### Parameters #### Path Parameters - **idEnvio** (string) - Required - The unique identifier for the Pix transfer. ### Response #### Success Response (200) - **status** (string) - The current status of the Pix transfer (e.g., 'COMPLETED', 'FAILED', 'PENDING'). - **details** (object) - Additional details about the transaction. #### Response Example ```json { "status": "COMPLETED", "details": { "transactionId": "tx12345", "amount": 10.50, "timestamp": "2024-07-26T10:00:00Z" } } ``` ``` -------------------------------- ### Update Carnet Metadata Source: https://dev.efipay.com.br/docs/api-cobrancas/carne Allows updating the notification_url and custom_id for existing carnet transactions. This is crucial for scenarios where notification endpoints change or initial creation lacked this information. ```APIDOC ## Update Carnet Metadata ### Description Allows updating the `notification_url` and `custom_id` for existing carnet transactions. This is crucial for scenarios where notification endpoints change or initial creation lacked this information. ### Method PUT ### Endpoint `/v1/carnet/:id/metadata` ### Request Body - **notification_url** (string) - Optional - The new URL to receive transaction notifications. - **custom_id** (string) - Optional - The new custom identifier for the transaction. ### Request Example ```json { "notification_url": "htttp://www.meusite.com.br/notificacoes/", "custom_id": "258789877" } ``` ### Response #### Success Response (200) - **code** (integer) - HTTP status code indicating success. #### Response Example ```json { "code": 200 } ``` ``` -------------------------------- ### Update Specific Parcel Due Date Source: https://dev.efipay.com.br/docs/api-cobrancas/carne Modify the due date (`expire_at`) for a specific parcel of a carnet. Only 'waiting' or 'unpaid' parcels can be updated. Ensure the new date is in 'YYYY-MM-DD' format and is after the current date. ```json { "expire_at": "2023-12-30" } ``` ```json { "code": 200 } ``` -------------------------------- ### Update Parcel Due Date Source: https://dev.efipay.com.br/docs/api-cobrancas/carne Enables modification of the due date for a specific parcel within a carnet. Only parcels with 'waiting' or 'unpaid' status can be updated. The new due date must be after the current date. ```APIDOC ## Update Parcel Due Date ### Description Enables modification of the due date for a specific parcel within a carnet. Only parcels with 'waiting' or 'unpaid' status can be updated. The new due date must be after the current date. ### Method PUT ### Endpoint `/v1/carnet/:id/parcel/:parcel` ### Parameters #### Path Parameters - **id** (string) - Required - The identifier of the carnet. - **parcel** (integer) - Required - The number of the parcel to update (e.g., 3 for the third parcel). ### Request Body - **expire_at** (string) - Required - The new due date for the parcel in 'YYYY-MM-DD' format. ### Request Example ```json { "expire_at": "2023-12-30" } ``` ### Response #### Success Response (200) - **code** (integer) - HTTP status code indicating success. #### Response Example ```json { "code": 200 } ``` ``` -------------------------------- ### Identify Credit Card Brand Source: https://dev.efipay.com.br/docs/api-cobrancas/cartao This function identifies the credit card brand (e.g., Visa, Mastercard) based on the provided card number. It handles potential errors during the verification process. ```javascript async function identifyBrand() { try { const brand = await EfiPay.CreditCard .setCardNumber("4485785674290087") .verifyCardBrand(); console.log("Bandeira: ", brand); } catch (error) { console.log("Código: ", error.code); console.log("Nome: ", error.error); console.log("Mensagem: ", error.error_description); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.