Import transactions
curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-accounts/{customAccountId}/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"external_id": "custom-transaction-id-1234",
"amount": 123,
"date": "2023-11-07T05:31:56Z",
"merchant_name": "My example merchant",
"merchant_category_code": "4072",
"description": "Original description",
"display_description": "Current description to display with details",
"currency_code": "USD",
"balance": 123,
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
],
"memo": "<string>",
"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-accounts/{customAccountId}/transactions"
payload = { "transactions": [
{
"external_id": "custom-transaction-id-1234",
"amount": 123,
"date": "2023-11-07T05:31:56Z",
"merchant_name": "My example merchant",
"merchant_category_code": "4072",
"description": "Original description",
"display_description": "Current description to display with details",
"currency_code": "USD",
"balance": 123,
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
],
"memo": "<string>",
"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({
transactions: [
{
external_id: 'custom-transaction-id-1234',
amount: 123,
date: '2023-11-07T05:31:56Z',
merchant_name: 'My example merchant',
merchant_category_code: '4072',
description: 'Original description',
display_description: 'Current description to display with details',
currency_code: 'USD',
balance: 123,
tags: [
{
key: 'department',
value: 'sales',
dimension_display_name: 'Department',
value_display_name: 'Sales Department'
}
],
memo: '<string>',
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-accounts/{customAccountId}/transactions', 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-accounts/{customAccountId}/transactions",
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([
'transactions' => [
[
'external_id' => 'custom-transaction-id-1234',
'amount' => 123,
'date' => '2023-11-07T05:31:56Z',
'merchant_name' => 'My example merchant',
'merchant_category_code' => '4072',
'description' => 'Original description',
'display_description' => 'Current description to display with details',
'currency_code' => 'USD',
'balance' => 123,
'tags' => [
[
'key' => 'department',
'value' => 'sales',
'dimension_display_name' => 'Department',
'value_display_name' => 'Sales Department'
]
],
'memo' => '<string>',
'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-accounts/{customAccountId}/transactions"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"external_id\": \"custom-transaction-id-1234\",\n \"amount\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"merchant_name\": \"My example merchant\",\n \"merchant_category_code\": \"4072\",\n \"description\": \"Original description\",\n \"display_description\": \"Current description to display with details\",\n \"currency_code\": \"USD\",\n \"balance\": 123,\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"memo\": \"<string>\",\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 }\n ]\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-accounts/{customAccountId}/transactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"external_id\": \"custom-transaction-id-1234\",\n \"amount\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"merchant_name\": \"My example merchant\",\n \"merchant_category_code\": \"4072\",\n \"description\": \"Original description\",\n \"display_description\": \"Current description to display with details\",\n \"currency_code\": \"USD\",\n \"balance\": 123,\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"memo\": \"<string>\",\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 }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-accounts/{customAccountId}/transactions")
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 \"transactions\": [\n {\n \"external_id\": \"custom-transaction-id-1234\",\n \"amount\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"merchant_name\": \"My example merchant\",\n \"merchant_category_code\": \"4072\",\n \"description\": \"Original description\",\n \"display_description\": \"Current description to display with details\",\n \"currency_code\": \"USD\",\n \"balance\": 123,\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"memo\": \"<string>\",\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 }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "{}"
}""""Bank Transactions
Import transactions
Imports transactions for a custom account. This action will import transactions from the specified start date to the present. If the account has already been imported, this action will overwrite the existing transactions.
POST
/
v1
/
businesses
/
{businessId}
/
custom-accounts
/
{customAccountId}
/
transactions
Import transactions
curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-accounts/{customAccountId}/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"external_id": "custom-transaction-id-1234",
"amount": 123,
"date": "2023-11-07T05:31:56Z",
"merchant_name": "My example merchant",
"merchant_category_code": "4072",
"description": "Original description",
"display_description": "Current description to display with details",
"currency_code": "USD",
"balance": 123,
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
],
"memo": "<string>",
"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-accounts/{customAccountId}/transactions"
payload = { "transactions": [
{
"external_id": "custom-transaction-id-1234",
"amount": 123,
"date": "2023-11-07T05:31:56Z",
"merchant_name": "My example merchant",
"merchant_category_code": "4072",
"description": "Original description",
"display_description": "Current description to display with details",
"currency_code": "USD",
"balance": 123,
"tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
],
"memo": "<string>",
"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({
transactions: [
{
external_id: 'custom-transaction-id-1234',
amount: 123,
date: '2023-11-07T05:31:56Z',
merchant_name: 'My example merchant',
merchant_category_code: '4072',
description: 'Original description',
display_description: 'Current description to display with details',
currency_code: 'USD',
balance: 123,
tags: [
{
key: 'department',
value: 'sales',
dimension_display_name: 'Department',
value_display_name: 'Sales Department'
}
],
memo: '<string>',
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-accounts/{customAccountId}/transactions', 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-accounts/{customAccountId}/transactions",
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([
'transactions' => [
[
'external_id' => 'custom-transaction-id-1234',
'amount' => 123,
'date' => '2023-11-07T05:31:56Z',
'merchant_name' => 'My example merchant',
'merchant_category_code' => '4072',
'description' => 'Original description',
'display_description' => 'Current description to display with details',
'currency_code' => 'USD',
'balance' => 123,
'tags' => [
[
'key' => 'department',
'value' => 'sales',
'dimension_display_name' => 'Department',
'value_display_name' => 'Sales Department'
]
],
'memo' => '<string>',
'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-accounts/{customAccountId}/transactions"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"external_id\": \"custom-transaction-id-1234\",\n \"amount\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"merchant_name\": \"My example merchant\",\n \"merchant_category_code\": \"4072\",\n \"description\": \"Original description\",\n \"display_description\": \"Current description to display with details\",\n \"currency_code\": \"USD\",\n \"balance\": 123,\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"memo\": \"<string>\",\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 }\n ]\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-accounts/{customAccountId}/transactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"external_id\": \"custom-transaction-id-1234\",\n \"amount\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"merchant_name\": \"My example merchant\",\n \"merchant_category_code\": \"4072\",\n \"description\": \"Original description\",\n \"display_description\": \"Current description to display with details\",\n \"currency_code\": \"USD\",\n \"balance\": 123,\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"memo\": \"<string>\",\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 }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-accounts/{customAccountId}/transactions")
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 \"transactions\": [\n {\n \"external_id\": \"custom-transaction-id-1234\",\n \"amount\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"merchant_name\": \"My example merchant\",\n \"merchant_category_code\": \"4072\",\n \"description\": \"Original description\",\n \"display_description\": \"Current description to display with details\",\n \"currency_code\": \"USD\",\n \"balance\": 123,\n \"tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ],\n \"memo\": \"<string>\",\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 }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "{}"
}""""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 import transactions for.
The UUID of the custom account to import transactions for.
Body
application/json
List of new transactions to import
Show child attributes
Show child attributes
Response
Resource type. Value will be 'com.layerfi.controllers.EmptyResponse'.
Example:
"{}"
āI