Skip to main content
Version: Unstable

External Invoice

An External Invoice (also known as a third-party invoice / nota fiscal terceira) represents a fiscal invoice (e.g. an NF-e in Brazil) that was issued by an external system — such as an ERP or a third-party invoicing provider — and is associated with an Order and one of its Fulfillment Orders.

Use this resource to register, update, list, read and remove invoices that were not generated by Nuvemshop but need to be linked to an order.

Unstable version only

This resource is available only in the unstable API version.

Each External Invoice is identified by its key — the NF-e access key, a 44-character string.

Scopes

PropertyExplanation
read_ordersAllows you to read one or more external invoices of an order for a merchant.
write_ordersAllows you to create, update and delete external invoices of an order for a merchant. Imported orders are rejected.

Properties

ExternalInvoice

Fields with a null value are omitted from the response.

Field NameField TypeDescription
keyStringThe NF-e access key (44 characters). Uniquely identifies the invoice.
seriesStringThe invoice series.
numberStringThe invoice number.
statusStringThe invoice status. One of Authorized, AuthorizedInContingency, Cancelled, Denied.
subtypeStringThe invoice subtype. One of sale, return.
store_idStringThe store identifier.
order_idStringThe order identifier.
fulfillment_order_idStringThe fulfillment order identifier the invoice is associated with.
pdf_urlStringURL to the invoice PDF (DANFE). Optional. Omitted when unavailable.
xml_urlStringURL to the invoice XML (NF-e). Optional. Omitted when unavailable.
emission_dateDateTimeDate when the invoice was emitted, in ISO 8601 format. Optional. Omitted when unavailable.
total_valueDecimalThe total value of the invoice. Optional. Omitted when unavailable.
referenced_keyStringThe access key (44 characters) of the original invoice a return refers to. Present for returns; otherwise omitted.
cancellation_dateDateTimeDate when the invoice was cancelled, in ISO 8601 format. Optional. Omitted when unavailable.
created_atDateTimeDate when the invoice was created, in ISO 8601 format.
updated_atDateTimeDate when the invoice was last updated, in ISO 8601 format.

Allowed values

FieldAllowed values
subtypesale, return
statusAuthorized, AuthorizedInContingency, Cancelled, Denied

Input Request Properties

ExternalInvoiceCreateInput

Used by POST /orders/\{order_id\}/invoices/external.

Field NameField TypeMandatoryDescription
fulfillment_order_idStringThe fulfillment order the invoice is associated with.
subtypeStringThe invoice subtype. One of sale, return.
statusStringThe invoice status. On create, only Authorized or Denied are accepted.
keyStringThe NF-e access key. Must be exactly 44 characters.
seriesStringThe invoice series.
numberStringThe invoice number.
pdf_urlString✅*URL to the invoice PDF (DANFE). Required unless status is Denied.
xml_urlStringURL to the invoice XML (NF-e).
emission_dateDateTimeDate when the invoice was emitted, in ISO 8601 format. Eg.: 2026-04-04T14:30:00.
total_valueDecimalThe total value of the invoice.
referenced_keyString✅*The access key (44 characters) of the original invoice. Required when subtype is return.

* Conditionally required — see the description column.

ExternalInvoiceUpdateInput

Used by PUT /orders/\{order_id\}/invoices/external/\{key\}. All fields are optional; only the fields present in the request are applied.

Field NameField TypeMandatoryDescription
statusStringThe invoice status. One of Authorized, AuthorizedInContingency, Cancelled, Denied.
pdf_urlStringURL to the invoice PDF (DANFE).
xml_urlStringURL to the invoice XML (NF-e).
cancellation_dateDateTimeDate when the invoice was cancelled, in ISO 8601 format. Eg.: 2026-04-22T10:00:00.

Error

When a request fails, the API returns an error payload with the following shape:

Field NameField TypeDescription
timestampStringWhen the error occurred. Eg.: 2026-04-04 14:30:00.
statusIntegerThe HTTP status code.
messageString[]A list of human-readable error messages.
pathStringThe request URI that produced the error.
error_codeStringA machine-readable error code. Present only when applicable.
{
"timestamp": "2026-04-04 14:30:00",
"status": 400,
"message": [
"key: size must be between 44 and 44"
],
"path": "/orders/123456/invoices/external"
}

The error_code field is included only for specific errors; validation errors like the example above do not set it.

Endpoints

POST /orders/{order_id}/invoices/external

Create an external invoice for an order.

URL values

Field nameField TypeMandatoryDescription
store_idStringStore identifier
order_idStringOrder identifier

Headers

HeaderField TypeMandatoryDescription
AuthorizationStringBearer App token. Eg.: Bearer {app_token}
Content-typeStringThe request content-type "application/json"

Notes

  • Parameters are sent in body, JSON format.
  • Payload type: ExternalInvoiceCreateInput.
  • The invoice is processed asynchronously, so a successful request returns 202 Accepted with no body. Because of this, the invoice may take a short moment to become available on the GET endpoints.
  • On create, status accepts only Authorized or Denied.
  • pdf_url is required unless status is Denied.
  • When subtype is return, referenced_key is required and must reference the original invoice access key.
  • If an invoice with the same key already exists for the store, the request is accepted and the duplicate is ignored.

Request Payload

TypeDescription
ExternalInvoiceCreateInputThe external invoice to be created.
{
"fulfillment_order_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"subtype": "sale",
"status": "Authorized",
"key": "35240412345678000190550010000000011000000017",
"series": "1",
"number": "1",
"pdf_url": "https://example.com/invoices/danfe.pdf",
"xml_url": "https://example.com/invoices/nfe.xml",
"emission_date": "2026-04-04T14:30:00",
"total_value": 149.90
}

