curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entry_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"memo": "<string>",
"line_items": [
{
"account_identifier": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"amount": 123,
"external_id": "<string>",
"memo": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_external_id": "<string>",
"vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_external_id": "<string>",
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
]
}
],
"external_id": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_external_id": "<string>",
"vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_external_id": "<string>",
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
],
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/"
payload = {
"entry_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"memo": "<string>",
"line_items": [
{
"account_identifier": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"amount": 123,
"external_id": "<string>",
"memo": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_external_id": "<string>",
"vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_external_id": "<string>",
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
]
}
],
"external_id": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_external_id": "<string>",
"vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_external_id": "<string>",
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
],
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entry_at: '2023-11-07T05:31:56Z',
created_by: '<string>',
memo: '<string>',
line_items: [
{
account_identifier: {type: 'AccountId', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
amount: 123,
external_id: '<string>',
memo: '<string>',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_external_id: '<string>',
vendor_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
vendor_external_id: '<string>',
tags: [
{
key: 'department',
value: 'sales',
dimension_display_name: 'Department',
value_display_name: 'Sales Department'
}
]
}
],
external_id: '<string>',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_external_id: '<string>',
vendor_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
vendor_external_id: '<string>',
tags: [
{
key: 'department',
value: 'sales',
dimension_display_name: 'Department',
value_display_name: 'Sales Department'
}
],
metadata: {
custom_field: 'value',
'any valid json': 'below 1kb',
nested: {'meaning of life': 42, array: []}
},
reference_number: '<string>'
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entry_at' => '2023-11-07T05:31:56Z',
'created_by' => '<string>',
'memo' => '<string>',
'line_items' => [
[
'account_identifier' => [
'type' => 'AccountId',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'amount' => 123,
'external_id' => '<string>',
'memo' => '<string>',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer_external_id' => '<string>',
'vendor_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'vendor_external_id' => '<string>',
'tags' => [
[
'key' => 'department',
'value' => 'sales',
'dimension_display_name' => 'Department',
'value_display_name' => 'Sales Department'
]
]
]
],
'external_id' => '<string>',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer_external_id' => '<string>',
'vendor_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'vendor_external_id' => '<string>',
'tags' => [
[
'key' => 'department',
'value' => 'sales',
'dimension_display_name' => 'Department',
'value_display_name' => 'Sales Department'
]
],
'metadata' => [
'custom_field' => 'value',
'any valid json' => 'below 1kb',
'nested' => [
'meaning of life' => 42,
'array' => [
]
]
],
'reference_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/"
payload := strings.NewReader("{\n \"entry_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"<string>\",\n \"memo\": \"<string>\",\n \"line_items\": [\n {\n \"account_identifier\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"amount\": 123,\n \"external_id\": \"<string>\",\n \"memo\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ],\n \"external_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"metadata\": {\n \"custom_field\": \"value\",\n \"any valid json\": \"below 1kb\",\n \"nested\": {\n \"meaning of life\": 42,\n \"array\": []\n }\n },\n \"reference_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entry_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"<string>\",\n \"memo\": \"<string>\",\n \"line_items\": [\n {\n \"account_identifier\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"amount\": 123,\n \"external_id\": \"<string>\",\n \"memo\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ],\n \"external_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"metadata\": {\n \"custom_field\": \"value\",\n \"any valid json\": \"below 1kb\",\n \"nested\": {\n \"meaning of life\": 42,\n \"array\": []\n }\n },\n \"reference_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entry_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"<string>\",\n \"memo\": \"<string>\",\n \"line_items\": [\n {\n \"account_identifier\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"amount\": 123,\n \"external_id\": \"<string>\",\n \"memo\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ],\n \"external_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"metadata\": {\n \"custom_field\": \"value\",\n \"any valid json\": \"below 1kb\",\n \"nested\": {\n \"meaning of life\": 42,\n \"array\": []\n }\n },\n \"reference_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "<string>",
"memo": "<string>",
"entry_id": "<string>",
"entry": {
"type": "Ledger_Entry",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledger_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-11-07T05:31:56Z",
"entry_at": "2023-11-07T05:31:56Z",
"reversal_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reversal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": {
"type": "Single_Chart_Account",
"id": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "Current Assets",
"account_number": "4000",
"stable_name": {
"type": "StableName",
"stable_name": "CURRENT_ASSETS"
},
"account_type": {
"display_name": "Asset"
},
"account_subtype": {
"display_name": "Current Assets"
}
},
"amount": 123,
"entry_at": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
},
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
],
"type": "Custom_Journal_Entry_With_Entry_Details",
"external_id": "<string>",
"customer": {
"type": "CustomerData",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "31415926535",
"individual_name": "<string>",
"company_name": "<string>",
"email": "<string>",
"mobile_phone": "<string>",
"office_phone": "<string>",
"address_string": "<string>",
"memo": "<string>",
"status": "ACTIVE",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
},
"vendor": {
"type": "VendorData",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"individual_name": "<string>",
"company_name": "<string>",
"email": "<string>",
"mobile_phone": "<string>",
"office_phone": "<string>",
"address_string": "<string>",
"memo": "<string>",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
},
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_item_id": "<string>",
"external_id": "<string>",
"memo": "<string>",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
}
],
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "<string>",
"memo": "<string>",
"entry_id": "<string>",
"entry": {
"type": "Ledger_Entry",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledger_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-11-07T05:31:56Z",
"entry_at": "2023-11-07T05:31:56Z",
"reversal_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reversal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": {
"type": "Single_Chart_Account",
"id": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "Current Assets",
"account_number": "4000",
"stable_name": {
"type": "StableName",
"stable_name": "CURRENT_ASSETS"
},
"account_type": {
"display_name": "Asset"
},
"account_subtype": {
"display_name": "Current Assets"
}
},
"amount": 123,
"entry_at": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
},
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
],
"type": "Custom_Journal_Entry_With_Entry_Details",
"external_id": "<string>",
"customer": {
"type": "CustomerData",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "31415926535",
"individual_name": "<string>",
"company_name": "<string>",
"email": "<string>",
"mobile_phone": "<string>",
"office_phone": "<string>",
"address_string": "<string>",
"memo": "<string>",
"status": "ACTIVE",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
},
"vendor": {
"type": "VendorData",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"individual_name": "<string>",
"company_name": "<string>",
"email": "<string>",
"mobile_phone": "<string>",
"office_phone": "<string>",
"address_string": "<string>",
"memo": "<string>",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
},
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_item_id": "<string>",
"external_id": "<string>",
"memo": "<string>",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
}
],
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
}Create custom journal entry
Creates a new custom journal entry for the specified business. The credits and debits must balance.
curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entry_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"memo": "<string>",
"line_items": [
{
"account_identifier": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"amount": 123,
"external_id": "<string>",
"memo": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_external_id": "<string>",
"vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_external_id": "<string>",
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
]
}
],
"external_id": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_external_id": "<string>",
"vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_external_id": "<string>",
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
],
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/"
payload = {
"entry_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"memo": "<string>",
"line_items": [
{
"account_identifier": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"amount": 123,
"external_id": "<string>",
"memo": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_external_id": "<string>",
"vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_external_id": "<string>",
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
]
}
],
"external_id": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_external_id": "<string>",
"vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_external_id": "<string>",
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
],
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entry_at: '2023-11-07T05:31:56Z',
created_by: '<string>',
memo: '<string>',
line_items: [
{
account_identifier: {type: 'AccountId', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
amount: 123,
external_id: '<string>',
memo: '<string>',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_external_id: '<string>',
vendor_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
vendor_external_id: '<string>',
tags: [
{
key: 'department',
value: 'sales',
dimension_display_name: 'Department',
value_display_name: 'Sales Department'
}
]
}
],
external_id: '<string>',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_external_id: '<string>',
vendor_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
vendor_external_id: '<string>',
tags: [
{
key: 'department',
value: 'sales',
dimension_display_name: 'Department',
value_display_name: 'Sales Department'
}
],
metadata: {
custom_field: 'value',
'any valid json': 'below 1kb',
nested: {'meaning of life': 42, array: []}
},
reference_number: '<string>'
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entry_at' => '2023-11-07T05:31:56Z',
'created_by' => '<string>',
'memo' => '<string>',
'line_items' => [
[
'account_identifier' => [
'type' => 'AccountId',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'amount' => 123,
'external_id' => '<string>',
'memo' => '<string>',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer_external_id' => '<string>',
'vendor_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'vendor_external_id' => '<string>',
'tags' => [
[
'key' => 'department',
'value' => 'sales',
'dimension_display_name' => 'Department',
'value_display_name' => 'Sales Department'
]
]
]
],
'external_id' => '<string>',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer_external_id' => '<string>',
'vendor_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'vendor_external_id' => '<string>',
'tags' => [
[
'key' => 'department',
'value' => 'sales',
'dimension_display_name' => 'Department',
'value_display_name' => 'Sales Department'
]
],
'metadata' => [
'custom_field' => 'value',
'any valid json' => 'below 1kb',
'nested' => [
'meaning of life' => 42,
'array' => [
]
]
],
'reference_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/"
payload := strings.NewReader("{\n \"entry_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"<string>\",\n \"memo\": \"<string>\",\n \"line_items\": [\n {\n \"account_identifier\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"amount\": 123,\n \"external_id\": \"<string>\",\n \"memo\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ],\n \"external_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"metadata\": {\n \"custom_field\": \"value\",\n \"any valid json\": \"below 1kb\",\n \"nested\": {\n \"meaning of life\": 42,\n \"array\": []\n }\n },\n \"reference_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entry_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"<string>\",\n \"memo\": \"<string>\",\n \"line_items\": [\n {\n \"account_identifier\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"amount\": 123,\n \"external_id\": \"<string>\",\n \"memo\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ],\n \"external_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"metadata\": {\n \"custom_field\": \"value\",\n \"any valid json\": \"below 1kb\",\n \"nested\": {\n \"meaning of life\": 42,\n \"array\": []\n }\n },\n \"reference_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-journal-entries/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entry_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"<string>\",\n \"memo\": \"<string>\",\n \"line_items\": [\n {\n \"account_identifier\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"amount\": 123,\n \"external_id\": \"<string>\",\n \"memo\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ],\n \"external_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_external_id\": \"<string>\",\n \"vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_external_id\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"metadata\": {\n \"custom_field\": \"value\",\n \"any valid json\": \"below 1kb\",\n \"nested\": {\n \"meaning of life\": 42,\n \"array\": []\n }\n },\n \"reference_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "<string>",
"memo": "<string>",
"entry_id": "<string>",
"entry": {
"type": "Ledger_Entry",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledger_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-11-07T05:31:56Z",
"entry_at": "2023-11-07T05:31:56Z",
"reversal_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reversal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": {
"type": "Single_Chart_Account",
"id": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "Current Assets",
"account_number": "4000",
"stable_name": {
"type": "StableName",
"stable_name": "CURRENT_ASSETS"
},
"account_type": {
"display_name": "Asset"
},
"account_subtype": {
"display_name": "Current Assets"
}
},
"amount": 123,
"entry_at": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
},
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
],
"type": "Custom_Journal_Entry_With_Entry_Details",
"external_id": "<string>",
"customer": {
"type": "CustomerData",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "31415926535",
"individual_name": "<string>",
"company_name": "<string>",
"email": "<string>",
"mobile_phone": "<string>",
"office_phone": "<string>",
"address_string": "<string>",
"memo": "<string>",
"status": "ACTIVE",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
},
"vendor": {
"type": "VendorData",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"individual_name": "<string>",
"company_name": "<string>",
"email": "<string>",
"mobile_phone": "<string>",
"office_phone": "<string>",
"address_string": "<string>",
"memo": "<string>",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
},
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_item_id": "<string>",
"external_id": "<string>",
"memo": "<string>",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
}
],
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "<string>",
"memo": "<string>",
"entry_id": "<string>",
"entry": {
"type": "Ledger_Entry",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledger_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-11-07T05:31:56Z",
"entry_at": "2023-11-07T05:31:56Z",
"reversal_of_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reversal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": {
"type": "Single_Chart_Account",
"id": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "Current Assets",
"account_number": "4000",
"stable_name": {
"type": "StableName",
"stable_name": "CURRENT_ASSETS"
},
"account_type": {
"display_name": "Asset"
},
"account_subtype": {
"display_name": "Current Assets"
}
},
"amount": 123,
"entry_at": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
},
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
],
"type": "Custom_Journal_Entry_With_Entry_Details",
"external_id": "<string>",
"customer": {
"type": "CustomerData",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "31415926535",
"individual_name": "<string>",
"company_name": "<string>",
"email": "<string>",
"mobile_phone": "<string>",
"office_phone": "<string>",
"address_string": "<string>",
"memo": "<string>",
"status": "ACTIVE",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
},
"vendor": {
"type": "VendorData",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"individual_name": "<string>",
"company_name": "<string>",
"email": "<string>",
"mobile_phone": "<string>",
"office_phone": "<string>",
"address_string": "<string>",
"memo": "<string>",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
},
"line_items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_item_id": "<string>",
"external_id": "<string>",
"memo": "<string>",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
]
}
],
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Content-Type must be set to application/json.
Path Parameters
The UUID of the business to create the custom journal entry for.
Body
When the journal entry should be recorded effective in the ledger.
Identifier of the user or system that created the journal entry.
Description or memo of the journal entry.
Line items for the journal entry. The credits and debits must balance.
Show child attributes
Show child attributes
External ID for the journal entry within your platform. Idempotency key.
ID of the customer to associate with the journal entry.
External ID of the customer to associate with the journal entry.
ID of the vendor to associate with the journal entry.
External ID of the vendor to associate with the journal entry.
Tags to associate with the journal entry.
Show child attributes
Show child attributes
Arbitrary custom metadata in JSON format with a size limit of 1KB.
{ "custom_field": "value", "any valid json": "below 1kb", "nested": { "meaning of life": 42, "array": [] } }
Any (typically user-visible) identifier you would like to associate with the custom journal entry. Can be used to filter when listing custom journal entries.
Response
Entry already exists and matches provided data.
Show child attributes
Show child attributes