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

Parameters: save_invoice_draft
NameTypeDescription
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
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"}'
Python
result = client.call("ifirma", "save_invoice_draft", {"contractor_id":"contractor_8c41d2","lines":"lines"})
Node.js
const result = await cotlet.call('ifirma', 'save_invoice_draft', {"contractor_id":"contractor_8c41d2","lines":"lines"});
CLI
cotlet call ifirma save_invoice_draft --data '{"contractor_id":"contractor_8c41d2","lines":"lines"}'

Example response

JSON

{
  "id": 7020119,
  "number": null,
  "draft": true,
  "buyer": "Blue Fern Studio",
  "gross": 1230,
  "currency": "PLN"
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.