Save invoice draft
Save an invoice as a draft without a number, to review and issue in the app.
POST https://cotlet.dev/api/v1/ifirma/contractors/{contractor_id}/invoice-draft/save
write
Does what "Zapisz szkic" does: saves the invoice without a number, and it shows in the invoice list. A draft reaches no one and can be edited or deleted in the app, so save_invoice_draft runs without asking first. It takes the same parameters as issue_invoice.
Parameters
| Name | Type | Description |
|---|---|---|
| contractor_id string required | string | Contractor ID from list_contractors or create_contractor. |
| lines array required | array | Lines: {name, quantity, unit, unit_price, vat_rate}. vat_rate is 23, 8, 5, 0 or exempt. |
| calculate_from string | string | net or gross: which price you give. Default: net. |
| issue_date string | string | YYYY-MM-DD. Default: today. |
| due_date string | string | YYYY-MM-DD. |
Request
curl -X POST https://cotlet.dev/api/v1/ifirma/contractors/contractor_8c41d2/invoice-draft/save \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"lines":"lines"}' result = client.call("ifirma", "save_invoice_draft", {"contractor_id":"contractor_8c41d2","lines":"lines"}) const result = await cotlet.call('ifirma', 'save_invoice_draft', {"contractor_id":"contractor_8c41d2","lines":"lines"}); cotlet call ifirma save_invoice_draft --data '{"contractor_id":"contractor_8c41d2","lines":"lines"}' Example response
{
"id": 7020119,
"number": null,
"draft": true,
"buyer": "Blue Fern Studio",
"gross": 1230,
"currency": "PLN"
}