Finance

Send a booked invoice (smart delivery or a forced channel).

Sends an already-booked invoice to its recipient, synchronously, under the company resolved from the bearer JWT.<br/><br/>Omit <code>channel</code> for <strong>smart delivery</strong>: the system auto-routes through <code>EPOST</code>, <code>EBILL</code>, <code>SEND_EMAIL</code> and Print&Send and only fails if none can deliver. Provide <code>channel</code> to <strong>force</strong> that exact channel: if the recipient is not eligible (e.g. no email on file, not eBill-registered, Print&Send not subscribed) the call fails with 400. The invoice PDF is rendered on demand when it has not been printed yet.<br/><br/><strong>Prerequisites:</strong> the invoice must already be booked — <code>DRAFT</code> and cancelled invoices are rejected with 400. Create/book it via <code>POST /core/v1/invoices</code> (<code>status=INVOICED</code>) first.<br/><br/><strong>Not idempotent:</strong> each successful call performs a real delivery (sends an email / hands a letter to the postal channel) and overwrites the invoice's recorded post method — do not retry blindly on success.<br/><br/><code>channel</code> uses the same values as <code>Invoice.postMethod</code>, except <code>PRINT_AND_MANUAL_SEND</code>, which is not a deliverable channel and is rejected with 400. Authentication is API key + bearer JWT; the caller must hold the <code>FINANCE</code> permission on the target company.

post/core/v1/invoices/{id}/send

Request

  • Base URL: https://api.klara.ch
  • URL: https://api.klara.ch/core/v1/invoices/{id}/send
  • Auth: one of:
    • API key in header X-API-KEY
    • HTTP bearer

Path parameters

idinteger required
Example:42

Numeric primary key of the booked invoice to send. Must belong to the company resolved from the bearer JWT. Obtain it from the <code>id</code> of a previously created invoice (<code>POST /core/v1/invoices</code>).

Query parameters

channel'A_POST' | 'B_POST' | 'SEND_EMAIL' | 'PRINT_AND_MANUAL_SEND' | 'EPOST' | 'EBILL'

Forced distribution channel. <strong>Leave empty for smart delivery</strong> (auto-routing) — the default is no forced channel. Allowed values: <code>EPOST</code>, <code>EBILL</code>, <code>SEND_EMAIL</code>, <code>A_POST</code>, <code>B_POST</code>. <code>PRINT_AND_MANUAL_SEND</code> is rejected with 400 (not a deliverable channel).

Response

Invoice delivered. Returns the channel actually used, whether it was smart-routed, the OneAPI delivery id and the archived PDF's printedFileId.

deliveredboolean

<code>true</code> when delivery was confirmed via the channel actually used.

smartboolean

<code>true</code> when the channel was auto-selected (smart delivery, i.e. no <code>channel</code> was forced); <code>false</code> when a channel was forced.

channelobject

The channel actually used to deliver the invoice. For physical post this is the resolved postage method (e.g. <code>A_POST</code>).

deliveryIdstring

OneAPI delivery id, when available (forced sends only; <code>null</code> for smart delivery).

printedFileIdstring

The printedFileId of the archived invoice PDF rendered/reused during the send.

Example response

{
  "delivered": true,
  "smart": true,
  "deliveryId": "9b1f4c8e-2d3a-4f6b-8c7d-1e2f3a4b5c6d",
  "printedFileId": "1771764"
}

Changes

No recorded changes to this operation across all 1 revision of this API.