Create journal entry
Creates a new journal entry
curl --request POST \
--url https://api.light.inc/v1/journal-entries \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"description": "<string>",
"currency": "USD",
"postingDate": "2023-12-25",
"valuationDate": "2023-12-25",
"localCurrencyFxRateOverride": 123,
"groupCurrencyFxRateOverride": 123,
"documentDate": "2023-12-25",
"areLinesWithTax": true,
"lines": [
{
"netTransactionAmount": {
"amount": 123
},
"grossTransactionAmount": {
"amount": 123
},
"taxAmount": {
"amount": 123
},
"description": "<string>",
"targetCompanyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationStartDate": "2023-12-25",
"amortizationEndDate": "2023-12-25",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
]
}
],
"businessPartnerName": "<string>",
"businessPartnerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shouldPost": true,
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
]
}
'import requests
url = "https://api.light.inc/v1/journal-entries"
payload = {
"companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"description": "<string>",
"currency": "USD",
"postingDate": "2023-12-25",
"valuationDate": "2023-12-25",
"localCurrencyFxRateOverride": 123,
"groupCurrencyFxRateOverride": 123,
"documentDate": "2023-12-25",
"areLinesWithTax": True,
"lines": [
{
"netTransactionAmount": { "amount": 123 },
"grossTransactionAmount": { "amount": 123 },
"taxAmount": { "amount": 123 },
"description": "<string>",
"targetCompanyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationStartDate": "2023-12-25",
"amortizationEndDate": "2023-12-25",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
]
}
],
"businessPartnerName": "<string>",
"businessPartnerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shouldPost": True,
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({
companyEntityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
documentNumber: '<string>',
description: '<string>',
currency: 'USD',
postingDate: '2023-12-25',
valuationDate: '2023-12-25',
localCurrencyFxRateOverride: 123,
groupCurrencyFxRateOverride: 123,
documentDate: '2023-12-25',
areLinesWithTax: true,
lines: [
{
netTransactionAmount: {amount: 123},
grossTransactionAmount: {amount: 123},
taxAmount: {amount: 123},
description: '<string>',
targetCompanyEntityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ledgerTaxId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ledgerAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
costCenterId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amortizationTemplateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amortizationStartDate: '2023-12-25',
amortizationEndDate: '2023-12-25',
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
]
}
],
businessPartnerName: '<string>',
businessPartnerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
shouldPost: true,
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
]
})
};
fetch('https://api.light.inc/v1/journal-entries', 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.light.inc/v1/journal-entries",
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([
'companyEntityId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'documentNumber' => '<string>',
'description' => '<string>',
'currency' => 'USD',
'postingDate' => '2023-12-25',
'valuationDate' => '2023-12-25',
'localCurrencyFxRateOverride' => 123,
'groupCurrencyFxRateOverride' => 123,
'documentDate' => '2023-12-25',
'areLinesWithTax' => true,
'lines' => [
[
'netTransactionAmount' => [
'amount' => 123
],
'grossTransactionAmount' => [
'amount' => 123
],
'taxAmount' => [
'amount' => 123
],
'description' => '<string>',
'targetCompanyEntityId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ledgerTaxId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ledgerAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'costCenterId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amortizationTemplateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amortizationStartDate' => '2023-12-25',
'amortizationEndDate' => '2023-12-25',
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
]
]
],
'businessPartnerName' => '<string>',
'businessPartnerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'shouldPost' => true,
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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.light.inc/v1/journal-entries"
payload := strings.NewReader("{\n \"companyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"documentNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"postingDate\": \"2023-12-25\",\n \"valuationDate\": \"2023-12-25\",\n \"localCurrencyFxRateOverride\": 123,\n \"groupCurrencyFxRateOverride\": 123,\n \"documentDate\": \"2023-12-25\",\n \"areLinesWithTax\": true,\n \"lines\": [\n {\n \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"targetCompanyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationStartDate\": \"2023-12-25\",\n \"amortizationEndDate\": \"2023-12-25\",\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"businessPartnerName\": \"<string>\",\n \"businessPartnerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"shouldPost\": true,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
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.light.inc/v1/journal-entries")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"companyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"documentNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"postingDate\": \"2023-12-25\",\n \"valuationDate\": \"2023-12-25\",\n \"localCurrencyFxRateOverride\": 123,\n \"groupCurrencyFxRateOverride\": 123,\n \"documentDate\": \"2023-12-25\",\n \"areLinesWithTax\": true,\n \"lines\": [\n {\n \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"targetCompanyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationStartDate\": \"2023-12-25\",\n \"amortizationEndDate\": \"2023-12-25\",\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"businessPartnerName\": \"<string>\",\n \"businessPartnerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"shouldPost\": true,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/journal-entries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"companyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"documentNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"postingDate\": \"2023-12-25\",\n \"valuationDate\": \"2023-12-25\",\n \"localCurrencyFxRateOverride\": 123,\n \"groupCurrencyFxRateOverride\": 123,\n \"documentDate\": \"2023-12-25\",\n \"areLinesWithTax\": true,\n \"lines\": [\n {\n \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"targetCompanyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationStartDate\": \"2023-12-25\",\n \"amortizationEndDate\": \"2023-12-25\",\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"businessPartnerName\": \"<string>\",\n \"businessPartnerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"shouldPost\": true,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentSequenceId": "<string>",
"description": "<string>",
"currency": "USD",
"postingDate": "2023-12-25",
"documentDate": "2023-12-25",
"valuationDate": "2023-12-25",
"localCurrencyFxRate": 123,
"groupCurrencyFxRate": 123,
"areLinesWithTax": true,
"failureContext": {
"name": "<string>",
"errors": [
{
"type": "<string>",
"message": "<string>",
"path": [
"<string>"
],
"context": {}
}
]
},
"lines": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"journalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"netTransactionAmount": {
"amount": 123
},
"grossTransactionAmount": {
"amount": 123
},
"taxTransactionAmount": {
"amount": 123
},
"description": "<string>",
"targetCompanyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internalName": "<string>",
"label": "<string>",
"context": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationStartDate": "2023-12-25",
"amortizationEndDate": "2023-12-25"
}
],
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internalName": "<string>",
"label": "<string>",
"context": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
],
"businessPartnerName": "<string>",
"businessPartnerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"totalNetTransactionAmount": {
"amount": 123
},
"totalTaxTransactionAmount": {
"amount": 123
},
"totalGrossTransactionAmount": {
"amount": 123
},
"multiJournalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
Headers
Body
⚠️ This enum is not exhaustive; new values may be added in the future.
PRIMARY, ELIMINATION "USD"
Custom foreign exchange rate for the ledger's local currency. If not provided, Light uses official ECB rates
Custom foreign exchange rate for the ledger's group currency. If not provided, Light uses official ECB rates
Show child attributes
Show child attributes
List of custom properties to set on the vendor. Replaces the existing set.
Show child attributes
Show child attributes
Response
default response
⚠️ This enum is not exhaustive; new values may be added in the future.
PRIMARY, ELIMINATION ⚠️ This enum is not exhaustive; new values may be added in the future.
DRAFT, APPROVAL_PENDING, APPROVED, POSTED, PARTIALLY_CLEARED, CLEARED, ARCHIVED "USD"
Custom foreign exchange rate for the ledger's local currency. If not provided, Light uses official ECB rates
Custom foreign exchange rate for the ledger's group currency. If not provided, Light uses official ECB rates
Failure context when vendor onboarding fails.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Custom properties set on the vendor.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
curl --request POST \
--url https://api.light.inc/v1/journal-entries \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"description": "<string>",
"currency": "USD",
"postingDate": "2023-12-25",
"valuationDate": "2023-12-25",
"localCurrencyFxRateOverride": 123,
"groupCurrencyFxRateOverride": 123,
"documentDate": "2023-12-25",
"areLinesWithTax": true,
"lines": [
{
"netTransactionAmount": {
"amount": 123
},
"grossTransactionAmount": {
"amount": 123
},
"taxAmount": {
"amount": 123
},
"description": "<string>",
"targetCompanyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationStartDate": "2023-12-25",
"amortizationEndDate": "2023-12-25",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
]
}
],
"businessPartnerName": "<string>",
"businessPartnerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shouldPost": true,
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"inlineValues": [
"<string>"
]
}
]
}
'import requests
url = "https://api.light.inc/v1/journal-entries"
payload = {
"companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"description": "<string>",
"currency": "USD",
"postingDate": "2023-12-25",
"valuationDate": "2023-12-25",
"localCurrencyFxRateOverride": 123,
"groupCurrencyFxRateOverride": 123,
"documentDate": "2023-12-25",
"areLinesWithTax": True,
"lines": [
{
"netTransactionAmount": { "amount": 123 },
"grossTransactionAmount": { "amount": 123 },
"taxAmount": { "amount": 123 },
"description": "<string>",
"targetCompanyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationStartDate": "2023-12-25",
"amortizationEndDate": "2023-12-25",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
]
}
],
"businessPartnerName": "<string>",
"businessPartnerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shouldPost": True,
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valueIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"inlineValues": ["<string>"]
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json;charset=UTF-8'},
body: JSON.stringify({
companyEntityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
documentNumber: '<string>',
description: '<string>',
currency: 'USD',
postingDate: '2023-12-25',
valuationDate: '2023-12-25',
localCurrencyFxRateOverride: 123,
groupCurrencyFxRateOverride: 123,
documentDate: '2023-12-25',
areLinesWithTax: true,
lines: [
{
netTransactionAmount: {amount: 123},
grossTransactionAmount: {amount: 123},
taxAmount: {amount: 123},
description: '<string>',
targetCompanyEntityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ledgerTaxId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ledgerAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
costCenterId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amortizationTemplateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amortizationStartDate: '2023-12-25',
amortizationEndDate: '2023-12-25',
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
]
}
],
businessPartnerName: '<string>',
businessPartnerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
shouldPost: true,
customProperties: [
{
groupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valueIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
inlineValues: ['<string>']
}
]
})
};
fetch('https://api.light.inc/v1/journal-entries', 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.light.inc/v1/journal-entries",
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([
'companyEntityId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'documentNumber' => '<string>',
'description' => '<string>',
'currency' => 'USD',
'postingDate' => '2023-12-25',
'valuationDate' => '2023-12-25',
'localCurrencyFxRateOverride' => 123,
'groupCurrencyFxRateOverride' => 123,
'documentDate' => '2023-12-25',
'areLinesWithTax' => true,
'lines' => [
[
'netTransactionAmount' => [
'amount' => 123
],
'grossTransactionAmount' => [
'amount' => 123
],
'taxAmount' => [
'amount' => 123
],
'description' => '<string>',
'targetCompanyEntityId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ledgerTaxId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ledgerAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'costCenterId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amortizationTemplateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amortizationStartDate' => '2023-12-25',
'amortizationEndDate' => '2023-12-25',
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
]
]
],
'businessPartnerName' => '<string>',
'businessPartnerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'shouldPost' => true,
'customProperties' => [
[
'groupId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valueIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'inlineValues' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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.light.inc/v1/journal-entries"
payload := strings.NewReader("{\n \"companyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"documentNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"postingDate\": \"2023-12-25\",\n \"valuationDate\": \"2023-12-25\",\n \"localCurrencyFxRateOverride\": 123,\n \"groupCurrencyFxRateOverride\": 123,\n \"documentDate\": \"2023-12-25\",\n \"areLinesWithTax\": true,\n \"lines\": [\n {\n \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"targetCompanyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationStartDate\": \"2023-12-25\",\n \"amortizationEndDate\": \"2023-12-25\",\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"businessPartnerName\": \"<string>\",\n \"businessPartnerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"shouldPost\": true,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
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.light.inc/v1/journal-entries")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"companyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"documentNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"postingDate\": \"2023-12-25\",\n \"valuationDate\": \"2023-12-25\",\n \"localCurrencyFxRateOverride\": 123,\n \"groupCurrencyFxRateOverride\": 123,\n \"documentDate\": \"2023-12-25\",\n \"areLinesWithTax\": true,\n \"lines\": [\n {\n \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"targetCompanyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationStartDate\": \"2023-12-25\",\n \"amortizationEndDate\": \"2023-12-25\",\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"businessPartnerName\": \"<string>\",\n \"businessPartnerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"shouldPost\": true,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/journal-entries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"companyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"documentNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"postingDate\": \"2023-12-25\",\n \"valuationDate\": \"2023-12-25\",\n \"localCurrencyFxRateOverride\": 123,\n \"groupCurrencyFxRateOverride\": 123,\n \"documentDate\": \"2023-12-25\",\n \"areLinesWithTax\": true,\n \"lines\": [\n {\n \"netTransactionAmount\": {\n \"amount\": 123\n },\n \"grossTransactionAmount\": {\n \"amount\": 123\n },\n \"taxAmount\": {\n \"amount\": 123\n },\n \"description\": \"<string>\",\n \"targetCompanyEntityId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerTaxId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ledgerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"costCenterId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationTemplateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amortizationStartDate\": \"2023-12-25\",\n \"amortizationEndDate\": \"2023-12-25\",\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"businessPartnerName\": \"<string>\",\n \"businessPartnerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"shouldPost\": true,\n \"customProperties\": [\n {\n \"groupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valueIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"inlineValues\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentNumber": "<string>",
"companyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentSequenceId": "<string>",
"description": "<string>",
"currency": "USD",
"postingDate": "2023-12-25",
"documentDate": "2023-12-25",
"valuationDate": "2023-12-25",
"localCurrencyFxRate": 123,
"groupCurrencyFxRate": 123,
"areLinesWithTax": true,
"failureContext": {
"name": "<string>",
"errors": [
{
"type": "<string>",
"message": "<string>",
"path": [
"<string>"
],
"context": {}
}
]
},
"lines": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"journalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"netTransactionAmount": {
"amount": 123
},
"grossTransactionAmount": {
"amount": 123
},
"taxTransactionAmount": {
"amount": 123
},
"description": "<string>",
"targetCompanyEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerTaxId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ledgerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"costCenterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internalName": "<string>",
"label": "<string>",
"context": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"amortizationTemplateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amortizationStartDate": "2023-12-25",
"amortizationEndDate": "2023-12-25"
}
],
"customProperties": [
{
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupInternalName": "<string>",
"companyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internalName": "<string>",
"label": "<string>",
"context": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
],
"businessPartnerName": "<string>",
"businessPartnerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"totalNetTransactionAmount": {
"amount": 123
},
"totalTaxTransactionAmount": {
"amount": 123
},
"totalGrossTransactionAmount": {
"amount": 123
},
"multiJournalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}