Quickstart
Post a supplier invoice from the test company: submit the posting request, read its result and read the entry it produced.
On this page
You need the client credentials and the base address of your test company. The samples read them from the environment: $RDC_BASE_URL and $RDC_TOKEN. See Authentication for the token and Sandbox and live for the test company. The invoice below is AC-0094412, a packaging invoice from a supplier.
Submit the request
Choose a postingRequestId and an operationId, and send the facts of the invoice. Keep both: a request that timed out is repeated with the same two values and is accepted once.
curl
curl -X POST "$RDC_BASE_URL/accounting/v1/posting-requests" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "32a34b30-2203-436d-897c-707b3c3770bd",
"postingRequestId": "b7007a22-a9ea-4fcb-b535-e0570cdd1f2e",
"customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
"legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
"sourceDocumentId": "58572830-d5ca-43ff-bd1d-d7ca383d5c65",
"sourceDocumentType": "supplier_invoice",
"sourceRevision": 2,
"eventId": "39d59497-f6f8-4a3f-bdaa-df9d722ff44f",
"effectiveDate": "2026-10-21",
"currency": "RON",
"mappingPolicyVersion": "ro-2026.1",
"correlationId": "716186ba-fb20-458d-a36a-a97717c751c7",
"facts": [
{
"type": "document",
"number": "AC-0094412",
"date": "2026-10-21"
},
{
"type": "partner",
"name": "Ambalaje Carpatin SRL",
"vatId": "RO51603619"
},
{
"type": "amount",
"rate": "21",
"base": "4128.70",
"vat": "867.03"
},
{
"type": "total",
"gross": "4995.73"
}
]
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/accounting/v1/posting-requests`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "32a34b30-2203-436d-897c-707b3c3770bd",
"postingRequestId": "b7007a22-a9ea-4fcb-b535-e0570cdd1f2e",
"customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
"legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
"sourceDocumentId": "58572830-d5ca-43ff-bd1d-d7ca383d5c65",
"sourceDocumentType": "supplier_invoice",
"sourceRevision": 2,
"eventId": "39d59497-f6f8-4a3f-bdaa-df9d722ff44f",
"effectiveDate": "2026-10-21",
"currency": "RON",
"mappingPolicyVersion": "ro-2026.1",
"correlationId": "716186ba-fb20-458d-a36a-a97717c751c7",
"facts": [
{
"type": "document",
"number": "AC-0094412",
"date": "2026-10-21"
},
{
"type": "partner",
"name": "Ambalaje Carpatin SRL",
"vatId": "RO51603619"
},
{
"type": "amount",
"rate": "21",
"base": "4128.70",
"vat": "867.03"
},
{
"type": "total",
"gross": "4995.73"
}
]
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/accounting/v1/posting-requests',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '32a34b30-2203-436d-897c-707b3c3770bd',
'postingRequestId': 'b7007a22-a9ea-4fcb-b535-e0570cdd1f2e',
'customerOrgId': 'bdbc5b26-3f8a-4c1a-8c21-6c396293da32',
'legalCompanyId': '8373a2b0-3239-4aee-b6c8-56d7829a746d',
'sourceDocumentId': '58572830-d5ca-43ff-bd1d-d7ca383d5c65',
'sourceDocumentType': 'supplier_invoice',
'sourceRevision': 2,
'eventId': '39d59497-f6f8-4a3f-bdaa-df9d722ff44f',
'effectiveDate': '2026-10-21',
'currency': 'RON',
'mappingPolicyVersion': 'ro-2026.1',
'correlationId': '716186ba-fb20-458d-a36a-a97717c751c7',
'facts': [
{
'type': 'document',
'number': 'AC-0094412',
'date': '2026-10-21',
},
{
'type': 'partner',
'name': 'Ambalaje Carpatin SRL',
'vatId': 'RO51603619',
},
{
'type': 'amount',
'rate': '21',
'base': '4128.70',
'vat': '867.03',
},
{
'type': 'total',
'gross': '4995.73',
},
],
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "32a34b30-2203-436d-897c-707b3c3770bd",
"postingRequestId": "b7007a22-a9ea-4fcb-b535-e0570cdd1f2e",
"customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
"legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
"sourceDocumentId": "58572830-d5ca-43ff-bd1d-d7ca383d5c65",
"sourceDocumentType": "supplier_invoice",
"sourceRevision": 2,
"eventId": "39d59497-f6f8-4a3f-bdaa-df9d722ff44f",
"effectiveDate": "2026-10-21",
"currency": "RON",
"mappingPolicyVersion": "ro-2026.1",
"correlationId": "716186ba-fb20-458d-a36a-a97717c751c7",
"facts": [
{
"type": "document",
"number": "AC-0094412",
"date": "2026-10-21"
},
{
"type": "partner",
"name": "Ambalaje Carpatin SRL",
"vatId": "RO51603619"
},
{
"type": "amount",
"rate": "21",
"base": "4128.70",
"vat": "867.03"
},
{
"type": "total",
"gross": "4995.73"
}
]
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/accounting/v1/posting-requests');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/accounting/v1/posting-requests");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "32a34b30-2203-436d-897c-707b3c3770bd",
"postingRequestId": "b7007a22-a9ea-4fcb-b535-e0570cdd1f2e",
"customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
"legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
"sourceDocumentId": "58572830-d5ca-43ff-bd1d-d7ca383d5c65",
"sourceDocumentType": "supplier_invoice",
"sourceRevision": 2,
"eventId": "39d59497-f6f8-4a3f-bdaa-df9d722ff44f",
"effectiveDate": "2026-10-21",
"currency": "RON",
"mappingPolicyVersion": "ro-2026.1",
"correlationId": "716186ba-fb20-458d-a36a-a97717c751c7",
"facts": [
{
"type": "document",
"number": "AC-0094412",
"date": "2026-10-21"
},
{
"type": "partner",
"name": "Ambalaje Carpatin SRL",
"vatId": "RO51603619"
},
{
"type": "amount",
"rate": "21",
"base": "4128.70",
"vat": "867.03"
},
{
"type": "total",
"gross": "4995.73"
}
]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "32a34b30-2203-436d-897c-707b3c3770bd",
"status": "accepted",
"aggregateId": "b7007a22-a9ea-4fcb-b535-e0570cdd1f2e",
"aggregateRevision": 1
} Read the result
The 202 says the request was accepted, not that the entry exists. Look the operation up with the operationId. When status is completed, the request has been dealt with and aggregateId is the postingRequestId.
Get an operation
curl
curl "$RDC_BASE_URL/accounting/v1/operations/32a34b30-2203-436d-897c-707b3c3770bd" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/accounting/v1/operations/32a34b30-2203-436d-897c-707b3c3770bd`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/accounting/v1/operations/32a34b30-2203-436d-897c-707b3c3770bd',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/accounting/v1/operations/32a34b30-2203-436d-897c-707b3c3770bd');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/accounting/v1/operations/32a34b30-2203-436d-897c-707b3c3770bd");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "32a34b30-2203-436d-897c-707b3c3770bd",
"status": "completed",
"aggregateId": "b7007a22-a9ea-4fcb-b535-e0570cdd1f2e",
"aggregateRevision": 2
} | Status | Meaning |
|---|---|
| The request was recorded and is being applied. | |
| The change was applied. | |
| The request was refused. Nothing was changed. |
Read the posting request
The posting request has its own status. It is accepted while the invoice waits to be coded or approved, posted when the entry exists and rejected when nothing was posted. Here it is posted, and journalEntryId names the entry.
Get a posting request
curl
curl "$RDC_BASE_URL/accounting/v1/posting-requests/b7007a22-a9ea-4fcb-b535-e0570cdd1f2e" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/accounting/v1/posting-requests/b7007a22-a9ea-4fcb-b535-e0570cdd1f2e`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/accounting/v1/posting-requests/b7007a22-a9ea-4fcb-b535-e0570cdd1f2e',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/accounting/v1/posting-requests/b7007a22-a9ea-4fcb-b535-e0570cdd1f2e');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/accounting/v1/posting-requests/b7007a22-a9ea-4fcb-b535-e0570cdd1f2e");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"postingRequestId": "b7007a22-a9ea-4fcb-b535-e0570cdd1f2e",
"status": "posted",
"sourceDocumentId": "58572830-d5ca-43ff-bd1d-d7ca383d5c65",
"sourceDocumentType": "supplier_invoice",
"sourceRevision": 2,
"effectiveDate": "2026-10-21",
"mappingPolicyVersion": "ro-2026.1",
"journalEntryId": "d75fc649-ee06-4dfb-ab83-94b5f1209aa8",
"rejection": null,
"aggregateRevision": 2
} Read the entry
The entry has one line per account. The sum of the debits equals the sum of the credits, and sourceDocumentId links the entry to the invoice you submitted.
Get a journal entry
curl
curl "$RDC_BASE_URL/accounting/v1/journal-entries/d75fc649-ee06-4dfb-ab83-94b5f1209aa8" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/accounting/v1/journal-entries/d75fc649-ee06-4dfb-ab83-94b5f1209aa8`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/accounting/v1/journal-entries/d75fc649-ee06-4dfb-ab83-94b5f1209aa8',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/accounting/v1/journal-entries/d75fc649-ee06-4dfb-ab83-94b5f1209aa8');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/accounting/v1/journal-entries/d75fc649-ee06-4dfb-ab83-94b5f1209aa8");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"id": "d75fc649-ee06-4dfb-ab83-94b5f1209aa8",
"number": "JE-2026-10-0008",
"entryDate": "2026-10-21",
"period": "2026-10",
"sourceDocumentId": "58572830-d5ca-43ff-bd1d-d7ca383d5c65",
"lines": [
{
"account": "381",
"accountName": "Packaging",
"debit": "4128.70",
"credit": "0.00"
},
{
"account": "4426",
"accountName": "Deductible VAT",
"debit": "867.03",
"credit": "0.00"
},
{
"account": "401",
"accountName": "Suppliers",
"debit": "0.00",
"credit": "4995.73"
}
],
"reversalOf": null,
"reversedBy": null,
"reason": null,
"postedAt": "2026-11-23T07:12:00Z",
"aggregateRevision": 1
} Next
- Post a supplier invoice: the invoice that waits for an approver and the one that is rejected.
- Events: learn when a request is posted without asking.