Invoices and credit notes
Create an invoice or a credit note as a draft, list them, and create a credit note from an accepted invoice.
On this page
Everything you send starts as a draft. The gateway holds the draft, runs the checks on it and sends it only when you ask. A credit note is an invoice with type set to credit_note; it goes through the same states.
Create a draft
Send the company, the number, the type, the buyer’s tax identifier with its country prefix, the issue date and the lines. reference carries the buyer’s own reference, such as the number of the purchase order. Amounts are decimal strings.
curl
curl -X POST "$RDC_BASE_URL/efactura/v1/invoices" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "536fa351-86fd-4acf-b8e1-af4817d6617b",
"companyId": "c6a26b8c-3323-4e7a-8611-f5a92f5e1a42",
"number": "FCT-2026-00425",
"type": "invoice",
"partnerCif": "RO39172614",
"issueDate": "2026-11-23",
"reference": "CV-1048",
"lines": [
{
"code": "FA-0010",
"name": "White flour, 10 kg bag",
"quantity": "12",
"unitPrice": "38.90",
"vatRate": "11"
},
{
"code": "ZA-0201",
"name": "Sugar, 1 kg",
"quantity": "30",
"unitPrice": "4.29",
"vatRate": "11"
}
]
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/invoices`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "536fa351-86fd-4acf-b8e1-af4817d6617b",
"companyId": "c6a26b8c-3323-4e7a-8611-f5a92f5e1a42",
"number": "FCT-2026-00425",
"type": "invoice",
"partnerCif": "RO39172614",
"issueDate": "2026-11-23",
"reference": "CV-1048",
"lines": [
{
"code": "FA-0010",
"name": "White flour, 10 kg bag",
"quantity": "12",
"unitPrice": "38.90",
"vatRate": "11"
},
{
"code": "ZA-0201",
"name": "Sugar, 1 kg",
"quantity": "30",
"unitPrice": "4.29",
"vatRate": "11"
}
]
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/efactura/v1/invoices',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '536fa351-86fd-4acf-b8e1-af4817d6617b',
'companyId': 'c6a26b8c-3323-4e7a-8611-f5a92f5e1a42',
'number': 'FCT-2026-00425',
'type': 'invoice',
'partnerCif': 'RO39172614',
'issueDate': '2026-11-23',
'reference': 'CV-1048',
'lines': [
{
'code': 'FA-0010',
'name': 'White flour, 10 kg bag',
'quantity': '12',
'unitPrice': '38.90',
'vatRate': '11',
},
{
'code': 'ZA-0201',
'name': 'Sugar, 1 kg',
'quantity': '30',
'unitPrice': '4.29',
'vatRate': '11',
},
],
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "536fa351-86fd-4acf-b8e1-af4817d6617b",
"companyId": "c6a26b8c-3323-4e7a-8611-f5a92f5e1a42",
"number": "FCT-2026-00425",
"type": "invoice",
"partnerCif": "RO39172614",
"issueDate": "2026-11-23",
"reference": "CV-1048",
"lines": [
{
"code": "FA-0010",
"name": "White flour, 10 kg bag",
"quantity": "12",
"unitPrice": "38.90",
"vatRate": "11"
},
{
"code": "ZA-0201",
"name": "Sugar, 1 kg",
"quantity": "30",
"unitPrice": "4.29",
"vatRate": "11"
}
]
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/invoices');
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")}/efactura/v1/invoices");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "536fa351-86fd-4acf-b8e1-af4817d6617b",
"companyId": "c6a26b8c-3323-4e7a-8611-f5a92f5e1a42",
"number": "FCT-2026-00425",
"type": "invoice",
"partnerCif": "RO39172614",
"issueDate": "2026-11-23",
"reference": "CV-1048",
"lines": [
{
"code": "FA-0010",
"name": "White flour, 10 kg bag",
"quantity": "12",
"unitPrice": "38.90",
"vatRate": "11"
},
{
"code": "ZA-0201",
"name": "Sugar, 1 kg",
"quantity": "30",
"unitPrice": "4.29",
"vatRate": "11"
}
]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "536fa351-86fd-4acf-b8e1-af4817d6617b",
"status": "accepted",
"aggregateId": "5081abd5-935d-4688-b961-0715c149fbd1",
"aggregateRevision": 1
} Create a credit note in the same way, with type set to credit_note, when your software issued the credit note itself.
Create a credit note from an invoice
To credit an invoice the authority accepted, let the gateway make the draft: it takes the number of the next invoice of the series, today’s date and the lines of the invoice, and sets creditOf to the number of the invoice. An invoice has one credit note this way; asking again answers already_credited.
curl
curl -X POST "$RDC_BASE_URL/efactura/v1/invoices/63b02302-55dc-4523-b584-c4eb55159924/credit-note" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "ab8f039a-fede-44e0-99eb-bbe91168a40d",
"expectedRevision": 7
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/invoices/63b02302-55dc-4523-b584-c4eb55159924/credit-note`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "ab8f039a-fede-44e0-99eb-bbe91168a40d",
"expectedRevision": 7
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/efactura/v1/invoices/63b02302-55dc-4523-b584-c4eb55159924/credit-note',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': 'ab8f039a-fede-44e0-99eb-bbe91168a40d',
'expectedRevision': 7,
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "ab8f039a-fede-44e0-99eb-bbe91168a40d",
"expectedRevision": 7
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/invoices/63b02302-55dc-4523-b584-c4eb55159924/credit-note');
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")}/efactura/v1/invoices/63b02302-55dc-4523-b584-c4eb55159924/credit-note");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "ab8f039a-fede-44e0-99eb-bbe91168a40d",
"expectedRevision": 7
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "ab8f039a-fede-44e0-99eb-bbe91168a40d",
"status": "accepted",
"aggregateId": "1f35d06f-5f09-4cbb-a834-1feaa6ac845e",
"aggregateRevision": 1
} Read the new draft with the aggregateId of the answer, check it and send it like any invoice. See Validate before sending.
List invoices
The list shows the invoices of one company, newest first. list chooses one of the lists of the Invoices view: sent, errors or messages. Filter by status, by period with issuedFrom and issuedTo, and by buyer with partnerCif. The invoices of your suppliers are in Received invoices.
curl
curl "$RDC_BASE_URL/efactura/v1/invoices?companyId=c6a26b8c-3323-4e7a-8611-f5a92f5e1a42&limit=20" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/invoices?companyId=c6a26b8c-3323-4e7a-8611-f5a92f5e1a42&limit=20`, {
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"]}/efactura/v1/invoices?companyId=c6a26b8c-3323-4e7a-8611-f5a92f5e1a42&limit=20',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/invoices?companyId=c6a26b8c-3323-4e7a-8611-f5a92f5e1a42&limit=20');
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")}/efactura/v1/invoices?companyId=c6a26b8c-3323-4e7a-8611-f5a92f5e1a42&limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"items": [
{
"id": "5081abd5-935d-4688-b961-0715c149fbd1",
"companyId": "c6a26b8c-3323-4e7a-8611-f5a92f5e1a42",
"number": "FCT-2026-00425",
"type": "invoice",
"direction": "sent",
"partner": "Cofetăria Vălul Alb SRL",
"partnerCif": "RO39172614",
"issueDate": "2026-11-23",
"dueDate": "2026-12-23",
"reference": "CV-1048",
"correctionOf": null,
"creditOf": null,
"lines": [
{
"code": "FA-0010",
"name": "White flour, 10 kg bag",
"quantity": "12",
"unitPrice": "38.90",
"vatRate": "11",
"net": "466.80"
},
{
"code": "ZA-0201",
"name": "Sugar, 1 kg",
"quantity": "30",
"unitPrice": "4.29",
"vatRate": "11",
"net": "128.70"
}
],
"net": "595.50",
"vatBreakdown": [
{
"rate": "11",
"base": "595.50",
"vat": "65.51"
}
],
"vat": "65.51",
"total": "661.01",
"currency": "RON",
"status": "draft",
"uploadIndex": null,
"revision": 1
},
{
"id": "ab7f7203-2bf2-4131-8b1b-34041c1afe3d",
"companyId": "c6a26b8c-3323-4e7a-8611-f5a92f5e1a42",
"number": "FCT-2026-00424",
"type": "invoice",
"direction": "sent",
"partner": "Market Trei Brazi SRL",
"partnerCif": "39172851",
"issueDate": "2026-11-23",
"dueDate": "2026-12-23",
"reference": "",
"correctionOf": null,
"creditOf": null,
"lines": [
{
"code": "FA-0010",
"name": "White flour, 10 kg bag",
"quantity": "30",
"unitPrice": "38.90",
"vatRate": "11",
"net": "1167.00"
},
{
"code": "DT-0412",
"name": "Dishwashing liquid, 5 l",
"quantity": "8",
"unitPrice": "23.47",
"vatRate": "19",
"net": "187.76"
}
],
"net": "1354.76",
"vatBreakdown": [
{
"rate": "19",
"base": "187.76",
"vat": "35.67"
},
{
"rate": "11",
"base": "1167.00",
"vat": "128.37"
}
],
"vat": "164.04",
"total": "1518.80",
"currency": "RON",
"status": "draft",
"uploadIndex": null,
"revision": 1
}
],
"nextCursor": null
} | List | What it holds |
|---|---|
sent | Every invoice and credit note sent from your software, in every status, drafts included. |
errors | Invoices the authority rejected, invoices whose outcome is unknown (manual_review) and drafts a blocking check holds back. |
messages | Invoices a buyer wrote about. See Buyer messages. |
A list answers in pages. See Pagination.