v1

latestOpenAPI 3.0.12026-07-24310590875.6 KB
invoices

Replace an invoice

Update the number of line items in an invoice. You can also update other invoice details.

You can use the PUT operation to add, remove, or replace the number of line items in an invoice. A set of rules apply with the PUT operation.

  • When you add a new line item, a new line item id is generated in the invoice.
  • When you omit an existing line item id, the line item is removed from the invoice.
put/v3/invoices/{invoiceId}

Path parameters

invoiceIdstring required

BILL-generated ID of the invoice. The value begins with 00e.

Example:{{invoice_id}}

Headers

sessionIdstring nullable

API session ID generated with /v3/login

Example:{{session_id}}
devKeystring nullable

Developer key generated with your BILL developer account

Example:{{developer_key}}

Request body

invoiceNumberstring

User-generated invoice number. This value can be your chosen number scheme.

If you do not set this field, invoiceNumber is auto-generated.

invoiceDatestring date

Invoice creation date. This value is in the yyyy-MM-dd format.

If you do not set this field, invoiceDate is set as the date when the invoice is created.

dueDatestring date

Invoice due date. The value is in the yyyy-MM-dd format.

If you do not set this field, dueDate is set as the date when the invoice is created.

paymentTermIdstring
payToChartOfAccountIdstring

BILL-generated ID of the chart of accounts for the invoice payment. The value begins with 0ca.

creditAmountnumber

Credit amount applied to the invoice.

BILL applies the credit amount from the total of all the credit memos available for the customer.

salesTaxItemIdstring

BILL-generated ID of the SALES_TAX item. The value begins with 0ii. The tax rate is applied to all the invoice line items set as taxable.

You can set up a SALES_TAX percentage item with POST /v3/classifications/items.

enableCardPaymentboolean

Set as true if the card payment option is enabled for the invoice

invoicePdfIdstring

BILL-generated ID of the invoice PDF. The value begins with att.

The invoice PDF is sent as an email attachment when you send an invoice to a customer. The invoice PDF also appears when the customer clicks the invoice payment link to complete the invoice payment.

Note: You can get the list of invoice attachments with GET /v3/attachments/invoices/{invoiceId}. All the attachments in the list (including the invoice PDF) are sent as email attachments when you send the invoice to the customer.

Example request

{
  "customer": {
    "id": "{{customer_id}}"
  },
  "invoiceLineItems": [
    {
      "description": "Premium drummer gloves",
      "amount": 29.99,
      "quantity": 1
    },
    {
      "id": "{{invoice_line_item_id01}}",
      "description": "Classic extreme drum sticks",
      "price": 14.99,
      "quantity": 2
    },
    {
      "id": "{{invoice_line_item_id02}}",
      "description": "Metal guitar picks (5-pack)",
      "price": 50,
      "quantity": 1
    }
  ]
}

Response

Replace an invoice response

idstring

BILL-generated ID of the invoice. The value begins with 00e.

archivedboolean

Set as true if the invoice is archived

recordStatus'ACTIVE' | 'INACTIVE' | 'DRAFT' | 'UNDEFINED'

Invoice record status.

When recordStatus is ACTIVE, archived is set as false. For any other recordStatus value, archived is set as true.

invoiceNumberstring

User-generated invoice number. This value can be your chosen number scheme.

If you do not set this field, invoiceNumber is auto-generated.

invoiceDatestring date

Invoice creation date. This value is in the yyyy-MM-dd format.

If you do not set this field, invoiceDate is set as the date when the invoice is created.

dueDatestring date

Invoice due date. The value is in the yyyy-MM-dd format.

If you do not set this field, dueDate is set as the date when the invoice is created.

paymentTermIdstring
customerIdstring

BILL-generated ID of the customer. The value begins with 0cu.

totalAmountnumber

Invoice total amount

dueAmountnumber

Invoice due amount. The value is calculated by subtracting any applied credits (creditAmount), scheduled payment (scheduledAmount), and cleared payment from totalAmount.

scheduledAmountnumber

Invoice scheduled amount. The value is set as the customer payment amount that is pending clearance.

creditAmountnumber

Credit amount applied to the invoice.

When a credit amount is applied to an invoice, the invoice status is set as PARTIAL_PAYMENT or PAID_IN_FULL depending on the invoice totalAmount.

status'PAID_IN_FULL' | 'OPEN' | 'PARTIAL_PAYMENT' | 'SCHEDULED' | 'UNDEFINED'

Invoice status.

exchangeRatenumber

Invoice exchange rate

createdBystring

BILL-generated ID of the user that created the invoice. The value begins with 006.

createdTimestring date-time

Invoice created time

updatedTimestring date-time

Invoice updated time

payToChartOfAccountIdstring

BILL-generated ID of the chart of accounts for the invoice payment. The value begins with 0ca.

salesTaxItemIdstring

BILL-generated ID of the SALES_TAX item. The value begins with 0ii. The tax rate is applied to all the invoice line items set as taxable.

salesTaxTotalnumber

Invoice sales tax amount. The value is set based on salesTaxItemId.

salesTaxPercentagenumber

Invoice sales tax percentage. The value is set based on salesTaxItemId.

enableCardPaymentboolean

Set as true if the card payment option is enabled for the invoice

invoicePdfIdstring

BILL-generated ID of the invoice PDF. The value begins with att.

The invoice PDF is sent as an email attachment when you send an invoice to a customer. The invoice PDF also appears when the customer clicks the invoice payment link to complete the invoice payment.