---
title: "Creates a new draft supplier bill (purchase invoice). Optionally creates a new supplier company and contact if no matching company is found."
method: POST
path: "/api/Bill"
tags: ["Bill"]
---

# Creates a new draft supplier bill (purchase invoice). Optionally creates a new supplier company and contact if no matching company is found.

`POST /api/Bill`

## Request body

- NewBill — Request model for creating a new supplier bill. Supports automatic company/contact creation.
  - `TransactionPrefix` string — A prefix for the Invoice number. e.g. 'INV'. If left blank it will be set to the account default. Max length 20 characters.
  - `BillNumber` string — Pass any string. If left blank it will use the next number in the auto incrementing sequence. If an integer is passed then the largest integer will be use as the seed to auto generate the next invoice number in the sequence.
  - `CompanyIDFK` integer — If left blank then you must specify Company Name.
  - `CompanyName` string — If left blank then you must specify Company ID. Specified Name will be used to match existing customer record. If not matched then it will be used to create a new customer. First Name, Last Name and Email will only be used if it is a new company. If the Company name appears multiple times we will check the email address to find a matching company. If email address doesn't identify a matching company then the invoice creation will be rejected.
  - `Firstname` string — Specified value will be used to create a new customer contact only if a new customer is being created.
  - `Lastname` string — Specified value will be used to create a new customer contact only if a new customer is being created.
  - `Email` string — Specified value will be used to create a new customer contact only if a new customer is being created.
  - `CurrencyCode` string — Expects ISO Standard 3 character currency code. If left blank the currency will default to account's currency in general setting. For existing companies this field will be ignored and the invoice will use the currency of the customer. For new customers if the currency is not specified then account currency will be used otherwise the specified currency will be used.
  - `ExchangeRate` number, double — Exchange rate is only valid for invoices in currency other than default account currency. If not specified it will get the market rate based on the Date Issued.
  - `BillTemplateIDFK` integer — If left blank the account default invoice template will be used.
  - `Subject` string — Plain UTF8 text. (no HTML). 255 characters max
  - `SupplierPONumber` string — Plain UTF8 text. 100 characters max
  - `DateIssued` string, date-time — If not specified it will use today's date. The date should be specified as local date.
  - `PaymentTerms` integer — "If left blank we will set it to customer default. If specified then it must match one of your existing pre configured payment term periods. Your account starts with: (-1 --- Custom, 0 --- Upon Receipt, 7 --- 7 Days, 15 --- 15 Days, 30 --- 30 Days, 45 --- 45 Days, 60 --- 60 Days)
  - `DueDate` string, date-time — It will be auto calculated based on the payment term and issue date. Due Date must be greater than or equal to Issue Date. If the Due Date is specified then Payment Terms will be set to -1 (Custom)
  - `TransactionTaxConfigCode` string — Possible values are (EX --- Tax Exclusive, INC --- Tax Inclusive). If left empty it will use the account default.
  - `Notes` string — Plain UTF8 text. (no HTML). Max 2000 characters
  - `LineItems` NewBillLineItem[] — Line items to include on the bill. At least one line item is required.
    - `InventoryItemIDFK` integer — If not specified then Inventory Item Name must be specified.
    - `InventoryItemName` string — If not specified then Inventory item ID must be specified. If specified and not matched to any existing inventory items then a new inventory item will be created. Max 200 characters.
    - `Description` string — Plain UTF8 text. (no HTML)
    - `Quantity` number, double, required — The quantity for the line item
    - `UnitPrice` number, double, required — The unit price for the lineitem.
    - `TaxIDFK` integer — If specified then it must match an existing Tax ID. If not specified then Tax Name and Tax Percent must be specified.
    - `TaxName` string — Must be specified if the Tax ID is blank. If the Tax Name is specified it will be matched to an existing Tax Name or else a new Tax will be created.
    - `TaxPercent` number, double — The Tax Percent will only be used if a new tax is being created.
    - `Discount` number, double — Enter 10.5 to give a 10.5% discount
    - `ProjectIDFK` integer — Optional. Project ID of an Avaza Project that belongs to this customer, so line item is attributed to that Project for reporting.
  - `SendWebhooks` boolean — If true, fires the bill_created webhook event to any subscribed endpoints. Defaults to false to preserve existing integration behaviour.

## Response `200`

Returns the created bill with assigned Transaction ID and line items.