Responses

HTTP 202 - Accepted

The invoice was accepted for processing. The response has no body.

HTTP 400 - Bad Request
TypeDescription
ErrorThe request payload is invalid.
HTTP 401 - Unauthorized
TypeDescription
ErrorThe Unauthorized Response

PUT /orders/{order_id}/invoices/external/{key}

Update an existing external invoice. Only the fields present in the request are applied.

URL values

Field nameField TypeMandatoryDescription
store_idStringStore identifier
order_idStringOrder identifier
keyStringThe NF-e access key (44 characters)

Headers

HeaderField TypeMandatoryDescription
AuthorizationStringBearer App token. Eg.: Bearer {app_token}
Content-typeStringThe request content-type "application/json"

Notes

  • Parameters are sent in body, JSON format.
  • Payload type: ExternalInvoiceUpdateInput.
  • Only the fields provided in the request are updated.

Request Payload

TypeDescription
ExternalInvoiceUpdateInputThe external invoice fields to update.
{
"status": "Cancelled",
"cancellation_date": "2026-04-22T10:00:00"
}

Responses

HTTP 200 - Ok
TypeDescription
ExternalInvoiceThe updated external invoice.
PUT /orders/123456/invoices/external/35240412345678000190550010000000011000000017
{
"key": "35240412345678000190550010000000011000000017",
"series": "1",
"number": "1",
"status": "Cancelled",
"subtype": "sale",
"store_id": "123456",
"order_id": "123456",
"fulfillment_order_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"pdf_url": "https://example.com/invoices/danfe.pdf",
"xml_url": "https://example.com/invoices/nfe.xml",
"emission_date": "2026-04-04T14:30:00",
"total_value": 149.90,
"cancellation_date": "2026-04-22T10:00:00",
"created_at": "2026-04-04T14:31:00",
"updated_at": "2026-04-22T10:00:05"
}
HTTP 400 - Bad Request
TypeDescription
ErrorThe request payload is invalid.
HTTP 401 - Unauthorized
TypeDescription
ErrorThe Unauthorized Response
HTTP 404 - Not Found

The external invoice was not found for the given order and key. The response has no body.

GET /orders/{order_id}/invoices/external

Retrieve all external invoices from a specific order. Results are sorted by created_at in descending order.

URL values

Field nameField TypeMandatoryDescription
store_idStringStore identifier
order_idStringOrder identifier

Headers

HeaderField TypeMandatoryDescription
AuthorizationStringBearer App token. Eg.: Bearer {app_token}
Content-typeStringThe request content-type "application/json"

Parameters

ParameterExplanation
pagePage number to retrieve. Default: 1.
per_pageNumber of results per page. Default: 20. Allowed range: 150.
fulfillment_order_idOptional. Filters invoices by the given fulfillment order identifier.

Notes

  • The X-Total-Count response header contains the total number of external invoices for the order.

Responses

HTTP 200 - Ok
TypeDescription
ExternalInvoice[]The list of external invoices.
GET /orders/123456/invoices/external
[
{
"key": "35240412345678000190550010000000011000000017",
"series": "1",
"number": "1",
"status": "Authorized",
"subtype": "sale",
"store_id": "123456",
"order_id": "123456",
"fulfillment_order_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"pdf_url": "https://example.com/invoices/danfe.pdf",
"xml_url": "https://example.com/invoices/nfe.xml",
"emission_date": "2026-04-04T14:30:00",
"total_value": 149.90,
"created_at": "2026-04-04T14:31:00",
"updated_at": "2026-04-04T14:31:00"
}
]
HTTP 401 - Unauthorized
TypeDescription
ErrorThe Unauthorized Response

GET /orders/{order_id}/invoices/external/{key}

Retrieve a single external invoice by its access key.

URL values

Field nameField TypeMandatoryDescription
store_idStringStore identifier
order_idStringOrder identifier
keyStringThe NF-e access key (44 characters)

Headers

HeaderField TypeMandatoryDescription
AuthorizationStringBearer App token. Eg.: Bearer {app_token}
Content-typeStringThe request content-type "application/json"

Responses

HTTP 200 - Ok
TypeDescription
ExternalInvoiceThe external invoice.
GET /orders/123456/invoices/external/35240412345678000190550010000000011000000017
{
"key": "35240412345678000190550010000000011000000017",
"series": "1",
"number": "1",
"status": "Authorized",
"subtype": "sale",
"store_id": "123456",
"order_id": "123456",
"fulfillment_order_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"pdf_url": "https://example.com/invoices/danfe.pdf",
"xml_url": "https://example.com/invoices/nfe.xml",
"emission_date": "2026-04-04T14:30:00",
"total_value": 149.90,
"created_at": "2026-04-04T14:31:00",
"updated_at": "2026-04-04T14:31:00"
}
HTTP 401 - Unauthorized
TypeDescription
ErrorThe Unauthorized Response
HTTP 404 - Not Found

The external invoice was not found for the given order and key. The response has no body.

DELETE /orders/{order_id}/invoices/external/{key}

Remove an external invoice by its access key.

URL values

Field nameField TypeMandatoryDescription
store_idStringStore identifier
order_idStringOrder identifier
keyStringThe NF-e access key (44 characters)

Headers

HeaderField TypeMandatoryDescription
AuthorizationStringBearer App token. Eg.: Bearer {app_token}
Content-typeStringThe request content-type "application/json"

Responses

HTTP 200 - Ok

The external invoice was removed. The response has no body.

HTTP 401 - Unauthorized
TypeDescription
ErrorThe Unauthorized Response
HTTP 404 - Not Found

The external invoice was not found for the given order and key. The response has no body.