Invoice Data Models

Invoice is a document issued by a seller to request payment. Here Invoice is used for both Bill and Invoice.

How to get the list of Invoices

There are two ways to fetch the list of invoices from your integrations:

1. Syncs (Webhook-based Bulk Reads)

Syncs provide an automated, push-based approach for bulk data retrieval. Once you set up a sync for an integration, Knit polls the source app for changes and sends updates straight to your webhook. This webhook-based model eliminates the need for you to continuously pull data.

Note: The data models sync does not start automatically. To initiate the synchronization process, you must explicitly call the Sync Start API for the initial sync.

Read more about syncs and webhooks here: https://developers.getknit.dev/docs/register-webhook-url#/

2. Read APIs (On-demand Individual Reads)

Read APIs provide on-demand access to specific data through request-response calls. These are standard GET/List operations that allow you to retrieve invoice information whenever needed.

You can refer to accounting APIs here: https://developers.getknit.dev/reference/list-invoices#/

Data Model


Invoice Info

Model ID: accounting_invoice_info

FieldTypeDescription
idString
invoiceNumberString
createdAtString
updatedAtString
typeEnum[BILL, INVOICE, NOT_SPECIFIED]
issueDateDate
dueDateDate
paidOnDateDate
totalAmountDouble
remainingAmountDouble
totalDiscountDouble
totalTaxDouble
contactIdString
companyIdString
linkedCompanyIdsList[String]List of company Ids associated with object. (Applicable for multi subsidiary apps like Netsuite.)
descriptionString
currencyString
exchangeRateString
statusEnum[PAID, DUE, VOID, OVERDUE, DRAFT, SENT,OPEN, CANCELLED, PARTIALLY_PAID, SUBMITTED, VALIDATED, APPROVED, ACCOUNTED, NOT_SPECIFIED]

Invoice entries

Model ID: accounting_invoice_lineItems

FieldTypeDescription
lineItemslist[InvoiceLineItem]

InvoiceLineItem

FieldTypeDescription
lineItemIdString
itemIdString
itemCodeString
itemNameString
descriptionString
taxRateIdString
accountIdString
taxAmountDouble
totalAmountDouble
quantityDouble
unitRateDouble
discountAmountDouble
discountPercentageDouble
trackingCategoriesList[TrackingCategoryInfo]Please refer to TrackingCategory

Invoice Addresses

Model ID: accounting_invoice_addresses

FieldTypeDescription
addresseslist[Address]Please refer to Address Model

Invoice Payments

Model ID: accounting_invoice_payments

FieldTypeDescription
paymentslist[PaymentLineItem]

PaymentLineItem

FieldTypeDescription
idString
amountDouble
referenceNumberString
discountDouble
modeEnum[CASH , CHEQUE, ELECTRONIC_TRANSFER, NOT_SPECIFIED]
invoiceIdString
invoiceNumberString
paymentLinkedToEnum[INVOICE, BILL, NOT_SPECIFIED]

Event Data Example

{
  "info": {
    "id": "0d93e033-6548-40ea-bdfd-e551b85f5d7e",
    "invoiceNumber": "INV-101",
    "createdAt": "2024-05-20T00:00:00Z",
    "updatedAt": "2024-05-20T11:08:49Z",
    "type": "INVOICE",
    "issueDate": "2024-05-20T00:00:00Z",
    "dueDate": "2024-05-22T00:00:00Z",
    "paidOnDate": "2024-05-20T00:00:00Z",
    "totalAmount": 1100,
    "remainingAmount": 0,
    "totalDiscount": null,
    "totalTax": 100,
    "contactId": "65a3f750-de4c-463a-85b1-f04a3a37b45a",
    "companyId": "ac19c8f9-a901-4db3-bef1-5aaca2a7c15a",
    "description": null,
    "currency": null,
    "exchangeRate": null,
    "status": "PAID"
  },
  "lineItems": [
    {
      "lineItemId": "3a9701e4-5f9b-4ee7-8474-daa6d5887d6e",
      "itemId": null,
      "itemCode": "T02",
      "itemName": null,
      "description": "This is black t shirt",
      "taxRateId": "NONE",
      "accountId": "4200",
      "taxAmount": 100,
      "totalAmount": 1100,
      "quantity": 10,
      "unitRate": 120,
      "discountAmount": 100,
      "discountPercentage": 8.33,
      "trackingCategories": [
        {
          "categoryId": "2340d-cdwwr",
          "categoryName": "ASIA",
          "parentCategoryId": "a12302-2334",
          "parentCategoryName": "Region"
        }
      ]
    }
  ],
  "addresses": [
    {
      "addressLine1": "72/1A Church Street",
      "addressLine2": "Texas USA",
      "city": "Texas",
      "state": "Atlanta",
      "country": "USA",
      "zipCode": "20203939",
      "addressType": "BILLING"
    },
    {
      "addressLine1": "72/1A",
      "addressLine2": "USA",
      "city": "Texas",
      "state": "Atlanta",
      "country": "USA",
      "zipCode": "20203939",
      "addressType": "SHIPPING"
    }
  ],
  "payments": [
    {
      "id": "eeedd617-d2c4-4d8c-96f9-69eeeb62b1e6",
      "amount": 1100,
      "referenceNumber": null,
      "discount": null,
      "mode": "CASH",
      "paymentLinkedTo": "INVOICE",
      "invoiceId": "0d93e033-6548-40ea-bdfd-e551b85f5d7e",
      "invoiceNumber": "INV-101"
    }
  ]
}