Refund
Overview
Refund is a type of financial records representing cash returns from payment processor to customer for a processed payment.
Cash Refund vs Credit Refund
On Leapfin Platform, Refund records refer to cash refund only. When payments are refunded as credits, Leapfin creates Credit records with
type
as "issuance".
Refund are commonly initiated against a particular payment. In some cases (not always), the refund can be attributed towards one or more particular line items, taxes or discounts. When such attribution is available, Leapfin recommends to include a link from the Refund record to each associated record, so that accounting schedules on those records can be adjusted accordingly.
Creating a Refund
The following fields are required :
objectType
: type of financial record. For Refund, the value is "refund".id
: unique identifier of this record. This is an external id received by Leapfin.amount
: amount of the refund. The amount should be non-negative.currencyCode
: 3-digit ISO code ofamount
field, e.g. “USD”, "GBP", etc. This is the primary currency of this recordstatus
: current status of the payment. Acceptable values are:- "succeeded": the refund is successfully processed.
- "failed": the refund failed during processing.
- "pending": the refund has been initiated but still being processed.
date
: the date-time of when this refund is created by payment processor.
The following fields are optional but are commonly needed for creating journal entries.
description
: general description of the refundexchangeRates
: 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 Event to other financial records. Refund is commonly linked to Payment.objectType
: type of the target financial record, e.g. "payment"id
: the unique identifier of the target financial record
customFields
: additional fields (i.e. key-value pairs) related to this record
Sample Data
{
"objectType": "refund",
"id": "refund_001",
"amount": 538.29,
"currencyCode": "USD",
"status": "succeeded",
"description": "a sample refund object",
"date": "2021-02-17T20:00:01",
"exchangeRates": [
{
"currencyCode": "EUR",
"rate": 0.84
},
{
"currencyCode": "GBP",
"rate": 0.73
}
],
"links": [
{
"objectType": "payment",
"id": "payment_001"
}
],
"customFields": {
"field1": "value1",
"field2": "value2"
}
}
Query a Refund
Event records are stored in VW_FT_PAYMENT
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 : the unique identifier of this record. This is an 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. "LeapfinRefund"- 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 of the account. This is an internal id created by Leapfin. |
DATE_DT | the date of when this refund is created by payment processor. |
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 refund. The amount should be non-negative. |
STATUS | current status of the payment. Acceptable values are: - "succeeded": the refund is successfully processed. - "failed": the refund failed during processing. - "pending": the refund has been initiated but still being processed. |
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 : the unique identifier of the financial account. This is an internal id created by Leapfin (refer to VW_LK_ACCOUNT).--- amount : the 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 11 months ago