/v1/drafts/{id}Replaces the draft’s kind, invoice and settings. The title follows the buyer’s name and the invoice number. Each save counts revision up.
Path parameters
- idstring (uuid)Required
Headers
- If-Matchstring
The draft's
revisionthis save changes. When the draft was saved since, nothing is saved and the answer is 409draft_changed. Without it, the save replaces whatever is there.
Request body
application/json, required
- kindstring
A quote or a pro forma is never sent as an e-invoice.
One ofinvoice,quote,proforma. - invoiceobjectRequired
The canonical invoice as far as it is written. It is not validated until it is filed.
- settingsobject
The form's own settings, such as the output format or
numberSeries, the series the number is taken from when it is filed.
Response
A 200 answer carries these fields.
- idstring (uuid)Required
- revisionintegerRequired
Counted up by every save. Send it as If-Match when you save the draft.
- kindstringRequiredOne of
invoice,quote,proforma. - titlestring or nullRequired
The buyer's name and the invoice number, as far as the draft has them.
- originobject or nullRequired
The stored invoice a follow-up was made from. Null for a draft written from scratch.
Show 2 child fields
- invoiceIdstring (uuid)Required
- followUpstringRequiredOne of
copy,correction,credit,next,final.
- createdAtstring (date-time)Required
- updatedAtstring (date-time)Required
- invoiceobjectRequired
- settingsobjectRequired
Status codes
| Status | Meaning |
|---|---|
200 |
The draft as saved. |
400 |
|
401 |
|
404 |
|
409 |
The draft was saved since the revision If-Match names (draft_changed). Nothing was saved. If-Match that names no revision is 400 invalid_if_match. |
501 |
/v1/drafts/{id}curl -X PUT https://api.certinvo.com/v1/drafts/$DRAFT_ID \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @body.jsonimport { readFile } from 'node:fs/promises'
const draftId = '3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a'
const response = await fetch(`https://api.certinvo.com/v1/drafts/${draftId}`, {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
'Content-Type': 'application/json',
},
body: await readFile('body.json'),
})
console.log(response.status, await response.json())import os
import requests
draft_id = "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"
response = requests.put(
f"https://api.certinvo.com/v1/drafts/{draft_id}",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
data=open("body.json", "rb"),
)
print(response.status_code, response.text){
"id": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
"revision": 0,
"kind": "invoice",
"title": "string",
"origin": {
"invoiceId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
"followUp": "copy"
},
"createdAt": "2026-09-17T09:30:00Z",
"updatedAt": "2026-09-17T09:30:00Z",
"invoice": {},
"settings": {}
}