Skip to main content
POST
/
v1
/
businesses
/
{businessId}
/
reports
/
tax-packets
Create tax packet
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/tax-packets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "year": 123,
  "start_date": "2023-11-07T05:31:56Z",
  "end_date": "2023-11-07T05:31:56Z",
  "include_general_ledger": true,
  "include_account_transactions": true
}
'
import requests

url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/tax-packets"

payload = {
"year": 123,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"include_general_ledger": True,
"include_account_transactions": True
}
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({
year: 123,
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
include_general_ledger: true,
include_account_transactions: true
})
};

fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/tax-packets', 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}/reports/tax-packets",
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([
'year' => 123,
'start_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'include_general_ledger' => true,
'include_account_transactions' => true
]),
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}/reports/tax-packets"

payload := strings.NewReader("{\n \"year\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"include_general_ledger\": true,\n \"include_account_transactions\": true\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}/reports/tax-packets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"year\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"include_general_ledger\": true,\n \"include_account_transactions\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/tax-packets")

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 \"year\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"include_general_ledger\": true,\n \"include_account_transactions\": true\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "type": "Tax_Packet_Request",
    "id": "<string>",
    "business_id": "<string>",
    "year": 123,
    "start_date": "2023-11-07T05:31:56Z",
    "end_date": "2023-11-07T05:31:56Z",
    "created_at": "2023-11-07T05:31:56Z",
    "completed_at": "2023-11-07T05:31:56Z",
    "download_urls": {
      "profit_and_loss": "<string>",
      "general_ledger": "<string>",
      "account_transactions": "<string>"
    }
  }
}
{
"description": "<string>",
"meta": {}
}
{
"description": "<string>",
"meta": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
string

Content-Type must be set to application/json.

Path Parameters

businessId
string
required

The UUID of the business to create the tax packet for.

Body

application/json
year
integer

Tax year for the packet (alternative to start_date/end_date).

start_date
string<date-time>

Start date for custom date range (alternative to year).

end_date
string<date-time>

End date for custom date range (alternative to year).

include_general_ledger
boolean
default:true

Whether to include general ledger details.

include_account_transactions
boolean
default:true

Whether to include account transaction details.

Response

Tax packet request created successfully.

data
object
required