- Bill — A supplier bill (purchase invoice) including line items, status, amounts, and issuer/recipient details.
  - `TransactionID` integer — Unique identifier for the bill transaction.
  - `AccountIDFK` integer — The Avaza account this bill belongs to.
  - `TransactionPrefix` string — The prefix used in the bill number (e.g. 'BILL').
  - `BillNumber` string — The full bill/invoice number including prefix.
  - `CompanyIDFK` integer — The supplier company ID this bill is from.
  - `CompanyName` string — The name of the supplier company.
  - `Subject` string — Subject line or description for the bill.
  - `DateIssued` string, date-time — The date the bill was issued.
  - `DateVerified` string, date-time — The date the bill was verified/approved.
  - `DueDate` string, date-time — The payment due date for the bill.
  - `TransactionStatusCode` string — Current status of the bill. Values: Draft, Verified, Late, Paid, Partial, Void.
  - `TaxAmount` number, double — Total tax amount across all line items.
  - `TransactionTaxConfigCode` string — Tax configuration: 'EX' (tax exclusive) or 'INC' (tax inclusive).
  - `Balance` number, double — Outstanding balance remaining on the bill.
  - `CurrencyCode` string — ISO 3-character currency code for the bill.
  - `TotalAmount` number, double — Total amount of the bill including tax.
  - `ExchangeRate` number, double — Exchange rate to the account's base currency. 1.0 if same currency.
  - `Notes` string — Additional notes or comments on the bill.
  - `SupplierPONumber` string — Supplier purchase order number reference.
  - `DateCreated` string, date-time — Date and time the record was created.
  - `DateUpdated` string, date-time — Date and time the record was last updated.
  - `LineItems` BillLineItem[] — Line items on this bill.
    - `TransactionLineItemID` integer — Unique identifier for the line item.
    - `InventoryItemIDFK` integer — The inventory/product item ID for this line item.
    - `InventoryItemName` string — Name of the inventory/product item.
    - `InventoryItemSKU` string — Stock Keeping Unit code for the inventory item.
    - `Description` string — Text description for the line item.
    - `Quantity` number, double — Quantity of items on this line.
    - `UnitPrice` number, double — Price per unit for this line item.
    - `TaxAmount` number, double — Total tax amount for this line item.
    - `TaxIDFK` integer — The tax rate ID applied to this line item.
    - `TaxCode` string — Short code for the applied tax rate.
    - `TaxName` string — Name of the applied tax rate.
    - `ProjectIDFK` integer — Optional project ID this line item is attributed to for reporting.
    - `ProjectTitle` string — Title of the associated project.
    - `Amount` number, double — Calculated line total (Quantity x UnitPrice less Discount).
    - `Discount` number, double — Discount percentage applied to this line item.
  - `Links` BillLinks — URLs for viewing and editing a bill in the Avaza web application.
    - `WebView` string — URL for viewing the bill in a web browser.
    - `View` string — URL for viewing the bill in the Avaza application.
    - `Edit` string — URL for editing the bill in the Avaza application.
  - `Issuer` BillIssuerDetails — Billing address details for the supplier who issued the bill.
    - `CompanyIDFK` integer — The supplier company ID this bill is from.
    - `CompanyName` string — The name of the supplier company.
    - `BillingAddress` string — Formatted multi-line billing address.
    - `BillingAddressLine` string — Street address line of the billing address.
    - `BillingAddressCity` string — City/suburb of the billing address.
    - `BillingAddressState` string — State/province of the billing address.
    - `BillingAddressPostCode` string — Postal/ZIP code of the billing address.
    - `BillingCountryCode` string — ISO 3166-1 alpha-2 country code of the billing address.
  - `Recipient` BillRecipientDetails — Billing address details for the Avaza account (the recipient of the bill).
    - `RecipientFormattedBillingAddress` string — Pre-formatted multi-line billing address for the recipient.
    - `RecipientBillingAddressLine` string — Street address line for the recipient.
    - `RecipientBillingAddressCity` string — City/suburb for the recipient.
    - `RecipientBillingAddressState` string — State/province for the recipient.
    - `RecipientBillingAddressPostCode` string — Postal/ZIP code for the recipient.
    - `RecipientBillingAddressCountryCode` string — ISO country code for the recipient.

## Other responses

- `401` — Unauthorized

---

[API](https://skmtc.net/avaza/apis/avaza-api-documentation.md) · [All operations](https://skmtc.net/avaza/apis/avaza-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/avaza/avaza-api-documentation/versions/1eeadf750514/schema)
