curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"legal_name": "<string>",
"tin": "<string>",
"phone_number": "<string>",
"sms_enabled": true,
"sms_categorization_start_date": "2023-11-07T05:31:56Z",
"activation_at": "2023-11-07T05:31:56Z",
"internal_bank_account_ids": [
{
"unit_id": "<string>",
"account_name": "My Unit account",
"opening_balance_init_to_zero": true,
"opening_balance_do_not_init": true
}
],
"unit_ids": [
{
"unit_id": "<string>",
"account_name": "My Unit account",
"opening_balance_init_to_zero": true,
"opening_balance_do_not_init": true
}
],
"plaid_items": [
{
"item_id": "<string>",
"access_token": "<string>",
"sync_transactions": true,
"institution_plaid_id": "<string>"
}
],
"plaid_processor_tokens": [
{
"processor_token": "<string>"
}
],
"skip_onboarding": true,
"industry": "<string>",
"naics_code": "<string>",
"stripe_connect_accounts": [
{
"stripe_id": "<string>"
}
]
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses"
payload = {
"external_id": "<string>",
"legal_name": "<string>",
"tin": "<string>",
"phone_number": "<string>",
"sms_enabled": True,
"sms_categorization_start_date": "2023-11-07T05:31:56Z",
"activation_at": "2023-11-07T05:31:56Z",
"internal_bank_account_ids": [
{
"unit_id": "<string>",
"account_name": "My Unit account",
"opening_balance_init_to_zero": True,
"opening_balance_do_not_init": True
}
],
"unit_ids": [
{
"unit_id": "<string>",
"account_name": "My Unit account",
"opening_balance_init_to_zero": True,
"opening_balance_do_not_init": True
}
],
"plaid_items": [
{
"item_id": "<string>",
"access_token": "<string>",
"sync_transactions": True,
"institution_plaid_id": "<string>"
}
],
"plaid_processor_tokens": [{ "processor_token": "<string>" }],
"skip_onboarding": True,
"industry": "<string>",
"naics_code": "<string>",
"stripe_connect_accounts": [{ "stripe_id": "<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({
external_id: '<string>',
legal_name: '<string>',
tin: '<string>',
phone_number: '<string>',
sms_enabled: true,
sms_categorization_start_date: '2023-11-07T05:31:56Z',
activation_at: '2023-11-07T05:31:56Z',
internal_bank_account_ids: [
{
unit_id: '<string>',
account_name: 'My Unit account',
opening_balance_init_to_zero: true,
opening_balance_do_not_init: true
}
],
unit_ids: [
{
unit_id: '<string>',
account_name: 'My Unit account',
opening_balance_init_to_zero: true,
opening_balance_do_not_init: true
}
],
plaid_items: [
{
item_id: '<string>',
access_token: '<string>',
sync_transactions: true,
institution_plaid_id: '<string>'
}
],
plaid_processor_tokens: [{processor_token: '<string>'}],
skip_onboarding: true,
industry: '<string>',
naics_code: '<string>',
stripe_connect_accounts: [{stripe_id: '<string>'}]
})
};
fetch('https://sandbox.layerfi.com/v1/businesses', 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",
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([
'external_id' => '<string>',
'legal_name' => '<string>',
'tin' => '<string>',
'phone_number' => '<string>',
'sms_enabled' => true,
'sms_categorization_start_date' => '2023-11-07T05:31:56Z',
'activation_at' => '2023-11-07T05:31:56Z',
'internal_bank_account_ids' => [
[
'unit_id' => '<string>',
'account_name' => 'My Unit account',
'opening_balance_init_to_zero' => true,
'opening_balance_do_not_init' => true
]
],
'unit_ids' => [
[
'unit_id' => '<string>',
'account_name' => 'My Unit account',
'opening_balance_init_to_zero' => true,
'opening_balance_do_not_init' => true
]
],
'plaid_items' => [
[
'item_id' => '<string>',
'access_token' => '<string>',
'sync_transactions' => true,
'institution_plaid_id' => '<string>'
]
],
'plaid_processor_tokens' => [
[
'processor_token' => '<string>'
]
],
'skip_onboarding' => true,
'industry' => '<string>',
'naics_code' => '<string>',
'stripe_connect_accounts' => [
[
'stripe_id' => '<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"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"tin\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"sms_enabled\": true,\n \"sms_categorization_start_date\": \"2023-11-07T05:31:56Z\",\n \"activation_at\": \"2023-11-07T05:31:56Z\",\n \"internal_bank_account_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"unit_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"plaid_items\": [\n {\n \"item_id\": \"<string>\",\n \"access_token\": \"<string>\",\n \"sync_transactions\": true,\n \"institution_plaid_id\": \"<string>\"\n }\n ],\n \"plaid_processor_tokens\": [\n {\n \"processor_token\": \"<string>\"\n }\n ],\n \"skip_onboarding\": true,\n \"industry\": \"<string>\",\n \"naics_code\": \"<string>\",\n \"stripe_connect_accounts\": [\n {\n \"stripe_id\": \"<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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"tin\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"sms_enabled\": true,\n \"sms_categorization_start_date\": \"2023-11-07T05:31:56Z\",\n \"activation_at\": \"2023-11-07T05:31:56Z\",\n \"internal_bank_account_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"unit_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"plaid_items\": [\n {\n \"item_id\": \"<string>\",\n \"access_token\": \"<string>\",\n \"sync_transactions\": true,\n \"institution_plaid_id\": \"<string>\"\n }\n ],\n \"plaid_processor_tokens\": [\n {\n \"processor_token\": \"<string>\"\n }\n ],\n \"skip_onboarding\": true,\n \"industry\": \"<string>\",\n \"naics_code\": \"<string>\",\n \"stripe_connect_accounts\": [\n {\n \"stripe_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses")
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 \"external_id\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"tin\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"sms_enabled\": true,\n \"sms_categorization_start_date\": \"2023-11-07T05:31:56Z\",\n \"activation_at\": \"2023-11-07T05:31:56Z\",\n \"internal_bank_account_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"unit_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"plaid_items\": [\n {\n \"item_id\": \"<string>\",\n \"access_token\": \"<string>\",\n \"sync_transactions\": true,\n \"institution_plaid_id\": \"<string>\"\n }\n ],\n \"plaid_processor_tokens\": [\n {\n \"processor_token\": \"<string>\"\n }\n ],\n \"skip_onboarding\": true,\n \"industry\": \"<string>\",\n \"naics_code\": \"<string>\",\n \"stripe_connect_accounts\": [\n {\n \"stripe_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "Business",
"external_id": "test-acme-id",
"legal_name": "ACME LLC",
"tin": "<string>",
"us_state": "AL",
"country": "AF",
"entity_type": "SOLE_PROP",
"industry": "<string>",
"phone_number": "+16504651359",
"naics_code": "484110",
"sms_enabled": true,
"sms_stopped": true,
"sms_categorization_start_date": "2023-11-07T05:31:56Z",
"activation_at": "2023-11-07T05:31:56Z",
"imported_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"unit_accounts": [
{
"id": "111111",
"importedAt": "2023-11-07T05:31:56Z"
}
],
"plaid_items": [
{
"accessToken": "access-sandbox-a67d0be8-abcd-1234-5678-14fc7bc65366",
"institution": {
"id": "ins_1",
"name": "Bank of America",
"logo": "iVBORw0KGgoAAAANSUhEUgAAAJgAAACYCAMAAAAvHNATAAAA6lBMVEUAAAD////////////////////////////////////////////////////////////////////////////////qUmn74ubnNVD4xc398fLlJkT1qLTf4+zpRFzrYHb509rvfY7xjJuAkLTzmqfxi5vzmai/x9lBWY7v8fXtb4LjGDftboIhPXwBIWkRL3P3t8D2t8HsYHbvfo7P1ePzmqigrMeQnr3oRF1RZphhdaGQnb0xS4Wfq8dgdKHuboL609lwgqtgdaFwgqqvutCfrMevudCQ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AAASUVORK5CYII="
},
"itemId": "V3jvONy9xbroJVaRnm6oiAqVMv5Qz3TrNyLdL",
"syncTransactions": true
}
],
"plaid_processor_tokens": [
{
"processor_token": "processor-sandbox-d8e791d1-1234-9876-a207-69acca316045"
}
],
"previously_imported": true,
"stripe_connect_accounts": [
{}
],
"default_reporting_basis": "CASH"
}Create business
Creates a new business in Layer. This endpoint is idempotent using the external_id field as the idempotency key, so subsequent requests with the same external_id will update or no-op.
curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "<string>",
"legal_name": "<string>",
"tin": "<string>",
"phone_number": "<string>",
"sms_enabled": true,
"sms_categorization_start_date": "2023-11-07T05:31:56Z",
"activation_at": "2023-11-07T05:31:56Z",
"internal_bank_account_ids": [
{
"unit_id": "<string>",
"account_name": "My Unit account",
"opening_balance_init_to_zero": true,
"opening_balance_do_not_init": true
}
],
"unit_ids": [
{
"unit_id": "<string>",
"account_name": "My Unit account",
"opening_balance_init_to_zero": true,
"opening_balance_do_not_init": true
}
],
"plaid_items": [
{
"item_id": "<string>",
"access_token": "<string>",
"sync_transactions": true,
"institution_plaid_id": "<string>"
}
],
"plaid_processor_tokens": [
{
"processor_token": "<string>"
}
],
"skip_onboarding": true,
"industry": "<string>",
"naics_code": "<string>",
"stripe_connect_accounts": [
{
"stripe_id": "<string>"
}
]
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses"
payload = {
"external_id": "<string>",
"legal_name": "<string>",
"tin": "<string>",
"phone_number": "<string>",
"sms_enabled": True,
"sms_categorization_start_date": "2023-11-07T05:31:56Z",
"activation_at": "2023-11-07T05:31:56Z",
"internal_bank_account_ids": [
{
"unit_id": "<string>",
"account_name": "My Unit account",
"opening_balance_init_to_zero": True,
"opening_balance_do_not_init": True
}
],
"unit_ids": [
{
"unit_id": "<string>",
"account_name": "My Unit account",
"opening_balance_init_to_zero": True,
"opening_balance_do_not_init": True
}
],
"plaid_items": [
{
"item_id": "<string>",
"access_token": "<string>",
"sync_transactions": True,
"institution_plaid_id": "<string>"
}
],
"plaid_processor_tokens": [{ "processor_token": "<string>" }],
"skip_onboarding": True,
"industry": "<string>",
"naics_code": "<string>",
"stripe_connect_accounts": [{ "stripe_id": "<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({
external_id: '<string>',
legal_name: '<string>',
tin: '<string>',
phone_number: '<string>',
sms_enabled: true,
sms_categorization_start_date: '2023-11-07T05:31:56Z',
activation_at: '2023-11-07T05:31:56Z',
internal_bank_account_ids: [
{
unit_id: '<string>',
account_name: 'My Unit account',
opening_balance_init_to_zero: true,
opening_balance_do_not_init: true
}
],
unit_ids: [
{
unit_id: '<string>',
account_name: 'My Unit account',
opening_balance_init_to_zero: true,
opening_balance_do_not_init: true
}
],
plaid_items: [
{
item_id: '<string>',
access_token: '<string>',
sync_transactions: true,
institution_plaid_id: '<string>'
}
],
plaid_processor_tokens: [{processor_token: '<string>'}],
skip_onboarding: true,
industry: '<string>',
naics_code: '<string>',
stripe_connect_accounts: [{stripe_id: '<string>'}]
})
};
fetch('https://sandbox.layerfi.com/v1/businesses', 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",
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([
'external_id' => '<string>',
'legal_name' => '<string>',
'tin' => '<string>',
'phone_number' => '<string>',
'sms_enabled' => true,
'sms_categorization_start_date' => '2023-11-07T05:31:56Z',
'activation_at' => '2023-11-07T05:31:56Z',
'internal_bank_account_ids' => [
[
'unit_id' => '<string>',
'account_name' => 'My Unit account',
'opening_balance_init_to_zero' => true,
'opening_balance_do_not_init' => true
]
],
'unit_ids' => [
[
'unit_id' => '<string>',
'account_name' => 'My Unit account',
'opening_balance_init_to_zero' => true,
'opening_balance_do_not_init' => true
]
],
'plaid_items' => [
[
'item_id' => '<string>',
'access_token' => '<string>',
'sync_transactions' => true,
'institution_plaid_id' => '<string>'
]
],
'plaid_processor_tokens' => [
[
'processor_token' => '<string>'
]
],
'skip_onboarding' => true,
'industry' => '<string>',
'naics_code' => '<string>',
'stripe_connect_accounts' => [
[
'stripe_id' => '<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"
payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"tin\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"sms_enabled\": true,\n \"sms_categorization_start_date\": \"2023-11-07T05:31:56Z\",\n \"activation_at\": \"2023-11-07T05:31:56Z\",\n \"internal_bank_account_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"unit_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"plaid_items\": [\n {\n \"item_id\": \"<string>\",\n \"access_token\": \"<string>\",\n \"sync_transactions\": true,\n \"institution_plaid_id\": \"<string>\"\n }\n ],\n \"plaid_processor_tokens\": [\n {\n \"processor_token\": \"<string>\"\n }\n ],\n \"skip_onboarding\": true,\n \"industry\": \"<string>\",\n \"naics_code\": \"<string>\",\n \"stripe_connect_accounts\": [\n {\n \"stripe_id\": \"<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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"tin\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"sms_enabled\": true,\n \"sms_categorization_start_date\": \"2023-11-07T05:31:56Z\",\n \"activation_at\": \"2023-11-07T05:31:56Z\",\n \"internal_bank_account_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"unit_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"plaid_items\": [\n {\n \"item_id\": \"<string>\",\n \"access_token\": \"<string>\",\n \"sync_transactions\": true,\n \"institution_plaid_id\": \"<string>\"\n }\n ],\n \"plaid_processor_tokens\": [\n {\n \"processor_token\": \"<string>\"\n }\n ],\n \"skip_onboarding\": true,\n \"industry\": \"<string>\",\n \"naics_code\": \"<string>\",\n \"stripe_connect_accounts\": [\n {\n \"stripe_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses")
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 \"external_id\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"tin\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"sms_enabled\": true,\n \"sms_categorization_start_date\": \"2023-11-07T05:31:56Z\",\n \"activation_at\": \"2023-11-07T05:31:56Z\",\n \"internal_bank_account_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"unit_ids\": [\n {\n \"unit_id\": \"<string>\",\n \"account_name\": \"My Unit account\",\n \"opening_balance_init_to_zero\": true,\n \"opening_balance_do_not_init\": true\n }\n ],\n \"plaid_items\": [\n {\n \"item_id\": \"<string>\",\n \"access_token\": \"<string>\",\n \"sync_transactions\": true,\n \"institution_plaid_id\": \"<string>\"\n }\n ],\n \"plaid_processor_tokens\": [\n {\n \"processor_token\": \"<string>\"\n }\n ],\n \"skip_onboarding\": true,\n \"industry\": \"<string>\",\n \"naics_code\": \"<string>\",\n \"stripe_connect_accounts\": [\n {\n \"stripe_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "Business",
"external_id": "test-acme-id",
"legal_name": "ACME LLC",
"tin": "<string>",
"us_state": "AL",
"country": "AF",
"entity_type": "SOLE_PROP",
"industry": "<string>",
"phone_number": "+16504651359",
"naics_code": "484110",
"sms_enabled": true,
"sms_stopped": true,
"sms_categorization_start_date": "2023-11-07T05:31:56Z",
"activation_at": "2023-11-07T05:31:56Z",
"imported_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"unit_accounts": [
{
"id": "111111",
"importedAt": "2023-11-07T05:31:56Z"
}
],
"plaid_items": [
{
"accessToken": "access-sandbox-a67d0be8-abcd-1234-5678-14fc7bc65366",
"institution": {
"id": "ins_1",
"name": "Bank of America",
"logo": "iVBORw0KGgoAAAANSUhEUgAAAJgAAACYCAMAAAAvHNATAAAA6lBMVEUAAAD////////////////////////////////////////////////////////////////////////////////qUmn74ubnNVD4xc398fLlJkT1qLTf4+zpRFzrYHb509rvfY7xjJuAkLTzmqfxi5vzmai/x9lBWY7v8fXtb4LjGDftboIhPXwBIWkRL3P3t8D2t8HsYHbvfo7P1ePzmqigrMeQnr3oRF1RZphhdaGQnb0xS4Wfq8dgdKHuboL609lwgqtgdaFwgqqvutCfrMevudCQnr5BWY/pQ11RZpeQnb70qLRRZ5f98fO30r7oAAAAFHRSTlMA3yDvv0AQn2DPcFCAoJAwf4+vXxXsOc8AAAYDSURBVHhe7ZwHcus4EESZo5L9h1nROfvnvDmn+19nvevvoqimQAKgRFTtvguwa7pnIEIgNFmM0DtwLV/X6V903bLcQWCPtR4ZB65v0jZ8N7B7EGUHFmhCTCvYZ+kc+8Ck1uhuqO0FUNWM6e7cVGdikhC6Z+yyWK5J4ri7kmZbJIllKyILsbo21ABZShjqTKhDJo7WEaFOnaJ73ZTrkAAV/AxNAhQomnNAO+JAKmmGTjtDl7DzmUk7xBS2c0I7ZiIWL5d2jiuiy6c94BuqxB5bQBVdqEwVXahMFV2oTA1diN52EfBpz/jtlLm0d1zhea/AGuBRLzxrDL5JvWA2tKYDDalIax5QbxwoEjAkVGOyIqajxgRDDhUxEgmbOlKxzpxQ7wxqk08KYKiRfMRSpGCIDcIsIiVLZpMkWfEyn13eZ9Il67Rg6Sq6+kJ0+o1cybpM2PN5frVG8jKVKVm3LZku31W0XQprcztvybiIqnWL5ddyT6hIUXSabnbAfF1bVMSS418nXrLVY6zyFxsPz6p1E7DUlJgVacQqTFwk65Zyl80WjX4cXW0yO61qS6/XhXMOkJH2hMmf88cBAXWDsuWXRSYc/5BESK+TTW0v7quGz09SEsEGJ6W1JZcxyTPi6smLn89qtZWeNvVhlhYxT1+OW8k6uru9vfvzzZSAItrshJiQ7DTK/5Edt/cyoEam390+8Qtqo3jd0vwE0x6Xi3wraQH8sNgmq+T8jOp4G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ikSMGSgyMhHhrR3hkp87I/4GsBozf8/FNcN9T/5V/+SBPWvlUAMv5eP/RWZZ0NHE2HQ47xn4/V8PY76Fwohzoh2xMjR5PD0ndgYatIYO+jOQyiXEkXTQ60jnE4HxwDK1Z+f6t8LaNn/mQse0VC1bhI1RDvUhMh3jj00uVWNbG0vhEOdS5Wj7Y9xy6t9e7p3eOhv1+S7Qb9XNdvBwLWs8vpo33JHXig9Rv8G+MxS+LqktYUAAAAASUVORK5CYII="
},
"itemId": "V3jvONy9xbroJVaRnm6oiAqVMv5Qz3TrNyLdL",
"syncTransactions": true
}
],
"plaid_processor_tokens": [
{
"processor_token": "processor-sandbox-d8e791d1-1234-9876-a207-69acca316045"
}
],
"previously_imported": true,
"stripe_connect_accounts": [
{}
],
"default_reporting_basis": "CASH"
}Response Status Codes
- 201 Created - A new business was successfully created
- 200 OK - An existing business was found and returned:
- Archived business with matching phone number was unarchived
- Non-archived business with matching external ID was found
- 400 Bad Request - Phone number matches an existing non-archived business with a different external ID
previously_imported: true when an existing business is returned.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Content-Type must be set to application/json
Body
Unique ID of the business in your system for linking purposes. Idempotency key.
Legal name of the business as it has been registered.
Tax Identification Number for the business.
The state this business is incorporated in.
AL, AK, AZ, AR, CA, CO, CT, DE, DC, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, PR, RI, SC, SD, TN, TX, UT, VT, VI, VA, WA, WV, WI, WY 2 letter ISO country code representing the country this business is incorporated in. Defaults to US.
AF, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IL, IT, JM, JP, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, ME, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RS, RW, SH, KN, LC, PM, VC, WS, SM, ST, SA, SN, SC, SL, SG, SK, SI, SB, SO, ZA, GS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW Entity type of the business. Used to determine tax filing status.
SOLE_PROP, C_CORP, LLC, S_CORP, PARTNERSHIP, NON_PROFIT, TRUST Phone number used for SMS based categorization.
Whether SMS is enabled for this business
Date when SMS categorization starts for this business.
The activation timestamp represents the time at which Layer should begin displaying accounting data. Data before this time will not be displayed to users. This field is important for businesses migrating over from other accounting platforms. Defaults to Jan 1 of the current year.
List of internal bank account identifiers to associate with this business.
Show child attributes
Show child attributes
List of unit account identifiers to associate with this business.
Show child attributes
Show child attributes
Plaid items to link to this business.
Show child attributes
Show child attributes
Plaid processor tokens to link to this business.
Show child attributes
Show child attributes
Whether to skip the onboarding process for this business.
Industry classification for the business.
6-digit NAICS code used to identify the business's industry.
List of Stripe Connect accounts associated with this business.
Show child attributes
Show child attributes
Default accounting basis for financial reports.
CASH, ACCRUAL Response
An existing business was found and returned. This occurs when an archived business with matching phone number was unarchived, or a non-archived business with matching external ID was found. The response includes previously_imported: true when an existing business is returned.
Unique identifier for the business.
Resource type. Value will be “Business”.
"Business"
Unique ID of the business in your system for linking purposes. Idempotency key.
"test-acme-id"
Legal name of the business as it has been registered.
"ACME LLC"
Tax Identification Number for the business.
The state this business is incorporated in.
AL, AK, AZ, AR, CA, CO, CT, DE, DC, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, PR, RI, SC, SD, TN, TX, UT, VT, VI, VA, WA, WV, WI, WY 2 letter ISO country code representing the country this business is incorporated in. Defaults to US.
AF, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IL, IT, JM, JP, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, ME, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RS, RW, SH, KN, LC, PM, VC, WS, SM, ST, SA, SN, SC, SL, SG, SK, SI, SB, SO, ZA, GS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW Entity type of the business. Used to determine tax filing status.
SOLE_PROP, C_CORP, LLC, S_CORP, PARTNERSHIP, NON_PROFIT, TRUST Industry classification for the business.
Phone number used for SMS based categorization.
"+16504651359"
6-digit NAICS code used to identify the business's industry.
"484110"
Whether SMS is enabled for this business
Whether this business has responded to Layer's SMS with "STOP"
Date when SMS categorization starts for this business.
The activation timestamp represents the time at which Layer should begin displaying accounting data. Data before this time will not be displayed to users. This field is important for businesses migrating over from other accounting platforms. Defaults to Jan 1 of the current year.
Time when the business entity was created in Layer. Eligible sort key.
Time when the business's information was last updated in Layer. Eligible sort key.
Time when the business was archived, if applicable.
List of unit accounts associated with this business.
Show child attributes
Show child attributes
Plaid items linked to this account.
Show child attributes
Show child attributes
Plaid processor tokens linked to this account
Show child attributes
Show child attributes
True if an archived business with the same phone number was unarchived during creation.
List of Stripe Connect accounts associated with this business.
Default accounting basis for financial reports.
CASH, ACCRUAL