Creates a single bill, i.e. an accounts payable record of money the organization owes a vendor, which books the matching journal entries. The bill needs a vendor — a tagged object {"tag": ..., "contents": ...} naming either an existing Books counterparty ({"tag": "counterpartyId", "contents": ...}) or a banking recipient ({"tag": "recipientId", "contents": ...}, resolved to its linked counterparty) — an effectiveDate (the bill date) and dueDate (both YYYY-MM-DD), and at least one line in lines. Each line needs a ledgerId (the expense ledger to book it against, from getBooksLedgers), a description, and an amount in dollars; a line amount may be negative (e.g. a discount); zero-amount lines are ignored, at least one line must be non-zero, and the lines must total more than zero. referenceNumber (e.g. the vendor's bill number) and notes are optional. The response is the created bill: its id, vendor (always a counterparty id), status, amounts (grossAmount, amountPaid, amountOutstanding), lines, and generated journalEntryIds. To make retries safe, send an Idempotency-Key header: a replay with the same key and body returns the original bill rather than creating a duplicate (a reused key with a different body is rejected). Without one, a retry after a timeout can create a second bill. If a request fails with a server error (HTTP 5xx), the bill may already have been created, so a retry with the same key returns 409 (the original attempt is treated as still in progress); check whether the bill exists rather than retrying with a new key, which could create a duplicate. Request errors are returned as an HTTP error status and create nothing: the token lacks the scope to create accrual sources, a line ledger is outside the Books instance or read-only, the vendor counterparty or recipient does not belong to this organization, or the lines fail Teal's validation.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
400Invalid body or Idempotency-Key or booksId

