curl --request POST \
--url https://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fiscal_year_id": "<string>",
"lines": [
{
"accounting_account_id": "<string>",
"amount": 2,
"label": "<string>"
}
],
"reference": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances"
payload = {
"fiscal_year_id": "<string>",
"lines": [
{
"accounting_account_id": "<string>",
"amount": 2,
"label": "<string>"
}
],
"reference": "<string>",
"description": "<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({
fiscal_year_id: '<string>',
lines: [{accounting_account_id: '<string>', amount: 2, label: '<string>'}],
reference: '<string>',
description: '<string>'
})
};
fetch('https://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances', 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.exowpee.com/v1/accounting/client/journal-entries/opening-balances",
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([
'fiscal_year_id' => '<string>',
'lines' => [
[
'accounting_account_id' => '<string>',
'amount' => 2,
'label' => '<string>'
]
],
'reference' => '<string>',
'description' => '<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://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances"
payload := strings.NewReader("{\n \"fiscal_year_id\": \"<string>\",\n \"lines\": [\n {\n \"accounting_account_id\": \"<string>\",\n \"amount\": 2,\n \"label\": \"<string>\"\n }\n ],\n \"reference\": \"<string>\",\n \"description\": \"<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://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fiscal_year_id\": \"<string>\",\n \"lines\": [\n {\n \"accounting_account_id\": \"<string>\",\n \"amount\": 2,\n \"label\": \"<string>\"\n }\n ],\n \"reference\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances")
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 \"fiscal_year_id\": \"<string>\",\n \"lines\": [\n {\n \"accounting_account_id\": \"<string>\",\n \"amount\": 2,\n \"label\": \"<string>\"\n }\n ],\n \"reference\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner_type": "<string>",
"journal_id": "<string>",
"fiscal_period_id": "<string>",
"accounting_date": "2023-12-25",
"reference": "<string>",
"description": "<string>",
"source_type": "<string>",
"source_id": "<string>",
"source_event": "<string>",
"metadata": {},
"currency_code": "<string>",
"currency_exponent": 123,
"status": "<string>",
"reversal_of_entry_id": "<string>",
"refund_of_entry_id": "<string>",
"posted_at": "2023-11-07T05:31:56Z",
"lines": "<array>",
"attachments_count": 123,
"attachments": "<array>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Post opening balances (client account)
Client space, on the client account’s own books. Records the opening balances of a fiscal year (balance sheet accounts only) as a single entry dated on the first day of the year.
curl --request POST \
--url https://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fiscal_year_id": "<string>",
"lines": [
{
"accounting_account_id": "<string>",
"amount": 2,
"label": "<string>"
}
],
"reference": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances"
payload = {
"fiscal_year_id": "<string>",
"lines": [
{
"accounting_account_id": "<string>",
"amount": 2,
"label": "<string>"
}
],
"reference": "<string>",
"description": "<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({
fiscal_year_id: '<string>',
lines: [{accounting_account_id: '<string>', amount: 2, label: '<string>'}],
reference: '<string>',
description: '<string>'
})
};
fetch('https://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances', 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.exowpee.com/v1/accounting/client/journal-entries/opening-balances",
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([
'fiscal_year_id' => '<string>',
'lines' => [
[
'accounting_account_id' => '<string>',
'amount' => 2,
'label' => '<string>'
]
],
'reference' => '<string>',
'description' => '<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://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances"
payload := strings.NewReader("{\n \"fiscal_year_id\": \"<string>\",\n \"lines\": [\n {\n \"accounting_account_id\": \"<string>\",\n \"amount\": 2,\n \"label\": \"<string>\"\n }\n ],\n \"reference\": \"<string>\",\n \"description\": \"<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://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fiscal_year_id\": \"<string>\",\n \"lines\": [\n {\n \"accounting_account_id\": \"<string>\",\n \"amount\": 2,\n \"label\": \"<string>\"\n }\n ],\n \"reference\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/accounting/client/journal-entries/opening-balances")
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 \"fiscal_year_id\": \"<string>\",\n \"lines\": [\n {\n \"accounting_account_id\": \"<string>\",\n \"amount\": 2,\n \"label\": \"<string>\"\n }\n ],\n \"reference\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner_type": "<string>",
"journal_id": "<string>",
"fiscal_period_id": "<string>",
"accounting_date": "2023-12-25",
"reference": "<string>",
"description": "<string>",
"source_type": "<string>",
"source_id": "<string>",
"source_event": "<string>",
"metadata": {},
"currency_code": "<string>",
"currency_exponent": 123,
"status": "<string>",
"reversal_of_entry_id": "<string>",
"refund_of_entry_id": "<string>",
"posted_at": "2023-11-07T05:31:56Z",
"lines": "<array>",
"attachments_count": 123,
"attachments": "<array>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}journal_entries.create
Conditions
- The accounting module must be included in the plan of the organization.
- In the client space the book is always the client account’s own book.
- The book must be set up for accounting (it must have at least one journal).
- fiscal_year_id must be a fiscal year of the selected book.
- There must be at least two lines with distinct accounts, positive whole amounts, equal total debits and credits, and postable accounts of the book.
- Only balance sheet accounts (classes 1 to 5) are accepted; an account of class 6, 7 or 8 is refused.
- The fiscal period containing the first day of the year must not be closed.
- The opening entry of a year is identified by the year: sending the same content again returns the entry already posted, while a different content for the same year is refused as a conflict.
- Posts one entry with status posted, dated the first day of the fiscal year, in the miscellaneous operations journal, with source type opening_balances and the year as source.
- The entry takes the currency of the fiscal year. No transaction fee is computed.
- Applies the book’s active analytic allocation rules to the lines, when rules match.
- When a business rule refuses the post on an organization or company book, a posting incident is recorded.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, owner_type, journal_id, fiscal_period_id, accounting_date, reference, description, source_type, source_id, source_event, metadata, currency_code, currency_exponent, status, reversal_of_entry_id, refund_of_entry_id, posted_at, created_at, updated_at, attachments_count.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: lines, lines.account, attachments.
Body
Identifier of the fiscal year (27-character KSUID) whose opening balances are recorded; it must belong to the selected book. The entry is dated the first day of that year.
Lines of the entry. At least two are required; the total of debit amounts must equal the total of credit amounts. Only balance sheet accounts (classes 1 to 5) are accepted.
2Show child attributes
Show child attributes
Optional free-text reference of the entry.
Optional free-text description of the entry.
Response
Resource (only with response=resource).
Identifier of the journal entry (27-character KSUID).
Kind of book the entry belongs to: organization, company or client.
Identifier of the journal the entry is posted in (27-character KSUID).
Identifier of the fiscal period covering the accounting date, set by the server (27-character KSUID).
Date the entry counts for in the books (YYYY-MM-DD).
Free-text reference given at posting, or copied from the original entry on a reversal; null when none.
Free-text description given at posting; on a reversal, a text naming the original entry; null when none.
Kind of record that generated the entry (for example reversal, opening_balances or recurring_entry, or a business flow); null for a manual entry.
Identifier of the record that generated the entry; null for a manual entry.
Event of the source record that generated the entry (for example reversed, opening or run: for a recurring occurrence); null for a manual entry.
Extra data stored by automatic postings, such as fee snapshots or the company identifier; null for most manual entries.
ISO 4217 currency code of the entry, taken from the fiscal year (for example XOF).
Number of decimal places of the currency (0 for XOF). An amount in minor units divided by 10 to this power gives the amount in the currency.
State of the entry: posted (in force), reversed (cancelled by a reversal entry) or refunded (refunded by a refund entry).
When the entry is a reversal, the identifier of the entry it cancels; otherwise null.
When the entry is a refund, the identifier of the entry it refunds; otherwise null.
Moment the entry was posted, ISO 8601, set by the server.
Debit and credit lines of the entry. Present only when requested with include=lines; amounts are integers in minor units (divide by 10 to the power currency_exponent).
Number of supporting documents attached to the entry.
Supporting documents of the entry. Present only when requested with include=attachments and the caller holds the entry_attachments.list permission.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).