CData Python Connector for FreshBooks

Build 20.0.7587

Invoices

A list of invoices associated with a given client Id. Staff can access invoices for clients that are assigned to them.

Table Specific Information

Select

The Classic API allows the following subset of columns to be used as filter criteria in the WHERE clause:

  • InvoiceId
  • ClientId
  • Number
  • Status
  • Date
  • Folder
  • Updated
  • RecurringId

Note: InvoiceId cannot be used at the same time as the other columns.

Other filters are processed client side by the provider. See SupportEnhancedSQL for more information.

Insert

To insert, the ClientId field is required.

Contact Aggregate

You can use the ContactAggregate field to flatten contact items into a single field. This XML aggregate contains additional Ids for contacts beyond the primary client associated with an invoice and can be inserted and updated directly using the proper XML formatting, as indicated by the example below:

INSERT INTO Invoices (ClientId, ContactAggregate)
VALUES ('123', '<contact><contact_id>456</contact_id></contact><contact><contact_id>789</contact_id></contact>')

Line Aggregate

You can use the LineAggregate field to flatten line items into a single field. This XML aggregate contains all of the line items for an invoice and can be inserted and updated directly using the proper XML formatting, as indicated by the example below:

INSERT INTO Invoices (ClientId, LineAggregate)
VALUES ('123',
'<line><name>Yard Work</name><description>Mowed the lawn.</description>
<unit_cost>10</unit_cost><quantity>4</quantity>
<tax1_name></tax1_name><tax2_name></tax2_name>
<tax1_percent></tax1_percent><tax2_percent></tax2_percent><type></type></line>
<line><name>Giant Rock</name><description>It's a large rock.</description>
<unit_cost>200</unit_cost><quantity>1</quantity>
<tax1_name></tax1_name><tax2_name></tax2_name>
<tax1_percent></tax1_percent><tax2_percent></tax2_percent><type></type></line>')

Note: Updating these fields will remove all previously stored information.

Columns

Name Type ReadOnly Description
InvoiceId [KEY] String True

The unique identifier of an invoice.

ClientId String False

The unique identifier of a client.

ContactAggregate String False

An aggregate containing contact information associated with an invoice. See the help file for the Invoices table for more information on inserting and updating to this field.

Number String False

Number associated with an invoice.

Amount Decimal True

Total invoice amount, taxes included.

CurrencyCode String False

The currency code used for an invoice.

Language String False

The language used for an invoice.

AmountOutstanding Decimal True

Outstanding amount on invoice from partial payment, etc.

Status String False

This field accepts one of the following values: sent, viewed, or draft. Defaults to draft.

Date Datetime False

The date associated with an invoice.

Folder String True

Folder associated with an invoice.

PONumber String False

The purchase order number associated with an invoice.

Discount Decimal False

Discount applied to an invoice.

Notes String False

A custom note for an invoice.

Terms String False

The terms for an invoice.

Url String True

The URL for an invoice. This value is deprecated in favor of the list stored in LinksClientView.

AuthUrl String True

The auth_url for an invoice. This value is deprecated in favor of the list stored in LinksView.

LinksClientView String True

Client view for a link to an invoice.

LinksView String True

View for a link to an invoice.

LinksEdit String True

Edit for a link to an invoice.

ReturnUri String False

Return URI for an invoice.

Updated Datetime True

A time value representing the last time the client was updated.

RecurringId String True

Recurring Id for an invoice.

Organization String True

The name of the organization attached to an invoice.

FirstName String False

The first name attached to an invoice.

LastName String False

The last name attached to an invoice.

PrimaryStreet1 String False

The first line of a primary street address for an invoice.

PrimaryStreet2 String False

The second line of a primary street address for an invoice.

PrimaryCity String False

The primary city for an invoice.

PrimaryState String False

The primary state or province for an invoice.

PrimaryCountry String False

The primary country for an invoice.

PrimaryCode String False

The primary Postal/ZIP code for an invoice.

VatName String False

VAT name associated with an invoice.

VatNumber String False

VAT number associated with an invoice.

StaffId String True

Id for the staff member associated with an invoice.

LineAggregate String False

An aggregate of lines associated with an invoice. See the help for the Invoices table for more information on inserting and updating to this field.

Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 20.0.7587