Skip to main content

Invoices

Invoices represent a formal statement issued by a seller to a buyer, which indicates the quantities and costs of the products or services provided by the vendor.

Schema​

Invoice​

NameTypeDescriptionExample
idIDUnique identifier for invoices"ckmnpybisiy5x08abky4g2d1f"
createdAtDateTimeWhen this invoice was created"2021-03-24 17:26:46.983Z"
createdByIdIDID of the user who created this invoice"ckmnpybisiy5x08abky4g2d1f"
createdByUserUser who created the invoiceSee User docs
updatedAtDateTimeWhen this invoice was updated"2021-03-24 17:26:46.983Z"
deletedAtDateTime?When this invoice was deleted"2021-03-24 17:26:46.983Z"
titlestring?Title of the invoice"Invoice 1234"
approvedAtDateTime?When this invoice was approved"2021-03-24 17:26:46.983Z"
approvedByIdID?ID of the user who approved this invoice"ckmnpybisiy5x08abky4g2d1f"
approvedByUser?User who approved the invoiceSee User docs
categoryInvoiceCategory?Category of the invoicemiscellaneous
dueDateDateTime?When a payment for the invoice is due"2021-03-24 17:26:46.983Z"
invoiceDateDateTime?When this invoices was issued by the vendor"2021-03-24 17:26:46.983Z"
exceptionsstring[]Array indicating which fields in the invoice have exceptions or discrepancies["totalDue","subtotal"]
flaggedAtDateTime?When this invoice was flagged"2021-03-24 17:26:46.983Z"
flaggedByIdID?ID of the user who flagged this invoice"ckmnpybisiy5x08abky4g2d1f"
flaggedByUser?User who flagged the invoiceSee User docs
flagMessagestring?User's description of the flagged issue with this invoice"Urgent!!"
invoiceNumberstring?User-defined value to identify this invoice"Invoice-1234"
paidAtDateTime?When this invoice was paid"2021-03-24 17:26:46.983Z"
paidByIdID?ID of the user who made a payment for this invoice"ckmnpybisiy5x08abky4g2d1f"
paymentsfloat?The amount of payments on the invoice12.55
rejectedAtDateTime?When this invoice was rejected"2021-03-24 17:26:46.983Z"
rejectedByIdID?ID of the user who rejected this invoice"ckmnpybisiy5x08abky4g2d1f"
rejectedReasonstring?Reason provided by the user for rejecting the invoice"Created accidentally"
salespersonstring?Salesperson associated with this invoice"Mike R."
shipDateDateTime?Date when the products stated in the invoice were shipped"2021-03-24 17:26:46.983Z"
shippingCostFloatfloat?The cost of shipping10.00
shipViastring?Method of shipment"Freight"
stateInvoiceStateThe current state of the invoiceAPPROVED
integrationStateIntegrationStateThe synchronization status between the invoice and the integrated systemLINKED
integrationMessagestring?A message about the status of the integration's sync"GL Code is required for item 1"
subtotalfloat?Subtotal of the invoice before addition of other costs such as taxes6.13
taxfloat?The amount of tax on the invoice5.00
termsstring?Terms of payment for the invoice"CWO"
totalDuefloat?The total amount due55.55
voidedAtDateTime?When this invoice was voided"2021-03-24 17:26:46.983Z"
voidedByIdID?ID of the user who voided the invoice"ckmnpybisiy5x08abky4g2d1f"
voidedByUser?User who voided the invoiceSee User docs
creditMemosCreditMemo[]Credit memos associated with the invoiceSee CreditMemo Docs
invoiceItemsInvoiceItem[]Items listed in the invoiceSee Invoice Item Docs
jobJob?Job associated with this invoiceSee Job Docs
taxCodeTaxCode?Default tax code to use for items in this invoiceSee Tax Code Docs
attachmentsFile[]The files associated with the invoiceSee File[]
orderOrder?Order associated with this invoiceSee Order Docs
paidByUser?`User who paid the invoiceSee User docs
rejectedByUser?User who rejected the invoiceSee User docs
vendorVendor?The vendor associated with this invoiceSee Vendor docs
costCategoryCostCategory?Cost category associated with this invoiceSee Cost Category docs
glCodeGLCode?GL code associated with this invoiceSee GL Code docs

Enums​

InvoiceCategory​

ValueDescription
genContractorInvoice is for a general contractor
materialInvoice is for materials
miscellaneousInvoice falls under miscellaneous expenses
rentalsInvoice is for rentals

InvoiceState​

ValueDescription
APPROVEDInvoice has been approved
CLOSEDInvoice has been settled and is no longer active
INBOXInvoice is new
PENDINGInvoice needs to be reviewed and approved

IntegrationState​

ValueDescription
NOT_LINKEDThe invoice is not linked to any integrated system, either because no integration is configured or because no attempt has been made to link it
LINKINGLinking to the other system is in progress
LINKEDThe invoice was successfully linked to the other system
ERRORAn error occurred while trying to sync the invoice to the other system. When this state is used, it's helpful to set an integrationMessage explaining the problem to the user.

Note: The only Scalar Filter that IntegrationState currently supports is integrationState_in.

File​

NameTypeDescriptionExample
idIDUnique identifier for the file"ckmnpybisiy5x08abky4g2d1f"
namestring?Name of the file"document.pdf"
createdAtDateTimeWhen this file was created"2024-09-03T12:00:00Z"
updatedAtDateTimeWhen this file was last updated"2024-09-03T12:00:00Z"
urlstring?URL where the file can be accessed"https://example.com/file1.pdf"

Queries​

invoice​

Reads a single invoice by ID.

Parameters​

NameTypeDescriptionExample
idIDID of the invoice to fetch"ckmnpybisiy5x08abky4g2d1f"

Response​

A single Invoice

Example Query​

query {
invoice(id: "ckmnpybisiy5x08abky4g2d1f") {
id
invoiceNumber
}
}

Example Response​

{
"id": "ckmnpybisiy5x08abky4g2d1f",
"invoiceNumber": "606123",
}

invoices​

Read all invoices, with pagination.

Parameters​

Accepts all standard pagination parameters.

Allowed orderBy fields: approvedAt, createdAt, flaggedAt, id, invoiceDate, paidAt, rejectedAt, shipDate, updatedAt, voidedAt.

Allowed filter fields: approvedAt, createdAt, category, flagged, flaggedAt, id, invoiceDate, invoiceNumber, paidAt, rejectedAt, shipDate, state, integrationState_in,taxExempt, type, updatedAt, voidedAt.

Accepts an includeDeleted boolean parameter which determines if deleted invoices will be returned (e.g. includeDeleted: true). By default, deleted invoices are not returned.

Response​

A list of Invoice objects.

Example Query​

query {
invoices(orderBy: createdAt, direction: ASC) {
id
invoiceNumber
}
}

Example Response​

[
{
"id": "ckmnpybisiy5x08aasdf13242",
"invoiceNumber": "111444",
},
{
"id": "ckmnpybisiy5x08abky4g2d1f",
"invoiceNumber": "606123",
}
]

Mutations​

markInvoicesAsPaid​

Marks invoices as paid.

important

Invoices must be approved before they can be marked as paid. If an invoice is not approved, the entire request will fail.

Parameters​

NameTypeDescriptionExample
ids[ID!]IDs of the invoices to mark as paid["ckmnpybisiy5x08abky4g2d1f"]
userIdID!ID of the user marking the invoices as paid"ckmnpybisiy5x08abky4g2d1f"

Response​

A list of Invoice objects.

Example Query​

mutation {
markInvoicesAsPaid(ids: ["ckmnpybisiy5x08abky4g2d1f"], userId: "ckmnpybisiy5x08abky4g2d1f") {
id
state
}
}

Example Response​

[
{
"id": "ckmnpybisiy5x08abky4g2d1f",
"state": "CLOSED",
}
]

updateInvoiceIntegrationState​

Updates the integration state of an invoice.

Parameters​

NameTypeDescriptionExample
idID!ID of the invoice to update"ckmnpybisiy5x08abky4g2d1f"
integrationMessagestring?A message about the status of the integration's sync"Invoice already exists"
integrationStateIntegrationStateThe new status of the invoices's sync to your integrated systemNOT_LINKED

Response​

A single Invoice object.

Example Query​

mutation {
updateInvoiceIntegrationState(id: "ckmnpybisiy5x08abky4g2d1f", integrationMessage: "Invoice already exists", integrationState: NOT_LINKED) {
id
integrationState
}
}

Example Response​

{
"id": "ckmnpybisiy5x08abky4g2d1f",
"integrationState": "NOT_LINKED",
}