Line Item

Overview

Line Item is a type of financial records representing purchased goods or services on an invoice.

Though discounts, credits, and taxes are also common items on invoices, Leapfin does not consider them as Line Items. Instead, Discount, Credit and Tax records are used to represent them.

Create a Line Item

The following fields are required

  • objectType: type of financial record. For Line Item, the value is "line-item".
  • id: unique identifier of this record. This is external id received by Leapfin.
  • amount: the amount of the purchased goods or services excluding tax and discount. The value should be non-negative.
  • currencyCode: 3-digit ISO code of amount field, e.g. “USD”, "GBP", etc. This is the primary currency of this record.
  • quantity: the number of units purchased.
  • date: the date-time when this line-item is created in billing system.

The following fields are optional but are commonly needed for creating journal entries

  • discountAmount: amount of the discount associated with the line-item. The value should be non-negative.
  • description: general description of the line-item
  • startDate: for subscription item, this is the start date-time of the subscription.
  • endDate: for subscription item, this is the end date-time of the subscription.
  • exchangeRates: a list of exchange rates used to calculate currency conversions
    • currencyCode: 3-digit ISO code, e.g. “USD”, "GBP", etc. This is the target currency of this record
    • rate: conversion rate from primary currency to target currency. i.e. amount in primary currency * rate = converted amount in target currency.
  • links: directional relationships pointing from this record to other financial records. Line Item is commonly linked to Invoice.
    • objectType: type of the target financial record, e.g. "invoice"
    • id: the unique identifier of the target financial record
  • customFields: additional fields (i.e. key-value pairs) related to this record

Sample Data

{
    "objectType": "line-item",
    "id": "lineitem_001",
    "amount": 30.99,
    "discountAmount": 3.09,
    "taxAmount": 0.0,
    "currencyCode": "USD",
    "quantity": 1,
    "description": "a sample subscription line-item",
    "date": "2021-01-16T11:28:31",
    "startDate": "2021-01-20T00:00:00",
    "endDate": "2022-01-19T00:00:00",
    "exchangeRates": [
      {
        "currencyCode": "EUR",
        "rate": 0.84
      },
      {
        "currencyCode": "GBP",
        "rate": 0.73
      }
    ],
    "links": [
      {
        "objectType": "invoice",
        "id": "invoice_001"
      }
    ],
    "customFields": {
      "field1": "value1",
      "field2": "value2"
    }
}

Query a Line Item

Line Item records are stored in VW_FT_LINE_ITEM table. It can be accessed via Snowflake Data Sharing and Access.

NameDescription
LEAPFIN_IDunique identifier created by Leapfin
DECODED_LEAPFIN_ID_VTdecoded version of LEAPFIN_ID in json format. It contains the following values:

- external_code: the unique identifier of this record. This is external id received by Leapfin.
- integration_id: the unique identifier of the data source. This is an internal id created by Leapfin.
- leapfin_data_type: type of financial record, i.e. "LeapfinLineItem"
- leapfin_suffix: additional string to distinguish different financial records when the same external_code is received from the data source.
- raw_data_type: type of raw data record received from the data source.
ORGANIZATION_IDunique identifier of the account. This is an internal id created by Leapfin.
DATE_DTthe date when this line-item is created in billing system.
START_DATE_DTfor subscription item, this is the start date of the subscription.
END_DATE_DTfor subscription item, this is the end date of the subscription.
DESCRIPTIONgeneral description of the line-item
CURRENCY_CODE3-digit ISO code of AMOUNT field, e.g. “USD”, "GBP", etc. This is the primary currency of this record.
DISCOUNT_AMOUNTamount of the discount associated with the line-item. The value should be non-negative.
EXCHANGE_RATES_VTa list of exchange rates used to calculate currency conversions. Each rate contains the following values:

- currencyCode: 3-digit ISO code, e.g. “USD”, "GBP", etc. This is the target currency of this record.
- rate: conversion rate from primary currency to target currency. i.e. amount in primary currency * rate = converted amount in target currency.
CUSTOM_FIELDS_VTadditional fields (i.e. key-value pairs) about the financial record in JSON format
ACCOUNTING_TRANSACTIONS_VTa list of journal entries associated with this financial record. Each item contains the following values:

- date: the date of the journal entry
- entries: a list of journal lines within the journal entry. Each line contains the following values:
--- account: unique identifier of the financial account. This is an internal id created by Leapfin (refer to VW_LK_ACCOUNT).
--- amount: amount of money booked towards the account.
--- accountingSide: an indicator of whether the amount is a debt ("dr") or credit ("cr") to the acount.
- comments: additional fields (i.e. key-value pairs) on the journal entry in JSON format.
QUANTITYthe number of units purchased.
AMOUNTthe amount of the purchased goods or services excluding tax and discount. The value should be non-negative.
CREATED_AT_DTthe date-time when the financial record is created by Leapfin. Value format: "2022-07-14 23:01:26.400"
UPDATED_AT_DTthe date-time when the financial record is last updated by Leapfin. Value format: "2022-09-01 06:09:57.379"