Skip to content

Inter API JS is a library to help you to interact with Inter API

License

Notifications You must be signed in to change notification settings

maporto/inter-js

inter-js

Inter JS is a library to help you to interact with Inter API

npm version license downloads build codecov Known Vulnerabilities Responsible Disclosure Policy

About

Inter JS is a library to help you to interact with Inter API

Install

npm install --save inter-js

Usage

const sdk = require('inter-js')
const cert = 'your-cert';
const key = 'your-key';
const production = false;

const InterApi = sdk.init(cert, key, production)

Example

API

create Cobrança

  const cobranca = {
    seuNumero: '123',
    valorNominal: 2.5,
    dataVencimento: new Date(),
    numDiasAgenda: 0,
    pagador: {
      cpfCnpj: '12345678909',
      nome: 'Fulano de Tal',
      ddd: '11',
      telefone: '123456789',
      cep: '12345678',
      endereco: 'Rua Tal',
      numero: '123',
      complemento: '',
      bairro: 'Bairro Tal',
      cidade: 'São Paulo',
      uf: 'SP',
      tipoPessoa: 'FISICA'
    }
  }

  const response = await InterApi.cobranca.create(cobranca);

  console.log(response)

  // Output { codigoSolicitacao: '123' }

update/create webhook

  const webhook = {
    webhookUrl: 'https://example.com'
  }

  const response = await InterApi.cobranca.updateWebhook(webhook);

  console.log(response)
  // Output { webhookUrl: 'https://example.com'}

Contributing

Please consult CONTRIBUTING for guidelines on contributing to this project.

Author

inter-js © Marcos Porto, Released under the Apache-2.0 License.

About

Inter API JS is a library to help you to interact with Inter API

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published