Invoices (NF-e)
The tax document behind an invoice: issue, cancel, download PDF and XML, and follow every attempt at the city hall. Barueri has commands of its own.
| Command | HTTP | Description |
|---|---|---|
nfes list | GET /v1/nfes | List NF-es |
nfes create | POST /v1/nfes | Create an NF-e (draft) |
nfes get | GET /v1/nfes/{id} | Get an NF-e |
nfes update | PATCH /v1/nfes/{id} | Update an NF-e (draft) |
nfes delete | DELETE /v1/nfes/{id} | Delete an NF-e |
nfes cancel | POST /v1/nfes/{id}/cancel | Cancel an NF-e |
nfes issue | POST /v1/nfes/{id}/issue | Issue an NF-e |
nfes pdf | GET /v1/nfes/{id}/pdf | Download the NF-e PDF |
nfes retry-cancel | POST /v1/nfes/{id}/retry-cancel | Retry the NF-e cancellation |
nfes validate-barueri | POST /v1/nfes/{id}/validate-barueri | Validate a Barueri NFS-e |
nfes xml | GET /v1/nfes/{id}/xml | Download the NF-e XML |
nfes bulk create | POST /v1/nfes/bulk | Update NF-es in bulk |
nfes bulk-delete create | POST /v1/nfes/bulk-delete | Delete NF-es in bulk |
nfes fetch-barueri create | POST /v1/nfes/fetch-barueri | Fetch an NFS-e from Barueri |
nfes fetch-from-sefaz create | POST /v1/nfes/fetch-from-sefaz | Fetch an NFS-e from the ADN (SEFAZ) |
nfes import-barueri create | POST /v1/nfes/import-barueri | Import a Barueri NFS-e |
nfes request-tries list | GET /v1/nfes/request-tries | List request attempts (organization) |
nfes request-tries get | GET /v1/nfes/{id}/request-tries | List the NF-e's request attempts |
nfes requests get | GET /v1/nfes/{id}/requests/{requestId} | Get an external request |
nfes sync create | POST /v1/nfes/sync | Sync the organization's NF-es |
Examples
--params carries query and path parameters (id, page, filters); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.
# List NF-es
kobana billing nfes list \
--fields "id,public_id,external_id,invoice_id,transaction_id"
# Get an NF-e
kobana billing nfes get --params '{"id": "NFE_ID"}'
# Create an NF-e (draft)
kobana billing nfes create \
--json '{"billing_account_id": "BILLING_ACCOUNT_ID", "amount_cents": 100, "customer": {}}'
# Update an NF-e (draft)
kobana billing nfes update \
--params '{"id": "NFE_ID"}' \
--json '{"external_id": "EXTERNAL_ID", "service_code": "SERVICE_CODE", "service_description": "SERVICE_DESCRIPTION"}'
# Cancel an NF-e
kobana billing nfes cancel \
--params '{"id": "NFE_ID"}' \
--json '{"reason": "REASON"}'
# Delete an NF-e
kobana billing nfes delete --params '{"id": "NFE_ID"}' --dry-run
Next steps
- Tax rules
- Schema introspection — every parameter this resource accepts.