Skip to Content
HelvetlyDocs
API referenceInvoices

Update a draft invoice

Needs a token with the write:invoices scope. Authentication

Try in Playground sends a real request to app.helvetly.com with a token you paste. It stays in this browser tab only (session storage) and goes to no one else.

PATCH
/api/v1/invoices/{id}

Changes a draft invoice; send only the fields that change (lines, when sent, replace all lines). Totals are recomputed. Only drafts can be edited: an issued invoice answers 409 invoice_locked (correct it with a credit note, or with correct_invoice), except that reminders_enabled alone may be changed on an issued one. A draft that is the source of an instalment plan answers 409 planned. 422 validation_failed with details.fields. Safe to retry: it sets fields to the values sent.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token, hvt_…, with scopes such as read:* or write:invoices

Path Parameters

id*string

The invoice's id.

Request Body

application/json
  1. body

Fields to change on a draft; send only what changes, omitted fields stay as they are. lines replaces all lines. A draft keeps its kind (not accepted here) and a credit note, debit note or correction keeps its client, currency and VAT mode (422). Unknown fields are refused (400).

client_id?string
issue_date?string

Default: today in the workspace's time zone.

Formatdate
due_date?string

Default: issue date plus the client's terms.

Formatdate
service_date?|
Formatdate
service_date_end?|
Formatdate
currency?string
language?string
Value in"de""fr""it""en"
vat_mode?string
Value in"exclusive""inclusive""none"
reference?|
Lengthlength <= 100
intro?|
Lengthlength <= 1000
footer?|
Lengthlength <= 1000
note?|
Lengthlength <= 1000
discount_percent?|

A decimal: a string such as "12.50" (exact) or a number.

payment_methods?
reminders_enabled?boolean
lines?array<>
Itemsitems <= 200

Response Body

OK

application/json
  1. response
data*
Example Request
curl -X PATCH 'https://app.helvetly.com/api/v1/invoices/string' \  -H 'Content-Type: application/json' \  -d '{  "due_date": "2026-12-15",  "reference": "PO-4711",  "lines": [    {      "description": "Consulting",      "quantity": "10",      "unit": "hour",      "unit_price": "150.00",      "vat_category": "S",      "vat_rate": "8.1"    }  ]}'
Example Response
{  "data": {    "id": "string",    "kind": "invoice",    "type_code": "string",    "number": "string",    "status": "draft",    "is_overdue": true,    "client_id": "string",    "client": {      "id": "string",      "number": 0,      "name": "string"    },    "quote": {      "id": "string",      "number": "string"    },    "credited_invoice": {      "id": "string",      "number": "string"    },    "issue_date": "2019-08-24",    "due_date": "2019-08-24",    "service_date": "2019-08-24",    "service_date_end": "2019-08-24",    "currency": "string",    "language": "string",    "vat_mode": "exclusive",    "reference": "string",    "tax_currency_rate": "string",    "intro": "string",    "footer": "string",    "note": "string",    "lines": [      {        "id": "string",        "position": 0,        "description": "string",        "quantity": "string",        "unit": "string",        "unit_price": "1234.50",        "discount_percent": "string",        "vat_category": "string",        "vat_rate": "string",        "amount": "1234.50",        "vat_exemption_code": "string",        "vat_exemption_reason": "string"      }    ],    "discount_percent": "string",    "subtotal": "1234.50",    "discount_amount": "1234.50",    "net_total": "1234.50",    "vat_breakdown": [      {        "category": "string",        "rate": "string",        "taxable_amount": "1234.50",        "vat_amount": "1234.50"      }    ],    "vat_total": "1234.50",    "total": "1234.50",    "rounding_amount": "1234.50",    "payable_total": "1234.50",    "prepaid_total": "1234.50",    "prepayments": [      {        "id": "string",        "number": "string",        "payable_total": "1234.50",        "status": "string",        "vat_breakdown": [          {            "category": "string",            "rate": "string",            "taxable_amount": "1234.50",            "vat_amount": "1234.50"          }        ]      }    ],    "deducted_on": {      "id": "string",      "number": "string"    },    "amount_paid": "1234.50",    "amount_credited": "1234.50",    "amount_due": "1234.50",    "amount_refunded": "1234.50",    "refund_due": "1234.50",    "payment_methods": {      "qr_bill": true,      "revolut": true    },    "payment": {      "iban": "string",      "reference_type": "string",      "reference": "string",      "qr_bill": true,      "revolut_url": "string"    },    "seller": {      "name": "string",      "street": "string",      "street_number": "string",      "apt": "string",      "zip": "string",      "city": "string",      "country": "string",      "vat_number": "string",      "email": "string",      "phone": "string",      "electronic_address": {        "scheme": "string",        "id": "string"      },      "registration_number": "string",      "region": "string"    },    "buyer": {      "name": "string",      "street": "string",      "street_number": "string",      "apt": "string",      "zip": "string",      "city": "string",      "country": "string",      "vat_number": "string",      "email": "string",      "phone": "string",      "electronic_address": {        "scheme": "string",        "id": "string"      },      "registration_number": "string",      "region": "string"    },    "payments": [      {        "id": "string",        "amount": "1234.50",        "paid_on": "2019-08-24",        "method": "bank_transfer",        "note": "string",        "created_at": "2019-08-24T14:15:22Z",        "created_by": {          "id": "string",          "name": "string"        }      }    ],    "refunds": [      {        "id": "string",        "amount": "1234.50",        "refunded_on": "2019-08-24",        "method": "string",        "note": "string",        "created_at": "2019-08-24T14:15:22Z",        "created_by": {          "id": "string",          "name": "string"        }      }    ],    "instalments": {      "interval": "string",      "items": [        {          "seq": 0,          "due_date": "2019-08-24",          "amount": "1234.50",          "effective": "1234.50",          "paid": "1234.50",          "open": "1234.50",          "status": "string",          "reference": "string"        }      ]    },    "plan": {      "id": "string",      "seq": 0,      "count": 0    },    "reminders_enabled": true,    "issued_at": "2019-08-24T14:15:22Z",    "sent_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "origin": "string",    "source_document_id": "string"  }}