Creates a draft purchase bill; approving it is a separate action that posts it to the ledger. Each line names the account it posts to by account_id (the chart-of-accounts id from the chart of accounts list: use it when the account has no code) or by account_code; when both are sent they must name the same account. An account_id that is not an active expense, cost of sales or asset account of the company, or that is a control account (accounts receivable, accounts payable, VAT, a bank account's ledger), is refused with 422 bill_line_account_unavailable, naming the line in error.fields. Each line names its tax rule by tax_rule_id (the id from the tax rules list: use it when the rule has no code) or by tax_code, and the rate is always the rule's own; when both are sent they must name the same rule. A tax_rule_id that is not a purchase or no-VAT tax rule of the company is refused with 422 bill_line_tax_rule_unavailable; a tax_rule_id and tax_code that name different rules with 422 bill_line_tax_rule_mismatch. attachment_ids (up to 5) copies files the caller attached in Cybooks AI, in their own conversations, onto the new bill as its documents; it needs the access_ask_cybooks permission (403 cybooks_ai_access_required), and an id that is not such a file of the caller is refused with 404 attachment_not_found. Idempotency-Key is required and stores the terminal response for 24 hours. Requires the bills:write OAuth scope.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
