Basic Invoice Data

Billable Items

Invoices can't exist without first looking at Billable Items. In fact, Billable Items are generated during Invoice generation. They can also be generated during the previewing stage of an Invoice, so you'll have to be mindful of when you would even want to look at them. It typically serves business needs to only look at invoice lines of a finalized invoice in an approved state, but Billable Items have deeper relation lists for you to dig into. Billable Items have a relationship to Bill Items and Contracts.

Billable Items therefore contain the sufficient granular detail of any Invoice Line item, and they're categorized by both Service Model and Group Key. 

Service Models are linked in the sense that an hourly guarding config will feed shift and position service models transaction data, while scheduled patrols will feed task-price-tiers, dispatches will feed dispatch-tasks and recurrent items will feed contract-recurrent-fixed-services.

Service Models typically seen in Billable Items records:

  • invoice-lines - Manually created invoice lines when in edit mode of an invoice
  • shifts - Self explanatory
  • dispatch-tasks - Billable dispatch jobs
  • billing-adhoc-items - Ad-hoc items created at site level
  • task-price-tiers - Mobile schedule price tiers
  • contract-recurrent-fixed-services - Recurrent fixed costs on a contract
  • mobile-schedule-occurrences - The occurrences on a  mobile schedule (think this is mostly with fixed billing)
  • positions - Fixed rate billing positions

Invoice Lines will group Billable Items based on a groupKey. Billable Items get assigned a Group Key, and Group Keys are aggregate names for combinations of:

  • same rate
  • same bill item
  • same location
  • same position
  • etc.

To go deeper would land us in an area of redundancy with existing documentation of how to configure the TrackTik web application, and you can discover that further if you like (e.g. the Billing section).

Examining Billable Items:

[GET] /billable-items?sort=-id

Usually you'll want to see billable-items in their association to an invoice, so you'll need to find the invoice based on it being from a date range, or latest, and in a certain status:

[GET] /invoices?sort=-id&limit=1

From there you'll get an {id} value, and then you can look for the billable items:

[GET] /billable-items?invoice={id}

Invoices can be accessed via the /invoices endpoint, and there is a relation list called "lines" that can be included when fetching a single invoice:

{
            "type": "REVENUE",
            "serviceModel": {
                "type": "invoice-lines",
                "object": 4157
            },
            "quantity": 100,
            "rate": 25,
            "price": 2500,
            "contract": 9,
            "taxClass": null,
            "invoice": 1252,
            "invoiceLine": 4158,
            "serviceLocation": 12,
            "serviceAccount": 12,
            "clientAccount": 12,
            "postedOn": null,
            "postDateTime": null,
            "postBatchCustom": null,
            "memo": "",
            "region": 5,
            "billItem": 17,
            "statAmount": "",
            "statType": "",
            "priceTierModel": "",
            "priceTierId": null,
            "priceTierModelObject": null,
            "serviceDate": "2025-11-17T00:00:00+00:00",
            "servicedOn": null,
            "groupKey": "",
            "billingNotes": "",
            "subType": null,
            "id": 22744
        }

Retrieve a list of the most recent invoices

[GET] /invoices?sort=-id

{
            "client": 12,
            "status": "APPROVED",
            "documentNumber": "1351",
            "poNumber": "",
            "externalInvoiceId": "",
            "invoiceDate": "2025-11-17T00:00:00+00:00",
            "date": "2025-11-17T00:00:00+00:00",
            "dueDate": "2025-11-30T00:00:00+00:00",
            "servicePeriodStartDate": "2025-11-01T00:00:00+00:00",
            "servicePeriodStart": "2025-11-01T00:00:00+00:00",
            "servicePeriodEndDate": "2025-11-16T00:00:00+00:00",
            "servicePeriodEnd": "2025-11-16T00:00:00+00:00",
            "taxClass": 10,
            "contract": 9,
            "subTotal": 2500,
            "taxTotal": 130,
            "total": 2630,
            "distributed": false,
            "aging": "90-120",
            "approvedBy": 1518,
            "invoiceBatchId": null,
            "billTo": 1870,
            "id": 1252
        }
        ...

The 1:many relation list of the invoice lines can only be accessed when fetching single invoices, and not when generating a list of invoices.

Retrieve a full single invoice, including its lines

[GET] /invoices/1245?include=lines

