Archive journal entry
Archives the given journal entry. Drafts are archived directly; posted entries are reversed and marked as archived.
curl --request POST \
--url https://api.light.inc/v1/journal-entries/{journalEntryId}/archive \
--header 'Authorization: <api-key>'import requests
url = "https://api.light.inc/v1/journal-entries/{journalEntryId}/archive"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.light.inc/v1/journal-entries/{journalEntryId}/archive', 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/{journalEntryId}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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.light.inc/v1/journal-entries/{journalEntryId}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
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/{journalEntryId}/archive")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/journal-entries/{journalEntryId}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
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",
"ledgerName": "PRIMARY",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentSequenceId": "<string>",
"status": "DRAFT",
"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>",
"type": "BAD_REQUEST",
"errors": [
{
"type": "<string>",
"message": "<string>",
"path": [
"<string>"
],
"context": {}
}
]
},
"lines": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"journalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"netTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"grossTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"taxTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"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,
"dcSign": "D"
},
"totalTaxTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"totalGrossTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"multiJournalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
Headers
Path Parameters
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/{journalEntryId}/archive \
--header 'Authorization: <api-key>'import requests
url = "https://api.light.inc/v1/journal-entries/{journalEntryId}/archive"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.light.inc/v1/journal-entries/{journalEntryId}/archive', 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/{journalEntryId}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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.light.inc/v1/journal-entries/{journalEntryId}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
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/{journalEntryId}/archive")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.light.inc/v1/journal-entries/{journalEntryId}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
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",
"ledgerName": "PRIMARY",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"documentSequenceId": "<string>",
"status": "DRAFT",
"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>",
"type": "BAD_REQUEST",
"errors": [
{
"type": "<string>",
"message": "<string>",
"path": [
"<string>"
],
"context": {}
}
]
},
"lines": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"journalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"netTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"grossTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"taxTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"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,
"dcSign": "D"
},
"totalTaxTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"totalGrossTransactionAmount": {
"amount": 123,
"dcSign": "D"
},
"multiJournalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}