Quickstart
File the SAF-T return of October from the test company: find the obligation, read its findings, file it and follow it.
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. This guide takes a return that is already built, checked, signed and approved; Approve and file shows the steps before.
Find the obligation
Every return answers an obligation: one company, one form, one period. List the obligations of the company for October and keep the currentReturnId of the SAF-T return, D406.
List the obligations of a period
curl
curl "$RDC_BASE_URL/declarations/v1/obligations?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&period=2026-10" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/obligations?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&period=2026-10`, {
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"]}/declarations/v1/obligations?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&period=2026-10',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/obligations?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&period=2026-10');
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")}/declarations/v1/obligations?companyId=a79a302d-e7f0-4fde-9086-48c003b9709a&period=2026-10");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"items": [
{
"id": "254fd08e-0d65-4719-9e6f-a7d07db2a448",
"companyId": "a79a302d-e7f0-4fde-9086-48c003b9709a",
"form": "D300",
"period": "2026-10",
"dueDate": "2026-11-25",
"status": "signed",
"currentReturnId": "3b559a77-5de4-4b9a-9e2e-ca6625d123f2",
"versions": 1
},
{
"id": "2931b99e-afe1-44b0-8031-8ff16466c5b9",
"companyId": "a79a302d-e7f0-4fde-9086-48c003b9709a",
"form": "D390",
"period": "2026-10",
"dueDate": "2026-11-25",
"status": "generated",
"currentReturnId": "d595ff94-75e0-4dbf-8663-f53351cb08ae",
"versions": 1
},
{
"id": "43553e25-0119-4430-98ab-3fa7a9af0a50",
"companyId": "a79a302d-e7f0-4fde-9086-48c003b9709a",
"form": "D394",
"period": "2026-10",
"dueDate": "2026-12-02",
"status": "rejected",
"currentReturnId": "6e95eb18-450e-4cca-8671-f3edaaa04d8d",
"versions": 1
},
{
"id": "5b37c7a3-d395-4aff-9e1c-db383b74e36d",
"companyId": "a79a302d-e7f0-4fde-9086-48c003b9709a",
"form": "D406",
"period": "2026-10",
"dueDate": "2026-12-02",
"status": "authorized",
"currentReturnId": "6e1e206c-d65e-48d6-8fa8-628da226d100",
"versions": 1
}
],
"nextCursor": null
} Read the findings
The checks run on the return before anything moves forward. canApprove is true when no error remains; a warning does not block. Validate before approval shows what to do when one does.
Get the findings of a return
curl
curl "$RDC_BASE_URL/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/findings" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/findings`, {
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"]}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/findings',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/findings');
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")}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/findings");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"returnId": "6e1e206c-d65e-48d6-8fa8-628da226d100",
"revision": 5,
"canApprove": true,
"errors": 0,
"warnings": 0,
"findings": []
} File the return
Choose a new operationId and send the revision you read as expectedRevision. If someone changed the return in the meantime, the answer is a 409 and nothing is applied. While an error finding remains, the answer is a 422 and the return stays approved but not filed.
curl
curl -X POST "$RDC_BASE_URL/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
"expectedRevision": 5
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
"expectedRevision": 5
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '800ebcec-00c4-4bf8-af9b-5019046edc00',
'expectedRevision': 5,
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
"expectedRevision": 5
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission');
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")}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100/submission");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
"expectedRevision": 5
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "800ebcec-00c4-4bf8-af9b-5019046edc00",
"status": "accepted",
"aggregateId": "6e1e206c-d65e-48d6-8fa8-628da226d100",
"aggregateRevision": 6
} Follow the return
The return is now submitted and carries the uploadIndex the authority returned. It moves on to processing (în prelucrare) and then to accepted (ok) or rejected (nok). Read the return to see where it is, or register an endpoint and receive the answer as an event: see Subscriptions.
Get a return
curl
curl "$RDC_BASE_URL/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100`, {
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"]}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100');
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")}/declarations/v1/returns/6e1e206c-d65e-48d6-8fa8-628da226d100");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"id": "6e1e206c-d65e-48d6-8fa8-628da226d100",
"obligationId": "5b37c7a3-d395-4aff-9e1c-db383b74e36d",
"companyId": "a79a302d-e7f0-4fde-9086-48c003b9709a",
"form": "D406",
"period": "2026-10",
"version": 1,
"status": "submitted",
"owner": {
"id": "adacf598-0e46-4866-a3c6-ba0234ecacc4",
"name": "Ioana Marin",
"role": "Chief accountant"
},
"dueDate": "2026-12-02",
"snapshot": 2,
"amountToPay": null,
"amountToRecover": null,
"currency": "RON",
"supersedes": null,
"approval": {
"approvedBy": {
"id": "a0eaa217-d9ed-4f3e-b95a-c4b3176cf035",
"name": "Ana Rusu",
"role": "Finance director, approver"
},
"approvedAt": "2026-11-22T16:40:00Z"
},
"uploadIndex": "5013480221",
"revision": 6
} When the answer is accepted, the receipt is stored: Receipts. When it is rejected, read Handle a rejection.