{
        "client": 871,
        "status": "APPROVED",
        "documentNumber": "1344",
        "poNumber": "",
        "externalInvoiceId": "",
        "invoiceDate": "2024-06-09T00:00:00+00:00",
        "date": "2024-06-09T00:00:00+00:00",
        "dueDate": "2024-07-09T00:00:00+00:00",
        "servicePeriodStartDate": "2024-06-02T00:00:00+00:00",
        "servicePeriodStart": "2024-06-02T00:00:00+00:00",
        "servicePeriodEndDate": "2024-06-08T00:00:00+00:00",
        "servicePeriodEnd": "2024-06-08T00:00:00+00:00",
        "taxClass": 2,
        "contract": 146,
        "subTotal": 6218,
        "taxTotal": 931.14,
        "total": 7149.14,
        "distributed": true,
        "aging": "120+",
        "approvedBy": 1055,
        "invoiceBatchId": null,
        "billTo": 1767,
        "id": 1245,
        "lines": [
            {
                "quantity": 172,
                "unitPrice": 35,
                "lineSubTotal": 6020,
                "relationGuid": null,
                "serviceLocation": 871,
                "timeZone": "America/New_York",
                "serviceDateTime": null,
                "serviceDate": null,
                "taxClass": 2,
                "taxable": true,
                "invoice": 1245,
                "billItem": 2,
                "id": 4146
            },
            {
                "quantity": 99,
                "unitPrice": 1,
                "lineSubTotal": 99,
                "relationGuid": null,
                "serviceLocation": 871,
                "timeZone": "America/New_York",
                "serviceDateTime": null,
                "serviceDate": null,
                "taxClass": 2,
                "taxable": true,
                "invoice": 1245,
                "billItem": 6,
                "id": 4147
            },
            {
                "quantity": 1,
                "unitPrice": 99,
                "lineSubTotal": 99,
                "relationGuid": null,
                "serviceLocation": 871,
                "timeZone": "America/New_York",
                "serviceDateTime": null,
                "serviceDate": null,
                "taxClass": null,
                "taxable": true,
                "invoice": 1245,
                "billItem": 34,
                "id": 4148
            }
        ]
    }

Relation Lists

The invoices endpoint has several relation lists defined so that you can include additional information, like that of the overarching contract.

[GET] /invoices/1245?include=contract

{
        "client": 871,
        "status": "APPROVED",
        "documentNumber": "1344",
        "poNumber": "",
        "externalInvoiceId": "",
        "invoiceDate": "2024-06-09T00:00:00+00:00",
        "date": "2024-06-09T00:00:00+00:00",
        "dueDate": "2024-07-09T00:00:00+00:00",
        "servicePeriodStartDate": "2024-06-02T00:00:00+00:00",
        "servicePeriodStart": "2024-06-02T00:00:00+00:00",
        "servicePeriodEndDate": "2024-06-08T00:00:00+00:00",
        "servicePeriodEnd": "2024-06-08T00:00:00+00:00",
        "taxClass": 2,
        "subTotal": 6218,
        "taxTotal": 931.14,
        "total": 7149.14,
        "distributed": true,
        "aging": "120+",
        "approvedBy": 1055,
        "invoiceBatchId": null,
        "billTo": 1767,
        "id": 1245,
        "contract": {
            "customId": "",
            "account": 871,
            "billingFrequency": "WEEKLY",
            "billingFrequencyType": "ON_END",
            "billingStartDate": "2024-05-26T00:00:00+00:00",
            "semiMonthlyFirstReferenceDay": null,
            "semiMonthlySecondReferenceDay": null,
            "invoiceDayToAdd": 0,
            "name": "Test Contract",
            "paymentMethod": 1,
            "paymentTerms": "DAYS_30",
            "externalId": "",
            "proposalNumber": "",
            "estimatedPerPeriodRevenue": 0,
            "serviceStartDate": "2024-05-26T00:00:00+00:00",
            "serviceEndDate": "2024-06-28T00:00:00+00:00",
            "status": "NOT_RENEWED",
            "type": "CONTRACT",
            "contractedHours": null,
            "contractedHoursSchedule": null,
            "id": 146
        }
    }

There are other relations you can also add like client, approvedBy, billTo etc.

 

Was this article helpful?
0 out of 0 found this helpful

Articles in this section