Skip to main content

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.

CommandHTTPDescription
nfes listGET /v1/nfesList NF-es
nfes createPOST /v1/nfesCreate an NF-e (draft)
nfes getGET /v1/nfes/{id}Get an NF-e
nfes updatePATCH /v1/nfes/{id}Update an NF-e (draft)
nfes deleteDELETE /v1/nfes/{id}Delete an NF-e
nfes cancelPOST /v1/nfes/{id}/cancelCancel an NF-e
nfes issuePOST /v1/nfes/{id}/issueIssue an NF-e
nfes pdfGET /v1/nfes/{id}/pdfDownload the NF-e PDF
nfes retry-cancelPOST /v1/nfes/{id}/retry-cancelRetry the NF-e cancellation
nfes validate-barueriPOST /v1/nfes/{id}/validate-barueriValidate a Barueri NFS-e
nfes xmlGET /v1/nfes/{id}/xmlDownload the NF-e XML
nfes bulk createPOST /v1/nfes/bulkUpdate NF-es in bulk
nfes bulk-delete createPOST /v1/nfes/bulk-deleteDelete NF-es in bulk
nfes fetch-barueri createPOST /v1/nfes/fetch-barueriFetch an NFS-e from Barueri
nfes fetch-from-sefaz createPOST /v1/nfes/fetch-from-sefazFetch an NFS-e from the ADN (SEFAZ)
nfes import-barueri createPOST /v1/nfes/import-barueriImport a Barueri NFS-e
nfes request-tries listGET /v1/nfes/request-triesList request attempts (organization)
nfes request-tries getGET /v1/nfes/{id}/request-triesList the NF-e's request attempts
nfes requests getGET /v1/nfes/{id}/requests/{requestId}Get an external request
nfes sync createPOST /v1/nfes/syncSync 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​