We use cookies to improve your experience and analyze site traffic. By clicking “Accept”, you agree to our use of cookies.

Learn more about our privacy practices
Corvo
English

SDKs

Bibliotecas oficiais para Node.js, Python, Go, PHP, Ruby, Rust, Java, Elixir e .NET.

A Corvo tem SDKs oficiais em nove linguagens. Eles chamam a mesma API descrita nesta documentação, com as mesmas operações, nomes de campo e regras fiscais, então todos os guias daqui valem para todos eles.

Instalação

LinguagemPacoteInstalaçãoCódigo
Node.js / TypeScriptcorvo-nfse-node (npm)npm install corvo-nfse-nodecorvo-technology/corvo-nfse-node
Pythoncorvo-nfse (PyPI)pip install corvo-nfsecorvo-technology/corvo-nfse-python
Gogithub.com/corvo-technology/corvo-nfse-go (Go modules)go get github.com/corvo-technology/corvo-nfse-gocorvo-technology/corvo-nfse-go
PHPcorvo-technology/corvo-nfse (Packagist)composer require corvo-technology/corvo-nfsecorvo-technology/corvo-nfse-php
Rubycorvo-nfse (RubyGems)gem install corvo-nfsecorvo-technology/corvo-nfse-ruby
Rustcorvo-nfse (crates.io)cargo add corvo-nfsecorvo-technology/corvo-nfse-rust
Javatech.corvo:corvo-nfse (Maven Central)implementation("tech.corvo:corvo-nfse:0.1.1")corvo-technology/corvo-nfse-java
Elixircorvo_nfse (Hex){:corvo_nfse, "~> 0.1.1"}corvo-technology/corvo-nfse-elixir
.NETCorvo.Nfse (NuGet)dotnet add package Corvo.Nfsecorvo-technology/corvo-nfse-dotnet

O que todo SDK faz

  • Autentica com X-API-Key. Lê CORVO_API_KEY, e CORVO_BASE_URL se você usar outra URL da API.
  • A chave decide o ambiente: corvo_test_... para teste e corvo_live_... para produção.
  • Os erros voltam como um resultado tipado com code, status, requestId, details e retryAfter, não como exceção. Os helpers de iteração lançam erro quando uma página falha.
  • As listas usam paginação por cursor, e todo SDK tem um helper de iteração que percorre todas as páginas.
  • Emitir uma nota e enviar um email aceitam chave de idempotência, enviada como Idempotency-Key.
  • Verificação da assinatura do webhook (X-Corvo-Signature) em tempo constante.

Emitir uma nota

A mesma chamada em cada linguagem. Cada exemplo lê a chave de CORVO_API_KEY e passa uma chave de idempotência, então repetir a chamada nunca emite a nota duas vezes.

Node.js / TypeScript

import { Corvo } from "corvo-nfse-node";

const corvo = new Corvo(); // reads CORVO_API_KEY

const { data: invoice, error } = await corvo.invoices.create(
  {
    companyTaxId: "11222333000181",
    service: { description: "Consultoria" },
    amount: 450,
    competenceDate: "2026-10-16",
  },
  { idempotencyKey: "order-42" },
);

Python

from corvo_nfse import Corvo

async with Corvo() as corvo:  # reads CORVO_API_KEY
    invoice, error = await corvo.invoices.create(
        {
            "companyTaxId": "11222333000181",
            "service": {"description": "Consultoria"},
            "amount": 450,
            "competenceDate": "2026-10-16",
        },
        idempotency_key="order-42",
    )

Go

client := corvonfse.NewClient(corvonfse.Options{}) // reads CORVO_API_KEY

invoice, err := client.Invoices.Create(ctx, corvonfse.InvoiceCreateParams{
	CompanyTaxID:   "11222333000181",
	Service:        corvonfse.InvoiceServiceInput{Description: "Consultoria"},
	Amount:         450,
	CompetenceDate: "2026-10-16",
}, "order-42")

PHP

$corvo = new \CorvoNfse\Client(); // reads CORVO_API_KEY

$result = $corvo->invoices->create([
    'companyTaxId' => '11222333000181',
    'service' => ['description' => 'Consultoria'],
    'amount' => 450,
    'competenceDate' => '2026-10-16',
], idempotencyKey: 'order-42');

Ruby

client = CorvoNfse::Client.new # reads CORVO_API_KEY

invoice, error = client.invoices.create(
  {
    companyTaxId: "11222333000181",
    service: { description: "Consultoria" },
    amount: 450,
    competenceDate: "2026-10-16"
  },
  idempotency_key: "order-42"
)

Rust

let corvo = Corvo::from_env()?; // reads CORVO_API_KEY

let invoice = corvo
    .invoices()
    .create(
        &InvoiceCreateParams {
            company_tax_id: Some("11222333000181".into()),
            service: InvoiceServiceInput {
                description: Some("Consultoria".into()),
                ..Default::default()
            },
            amount: 450.0,
            competence_date: "2026-10-16".into(),
            ..Default::default()
        },
        Some("order-42"),
    )
    .await?;

Java

Corvo corvo = Corvo.builder().build(); // reads CORVO_API_KEY

InvoiceCreateParams params = InvoiceCreateParams.of(
        null,
        InvoiceCreateParams.Service.ofDescription("Consultoria"),
        450.0,
        "2026-10-16")
    .withCompanyTaxId("11222333000181");

Result<Invoice> invoice = corvo.invoices().create(params, "order-42").join();

Elixir

client = CorvoNfse.new() # reads CORVO_API_KEY

{:ok, invoice} =
  CorvoNfse.Resources.Invoices.create(
    client,
    %{
      "companyTaxId" => "11222333000181",
      "service" => %{"description" => "Consultoria"},
      "amount" => 450,
      "competenceDate" => "2026-10-16"
    },
    idempotency_key: "order-42"
  )

.NET

using var client = new CorvoClient(); // reads CORVO_API_KEY

var invoice = await client.Invoices.CreateAsync(
    new InvoiceCreateParams
    {
        CompanyTaxId = "11222333000181",
        Service = new InvoiceServiceInput { Description = "Consultoria" },
        Amount = 450m,
        CompetenceDate = "2026-10-16",
    },
    idempotencyKey: "order-42");

A troca de plano e o portal de cobrança existem só no painel, por isso não estão nos SDKs. O código de cada SDK está em github.com/corvo-technology.