Skip to main content
PUT
/
invoices
/
{id}
Update an invoice (header-only)
curl --request PUT \
  --url https://api.contazen.ro/v1/invoices/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "date_at": "<string>",
  "due_at": "<string>",
  "info": "<string>",
  "client_id": "<string>",
  "currency": "<string>",
  "exchange_rate": 123,
  "series_id": "<string>",
  "items": [
    {
      "description": "<string>",
      "quantity": 123,
      "price": 123,
      "id": 123,
      "product_id": "<string>",
      "description_extended": "<string>",
      "vat_rate": 19,
      "vat_key": 123,
      "unit": "buc",
      "ubl_um": "H87",
      "ubl_nc": "<string>",
      "ubl_cpv": "<string>",
      "subtotal": 123,
      "vat_amount": 123,
      "total": 123,
      "save_as_product": true
    }
  ]
}
'
{
  "success": true,
  "data": {
    "id": "inv_1a2b3c4d5e",
    "object": "invoice",
    "number": "<string>",
    "series": "<string>",
    "date": "2023-12-25",
    "total": 123,
    "full_number": "<string>",
    "due_date": "2023-12-25",
    "client_id": "<string>",
    "client": {
      "id": "cli_1a2b3c4d5e",
      "object": "client",
      "name": "<string>",
      "email": "jsmith@example.com",
      "phone": "<string>",
      "cui": "<string>",
      "cui_prefix": "<string>",
      "rc": "<string>",
      "client_type": "b2b",
      "address": "<string>",
      "city": "<string>",
      "county": "<string>",
      "country": "<string>",
      "postal_code": "<string>",
      "iban": "<string>",
      "bank": "<string>",
      "contact_person": "<string>",
      "created_at": 123,
      "updated_at": 123,
      "metadata": {
        "invoices_count": 123,
        "total_invoiced": 123,
        "unpaid_total": 123
      },
      "stats": {
        "total_invoiced": 123,
        "total_collected": 123,
        "avg_payment_days": 123,
        "last_payment": {
          "date": 123,
          "amount": 123,
          "currency": "<string>",
          "bill_id": "<string>",
          "bill_number": "<string>"
        },
        "monthly_series": [
          {
            "label": "Mar 2026",
            "year": 123,
            "month": 123,
            "invoiced": 123,
            "collected": 123
          }
        ]
      }
    },
    "currency": "RON",
    "exchange_rate": 123,
    "subtotal": 123,
    "vat_amount": 123,
    "subtotal_ron": 123,
    "vat_amount_ron": 123,
    "total_ron": 123,
    "items": [
      {
        "description": "<string>",
        "quantity": 123,
        "price": 123,
        "id": 123,
        "product_id": "<string>",
        "description_extended": "<string>",
        "vat_rate": 19,
        "vat_key": 123,
        "unit": "buc",
        "ubl_um": "H87",
        "ubl_nc": "<string>",
        "ubl_cpv": "<string>",
        "subtotal": 123,
        "vat_amount": 123,
        "total": 123,
        "save_as_product": true
      }
    ],
    "payments": [
      {
        "id": "<string>",
        "object": "payment",
        "amount": 123,
        "currency": "<string>",
        "date": "2023-12-25",
        "type": "receipt",
        "type_description": "<string>",
        "reference": "<string>",
        "invoice": {
          "id": "<string>",
          "number": "<string>",
          "total": 123,
          "currency": "<string>"
        },
        "client": {
          "id": "<string>",
          "name": "<string>"
        },
        "created_at": 123
      }
    ],
    "is_paid": true,
    "paid_at": "2023-12-25",
    "is_void": true,
    "voided_at": "2023-11-07T05:31:56Z",
    "void_reason": "<string>",
    "is_draft": true,
    "is_storno": true,
    "storno_for": "<string>",
    "document_type": "fiscal",
    "payment_method": "<string>",
    "notes": "<string>",
    "observations": "<string>",
    "efactura_enabled": true,
    "efactura_status": "pending",
    "efactura_submission_id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z"
  },
  "meta": {
    "version": "v1",
    "request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "response_time": "23.45ms"
  }
}

Overview

The update endpoint intentionally has a narrow scope: it accepts only header fields plus an optional full-item rewrite. It does not support spot-editing a single line — send the whole items array if you need to change one row. If you need a structural change to a fiscal invoice (different client, wholesale repricing, etc.), issue POST /invoices/{id}/storno followed by a fresh POST /invoices rather than mutating the original.

Legacy field aliases

Several request fields have aliases that remain accepted for backwards compatibility. New integrations should prefer the canonical names:
CanonicalLegacy aliases
infoobservation, notes
date_atdate
due_atdue_date

Row-level totals are derived, not accepted

Row objects inside items[] must not carry price_total or account_amount_total — send the components (quantity, price, vat_rate) and the server recomputes both. Sending totals directly used to work in earlier builds and has been a silent source of rounding drift; the fields are now ignored.

Exchange-rate handling

When currency is RON, currency_rate is forced to 1.000 regardless of what you send. For non-RON invoices, a positive exchange_rate propagates into every account_amount_* field on both the invoice header and its rows — so the RON-equivalent totals stay consistent with the foreign-currency totals shown on the PDF.

Edit locks

Four conditions block an edit:
  • 400 invoice_is_storno — the row is itself a reversal.
  • 400 invoice_already_storned — the row has been reversed.
  • 400 invoice_is_paid — paid invoice cannot have totals changed (non-total fields like info and due_at still work).
  • 403 invoice_locked_efactura — ANAF has accepted or validated the invoice via SPV. The error payload includes efactura_status.
PUT and PATCH are interchangeable — both route to the same handler.

Authorizations

Authorization
string
header
required

Use your API key (sk_live_xxx or sk_test_xxx)

Path Parameters

id
string
required

Invoice CzUid

Body

application/json
date_at
string

ISO date or unix timestamp. Alias - date.

due_at
string | null

ISO date or unix timestamp. Pass empty/null to clear. Alias - due_date.

info
string | null

Free-text notes shown on the PDF. Accepted aliases - observation, notes.

client_id
string

CzUid of an existing firm client; rebinds the invoice to that client's current snapshot.

currency
string

ISO-4217 code. Passing RON resets currency_rate to 1.

exchange_rate
number

Positive FX rate. Ignored for RON invoices. Overrides currency_rate and propagates to all account_amount_* fields.

series_id
string

CzUid (or numeric PK) of a firm_number series owned by the firm. Only used when actually switching series.

items
object[]

Replace the whole line-items array. Each row accepts description, quantity, price, vat_rate, unit, product_czuid, um_id etc. Row-level price_total and account_amount_total are not accepted — they are recomputed from the components.

Response

Invoice updated

success
boolean
data
object
meta
object