Sudrel API
Dashboard Create API key

Documentation › Tools

Guides

OpenAPI and Postman

The OpenAPI specification in JSON and YAML, and how to import it into Postman or Insomnia.

The OpenAPI specification

This documentation is generated from an OpenAPI 3.0 specification, which is the source of truth for routes, fields and errors:

Format URL
JSON https://sudrel.com.br/docs/openapi.json
YAML https://sudrel.com.br/docs/openapi.yaml
JSON in Spanish https://sudrel.com.br/docs/es/openapi.json
JSON in English https://sudrel.com.br/docs/en/openapi.json

In the Spanish and English versions only the explanations change: routes, fields and codes are the same.

Use the specification to generate a client in your language (for example with OpenAPI Generator), to import into a testing tool or to give context to an AI assistant.

Postman and Insomnia

  1. In Postman, Import and paste https://sudrel.com.br/docs/openapi.json. In Insomnia, Import with the same URL.
  2. The collection comes with every route and with the base URL https://api.sudrel.com.br/api in a collection variable. To group the routes by the sections of this documentation, choose to organize by tags on import.
  3. In the collection's authentication, choose Bearer Token and paste your key. Start with a test key (sdr_test_): with it, issuance goes to the Sistema Nacional test environment, with no fiscal value.
  4. Keep the key in an environment variable of the tool, never in the collection you share.

Ready-made NF-e collection

For the first NF-e, there is a Postman collection with the NF-e quick start sequence in order, with bodies already filled in: readiness, product, profile and approvals, preview (optional), issuance in calcular and informado modes, query, DANFE, XML and cancellation.

Collection URL
NF-e, first invoice https://sudrel.com.br/docs/postman/sudrel-nfe.postman_collection.json

In Postman, Import with the URL. Then fill in the collection variables: chave_api (the sdr_test_ key), empresa_id (from GET /v1/companies) and, if you like, destinatario_cnpj (a CNPJ that exists at the Receita Federal; it comes with SEFAZ-BA's). For each new invoice, change referencia and idempotency_key; to repeat the SAME invoice, keep both. The bodies come from the examples in this documentation, generated on every publication, so they do not fall behind.

Try it right here

In the API reference, each route has the test on its own page, in the right-hand column: fill in the key under Auth once and it applies to every route, stored in your browser. The test calls the real API: with a production key, an issuance counts as a real invoice. To test issuance, use the test key.