---
updatedAt: 2025-06-04T20:05:53.000Z
agentTools:
  projectIndex: https://developers.plugg.to/llms.txt
---

# 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

```json 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

```json 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".

```json Example Request
{
    "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:

```json Example Return
{
    "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:

| Field       | Type   | Description                                            |
| :---------- | :----- | :----------------------------------------------------- |
| status      | string | inform order status                                    |
| id          | string | order delivery id                                      |
| nfe\_key    | string | invoice key (send numbers only)                        |
| nfe\_link   | string | direct link to the invoice XML, no redirection allowed |
| nfe\_number | string | invoice number                                         |
| nfe\_serie  | string | invoice series                                         |
| nfe\_date   | string | invoice date (date in UTC format)                      |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-pluggto",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.plugg.to"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/orders/pluggto_order_id": {
      "put": {
        "summary": "Update invoice",
        "description": "",
        "operationId": "update-invoice",
        "parameters": [
          {
            "name": "pluggto_order_id",
            "in": "path",
            "description": "Order id",
            "schema": {
              "type": "string",
              "default": "Order id"
            },
            "required": true
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Bearer Token",
            "schema": {
              "type": "string",
              "default": "Bearer {ACCESS_TOKEN}"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```