ODBC Driver for FreshBooks

Build 23.0.8839

Bills

A Bill is used to record a business transaction where the items and services from a Vendor have been provided to the business owner, but payment isn’t due until a later date.

Table Specific Information

Insert

To insert, VendorID, IssueDate, DueOffsetDays, CurrencyCode, Language, LinesAggregate fields are required. To insert Bills with multiple line items, you can either insert an aggregate value into the LinesAggregate field, or use a temporary table. This section provides examples of both procedures.

You can insert Bills with multiple line items using aggregates. CategoryId, UnitCostAmount and Quantity is required. For example:

Insert Into Bills (VendorID, IssueDate, DueOffsetDays, CurrencyCode, Language, LinesAggregate) Values ('16307', '2023-11-02', 2, INR, en, '[{\"categoryid\":\"46781\",\"quantity\":\"1\",\"unit_cost\":{\"amount\":\"200\"}}]')

You can also insert Bills with multiple line items using a temporary table.

The temporary table you are populating is dynamic and will be created at run time the first time you insert to it. Temporary tables are denoted by a # appearing in their name. When using a temporary table to insert, the temporary table must be named in the format of [TableName]#TEMP, where TableName is the name of the table you will be inserting to. For example:

INSERT Into BillsLineItems#Temp (CategoryId, UnitCostAmount, Quantity) Values ('4331719', 1, 2)

Once your temporary table is populated, it is now time to insert to the actual table in FreshBooks. You can do this by performing an INSERT to the actual table and setting the name of the temporary table as a value for LinesAggregate. For example:

INSERT Into Bills (VendorID, IssueDate, DueOffsetDays, CurrencyCode, Language, LinesAggregate) Values ('16307', '2023-11-02', 2, INR, en, BillsLineItems#Temp)

Update

To update, the Id value is required in the WHERE clause. To update LinesAggregate, you need to override the aggregate LinesAggregate field, either by setting an aggregate value, or by using a temporary table. For example:
Insert Into BillsLineItems#Temp (CategoryId, UnitCostAmount, Quantity) Values ('4331719', 1, 2)

UPDATE Bills SET IssueDate = '2023-11-01', LinesAggregate = 'BillsLineItems#TEMP' WHERE Id = 29153

Delete

To delete, Id value is required in the WHERE clause.
DELETE from Bills where Id = '26157'

Columns

Name Type ReadOnly Description
Id [KEY] Integer True

Uniquely identifies the bill associated with the business.

VendorId Integer False

Unique identifier of client.

Amount String True

Bill subtotatal amount excluding the taxes.

AmountCode String True

Three-letter currency code

AttachmentId String True

Attachment Id

AttachmentType String True

Media Type of Attachment

AttachmentJWT String True

Attachment JWT

BillNumber String False

Reference to vendor bill number

BillPaymentsAggregate String True

Bill Payments made against the bill

CreatedAt Datetime True

Time the invoice was created, YYYY-MM-DD HH:MM:SS format

CurrencyCode String False

Three-letter currency code

DueDate Date True

Date for which the bill is due for payment

DueOffsetDays Integer False

Number of days from the issue date that the invoice needs to be set to due

IssueDate Date False

Date when the bill was issued by the vendor

Language String False

Two-letter language code, e.g. “en”

LinesAggregate String False

Array of bill line items.

OutstandingAmount String True

Outstanding/unpaid amount on the bill

OutstandingCode String True

Three-letter currency code

OverallCategory String True

If multiple categories are selected in the bill lines, then overall_category is Split. Otherwise, it will be the selected category.

OverallDescription String True

First non-null value of bill line descriptions

PaidAmount String True

Paid amount on the bill

PaidCode String True

Three-letter currency code

Status String True

Status of the bill: “unpaid”, “overdue”, “partial”, “paid”

TaxAmountAmount String True

Total tax amount on the bill

TaxAmountCode String True

Three-letter currency code

TotalAmountAmount String True

Grand total amount on bill amount tax amount

TotalAmountCode String True

Three-letter currency code

UpdatedAt Datetime True

Last time the resource was updated. YYYY-MM-DD HH:MM:SS format

VisState Integer True

0 for active, 1 for deleted, 2 for archived

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839