Update invoice

Information

To update the invoice data it is not necessary to send all the fields, just the fields you want to update.

Example Request

{
    "status": "invoiced",
    "shipments": [
        {
            "nfe_key": "414444444444444444444444444444",
            "nfe_link": "https://linkexemplo.com.br/xml/1112.xml",
            "nfe_number": "12",
            "nfe_serie": "1",
            "nfe_date": "2024-07-15T18:07:07.000Z",
            "cfops": "String com todos CFOPs do pedido separados por vírgula"
        }
    ]
}

Attention

The order may have the delivery "id" already registered, in these cases you must send the id returned in shipments.

Example Request

{
    "status": "invoiced",
    "shipments": [
        {
            "id": "606b87e9e7cb7f1d4d5f8d33",
            "nfe_key": "41444444444444444444444444444",
            "nfe_link": "https://linkexemplo.com.br/xml/1112.xml",
            "nfe_number": "12",
            "nfe_serie": "1",
            "nfe_date": "2024-07-15T18:07:07.000Z",
            "cfops": "6602"
        }
    ]
}

Update invoice by item

Used for orders with multiple deliveries, separated by item. Currently used only in the Dafiti marketplace. Not visible on the front-end.

The fields added are "status" and "shipping_items".

{
    "status": "invoiced",
    "shipments": [
        {
            "id": "66982820b62919e36f501c42",
            "nfe_key": "41444444444444444444444444444",
            "nfe_link": "https://linkexemplo.com.br/xml/1112.xml",
            "nfe_number": "12",
            "nfe_serie": "1",
            "nfe_date": "2024-07-15T18:07:07.000Z",
            "cfops": "6602",
            "status": "invoiced",
            "shipping_items": [ 
                {
                    "sku": "1776924",
                    "quantity": 1
                },
                {
                    "sku": "59657651",
                    "quantity": 1
                }
            ]
        },
        {
            "id":"669832655009d8e4d191b6fc",
            "nfe_key": "55555555555555555555555555555555",
            "nfe_link": "https://linkexemplo.com.br/xml/1115.xml",
            "nfe_number": "13",
            "nfe_serie": "1",
            "nfe_date": "2024-07-15T18:07:07.000Z",
            "cfops": "6602",
            "status": "invoiced",
            "shipping_items": [ 
                {
                    "sku": "1269821",
                    "quantity": 1
                }
            ]
        }
    ]
}

Reason for update failure

When you return the error:

{
    "error": true,
    "type": "not_updated",
    "message": "An error occurred, see details for more information.",
    "details": "Changes not found in the order"
}

It means that the order is already updated in the API Plugg.to, and it is not possible to send the same status.

Request object has the following properties:

FieldTypeDescription
statusstringinform order status
idstringorder delivery id
nfe_keystringinvoice key (send numbers only)
nfe_linkstringdirect link to the invoice XML, no redirection allowed
nfe_numberstringinvoice number
nfe_seriestringinvoice series
nfe_datestringinvoice date (date in UTC format)
Language
Click Try It! to start a request and see the response here!