Credit
Overview
Credit is a type of financial records that are applicable only when a balance is tracked for each customer in addition to transactional invoices and payments. Changes that impact the balance are considered credits.
Specifically, changes that credit the balance are considered credit issuance. Those that debit the balance are considered credit applicable. In some cases, where the issuance and application happens at the same time (e.g. a correction to an unpaid invoice), Leapfin considers the records as credit adjustment.
Discount vs Credit
Discount and Credit are similar in that they both reduce the amount of invoice. Sometime teams refer to those terms interchangeably without consistent definitions.
On Leapfin Platform, discount and credit are distinguished by whether its financial impact should be tracked independently of the invoices. If yes, then we consider it a Credit, otherwise a Discount.
For example, merchant offers $10 off for customer to use in future invoice.
- If merchant considers this $10 as money owned to customer, then Leapfin will create a Credit.
- If merchant considers this $10 has no value until it is applied to an invoice, then Leapfin will create a Discount.
Create a Credit
The following fields are required
objectType
: type of financial record. For Credit, the value is "credit".id
: unique identifier of this record. This is external id received by Leapfin.amount
: amount of the credit. The amount should be non-negative. The direction of the credit (i.e. the financial impact of the credit amount) is derived from thetype
field.currencyCode
: 3-digit ISO code ofamount
field, e.g. “USD”, "GBP", etc. This is the primary currency of this record.date
: the date-time of when this credit was issued or applied.type
: the type of credit. Acceptable values are:- "issuance": credit is issued to customers.
- "application": credit is consumed as payment to an invoice.
- "adjustment": credit is given to an unpaid invoice to represent an adjustment.
The following fields are optional but are commonly needed for creating journal entries
description
: description of the Credit.startDate
: the date-time when the credit becomes available.endDate
: the date-time when the credit expires.exchangeRates
: a list of exchange rates used to calculate currency conversionscurrencyCode
: 3-digit ISO code, e.g. “USD”, "GBP", etc. This is the target currency of this recordrate
: 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.objectType
: type of the target financial record, e.g. "line-item"id
: unique identifier of the target financial record
customFields
: additional fields (i.e. key-value pairs) related to this record
Sample Data
{
"objectType": "credit",
"id": "credit_001",
"type": "issuance",
"amount": 10,
"currencyCode": "USD",
"description": "a sample credit issuance",
"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": "line-item",
"id": "lineitem_001"
}
],
"customFields": {
"field1": "value1",
"field2": "value2"
}
}
Query a Credit
Credit records are stored in VW_FT_CREDIT
table. It can be accessed via Snowflake Data Sharing and Access.
Column | Description |
---|---|
LEAPFIN_ID | unique identifier created by Leapfin. |
DECODED_LEAPFIN_ID_VT | decoded version of LEAPFIN_ID in JSON format. It contains the following values: - external_code : unique identifier of this record. This is an external id received by Leapfin.- integration_id : unique identifier of the data source. This is an internal id created by Leapfin.- leapfin_data_type : type of financial record, i.e. "LeapfinCredit"- 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_ID | Unique identifier for your account |
DATE_DT | the date-time of when this credit was issued or applied. |
DESCRIPTION | description of the Credit |
CURRENCY_CODE | 3-digit ISO code of AMOUNT field, e.g. “USD”, "GBP", etc. This is the primary currency of this record. |
AMOUNT | amount of the credit. The amount should be non-negative. The direction of the credit (i.e. the financial impact of the credit amount) is derived from the TYPE field. |
TYPE | The type of credit. Acceptable values are: - "issuance": this is representing the credit is being issued. - "application": represents this credit object is being used. - "adjustment" represents this credit object is an adjustment of credits. |
START_DATE_DT | the date when the credit becomes available. |
END_DATE_DT | the date when the credit expires. |
EXCHANGE_RATES_VT | a 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_VT | additional fields (i.e. key-value pairs) about the financial record in json format |
ACCOUNTING_TRANSACTIONS_VT | a 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. |
CREATED_AT_DT | the date-time when the financial record is created by Leapfin. Value format: "2022-07-14 23:01:26.400" |
UPDATED_AT_DT | the date-time when the financial record is last updated by Leapfin. Value format: "2022-09-01 06:09:57.379" |
Updated 12 months ago