Book invoice
Book a draft invoice, and optionally send it by email or EAN.
POST https://cotlet.dev/api/v1/e-conomic/draft-invoices/{draft_invoice_number}/invoices
Books the draft, which gives it an invoice number, and a booked invoice cannot be edited any more. With send_by email or ean, the invoice is sent to the customer after booking, and only if booking succeeds. Without it nothing is sent. An EAN invoice needs your CVR and country in master data and a recipient identifier on the customer. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| draft_invoice_number integer required | integer | Draft invoice number from list_draft_invoices or create_draft_invoice. |
| send_by string | string | none, email or ean. Default: none. |
| book_with_number integer | integer | Own invoice number. Default: next number in the sequence. |
Request
curl -X POST https://cotlet.dev/api/v1/e-conomic/draft-invoices/118/invoices \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"send_by":"email"}' result = client.call("e-conomic", "book_invoice", {"draft_invoice_number":118,"send_by":"email"}) const result = await cotlet.call('e-conomic', 'book_invoice', {"draft_invoice_number":118,"send_by":"email"}); cotlet call e-conomic book_invoice --data '{"draft_invoice_number":118,"send_by":"email"}' Example response
{
"invoice_number": 1042,
"draft_invoice_number": 118,
"customer_number": 14,
"total_gross": 1500,
"currency": "DKK",
"sent_by": "email",
"status": "booked"
}