Get general ledger report
curl --request GET \
--url https://api.example.com/api/reports/general-ledger \
--header 'Authorization: <authorization>' \
--header 'accept: <accept>' \
--header 'organization-id: <organization-id>'import requests
url = "https://api.example.com/api/reports/general-ledger"
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"accept": "<accept>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
accept: '<accept>'
}
};
fetch('https://api.example.com/api/reports/general-ledger', 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://api.example.com/api/reports/general-ledger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"accept: <accept>",
"organization-id: <organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/reports/general-ledger"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
req.Header.Add("accept", "<accept>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/reports/general-ledger")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("accept", "<accept>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/reports/general-ledger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["accept"] = '<accept>'
response = http.request(request)
puts response.read_body{
"query": {
"fromDate": "<string>",
"toDate": "<string>",
"numberFormat": {
"precision": 2,
"divideOn1000": false,
"showZero": true,
"formatMoney": "total",
"negativeFormat": "parentheses"
},
"noneZero": true,
"accountsIds": [
123
]
},
"data": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"index": 123,
"openingBalance": {
"amount": 123,
"formattedAmount": "<string>",
"currencyCode": "<string>",
"date": {}
},
"transactions": [
{
"date": "<string>",
"dateFormatted": "<string>",
"referenceType": "<string>",
"referenceId": 123,
"transactionTypeFormatted": "<string>",
"contactName": "<string>",
"contactType": "<string>",
"transactionType": "<string>",
"index": 123,
"credit": 123,
"debit": 123,
"amount": 123,
"runningBalance": 123,
"formattedAmount": "<string>",
"formattedCredit": "<string>",
"formattedDebit": "<string>",
"formattedRunningBalance": "<string>",
"currencyCode": "<string>",
"transactionNumber": "<string>",
"note": "<string>"
}
],
"closingBalance": {
"amount": 123,
"formattedAmount": "<string>",
"currencyCode": "<string>",
"date": {}
},
"parentAccountId": 123
}
],
"meta": {
"organizationName": "<string>",
"baseCurrency": "<string>",
"dateFormat": "<string>",
"isCostComputeRunning": true,
"sheetName": "<string>",
"formattedFromDate": "<string>",
"formattedToDate": "<string>",
"formattedDateRange": "<string>"
}
}Reports
Get general ledger report
GET
/
api
/
reports
/
general-ledger
Get general ledger report
curl --request GET \
--url https://api.example.com/api/reports/general-ledger \
--header 'Authorization: <authorization>' \
--header 'accept: <accept>' \
--header 'organization-id: <organization-id>'import requests
url = "https://api.example.com/api/reports/general-ledger"
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"accept": "<accept>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
accept: '<accept>'
}
};
fetch('https://api.example.com/api/reports/general-ledger', 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://api.example.com/api/reports/general-ledger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"accept: <accept>",
"organization-id: <organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/reports/general-ledger"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
req.Header.Add("accept", "<accept>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/reports/general-ledger")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("accept", "<accept>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/reports/general-ledger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["accept"] = '<accept>'
response = http.request(request)
puts response.read_body{
"query": {
"fromDate": "<string>",
"toDate": "<string>",
"numberFormat": {
"precision": 2,
"divideOn1000": false,
"showZero": true,
"formatMoney": "total",
"negativeFormat": "parentheses"
},
"noneZero": true,
"accountsIds": [
123
]
},
"data": [
{
"id": 123,
"name": "<string>",
"code": "<string>",
"index": 123,
"openingBalance": {
"amount": 123,
"formattedAmount": "<string>",
"currencyCode": "<string>",
"date": {}
},
"transactions": [
{
"date": "<string>",
"dateFormatted": "<string>",
"referenceType": "<string>",
"referenceId": 123,
"transactionTypeFormatted": "<string>",
"contactName": "<string>",
"contactType": "<string>",
"transactionType": "<string>",
"index": 123,
"credit": 123,
"debit": 123,
"amount": 123,
"runningBalance": 123,
"formattedAmount": "<string>",
"formattedCredit": "<string>",
"formattedDebit": "<string>",
"formattedRunningBalance": "<string>",
"currencyCode": "<string>",
"transactionNumber": "<string>",
"note": "<string>"
}
],
"closingBalance": {
"amount": 123,
"formattedAmount": "<string>",
"currencyCode": "<string>",
"date": {}
},
"parentAccountId": 123
}
],
"meta": {
"organizationName": "<string>",
"baseCurrency": "<string>",
"dateFormat": "<string>",
"isCostComputeRunning": true,
"sheetName": "<string>",
"formattedFromDate": "<string>",
"formattedToDate": "<string>",
"formattedDateRange": "<string>"
}
}Headers
Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.
Example:
"Bearer bc_1234567890abcdef"
Required if Authorization is a JWT token. The organization ID to operate within.
Query Parameters
Accounting basis for the report (e.g., cash, accrual)
Example:
"accrual"
Number of decimal places to display
Example:
2
Whether to divide the number by 1000
Example:
false
Whether to show zero values
Example:
true
How to format money values
Available options:
total, always, none Example:
"total"
How to format negative numbers
Available options:
parentheses, mines Example:
"parentheses"
Whether to exclude transactions from the report
Example:
false
Array of account IDs to filter the report
Example:
[1, 2, 3]
⌘I