Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Quickstart

    Send your first invoice from the test company: find the company, create the invoice, read its checks, send 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.

    Find the company

    Every invoice belongs to a company of your account. List the companies and keep the id of the one you send for.

    curl

    curl "$RDC_BASE_URL/efactura/v1/companies?limit=20" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/companies?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/companies?limit=20',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/companies?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/companies?limit=20");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "items": [
        {
          "id": "c6a26b8c-3323-4e7a-8611-f5a92f5e1a42",
          "name": "Brumar Distribuție SRL",
          "cif": "48290619",
          "vatId": "RO48290619",
          "authorisation": {
            "status": "active",
            "expires": "2027-03-12",
            "authorisedBy": {
              "name": "Ana Rusu",
              "role": "Finance director"
            },
            "scope": [
              "send",
              "receive"
            ],
            "renewal": null
          },
          "sync": {
            "paused": false,
            "lastAt": "2026-11-23T05:00:00Z"
          },
          "endpoint": {
            "host": "erp.brumar.example",
            "status": "healthy",
            "http": 200
          },
          "revision": 1
        },
        {
          "id": "aaa74c23-5c48-4055-82e9-dc5c4c36c13e",
          "name": "Brumar Retail SRL",
          "cif": "48290783",
          "vatId": "RO48290783",
          "authorisation": {
            "status": "renewal_needed",
            "expires": "2026-12-03",
            "authorisedBy": {
              "name": "Ioana Marin",
              "role": "Chief accountant"
            },
            "scope": [
              "send",
              "receive"
            ],
            "renewal": null
          },
          "sync": {
            "paused": false,
            "lastAt": "2026-11-23T05:00:00Z"
          },
          "endpoint": {
            "host": "pos.brumar.example",
            "status": "failing",
            "http": 503
          },
          "revision": 1
        }
      ],
      "nextCursor": null
    }

    Create an invoice

    Choose a new operationId and send the invoice with the id of the company. The answer says that the change was accepted.

    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();

    Response 202

    {
      "operationId": "536fa351-86fd-4acf-b8e1-af4817d6617b",
      "status": "accepted",
      "aggregateId": "5081abd5-935d-4688-b961-0715c149fbd1",
      "aggregateRevision": 1
    }

    Read the result

    Look the operation up with the operationId you sent. When status is completed, the invoice exists as a draft and aggregateId is its id.

    curl

    curl "$RDC_BASE_URL/efactura/v1/operations/536fa351-86fd-4acf-b8e1-af4817d6617b" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/operations/536fa351-86fd-4acf-b8e1-af4817d6617b`, {
      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/operations/536fa351-86fd-4acf-b8e1-af4817d6617b',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/operations/536fa351-86fd-4acf-b8e1-af4817d6617b');
    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/operations/536fa351-86fd-4acf-b8e1-af4817d6617b");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "operationId": "536fa351-86fd-4acf-b8e1-af4817d6617b",
      "status": "completed",
      "aggregateId": "5081abd5-935d-4688-b961-0715c149fbd1",
      "aggregateRevision": 1
    }

    StatusMeaning
    The request was recorded and is being applied.
    The change was applied.
    The request was refused. Nothing was changed.

    Read the checks

    The gateway checks the draft before it will send it. canSend is true when no blocking check fails. Validate before sending shows what to do when one does.

    Get the checks of an invoice

    curl

    curl "$RDC_BASE_URL/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1/checks" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1/checks`, {
      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/5081abd5-935d-4688-b961-0715c149fbd1/checks',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1/checks');
    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/5081abd5-935d-4688-b961-0715c149fbd1/checks");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "invoiceId": "5081abd5-935d-4688-b961-0715c149fbd1",
      "revision": 1,
      "canSend": true,
      "blocking": 0,
      "checks": [
        {
          "rule": "BR-CO-10",
          "place": "cac:LegalMonetaryTotal/cbc:LineExtensionAmount (BT-106)",
          "severity": "blocking",
          "passed": true,
          "message": "Line net amounts add up to the net total."
        },
        {
          "rule": "BR-S-09",
          "place": "cac:TaxTotal/cac:TaxSubtotal/cbc:TaxAmount (BT-117)",
          "severity": "blocking",
          "passed": true,
          "message": "The VAT of each rate is its base times the rate."
        },
        {
          "rule": "BR-CO-14",
          "place": "cac:TaxTotal/cbc:TaxAmount (BT-110)",
          "severity": "blocking",
          "passed": true,
          "message": "The VAT total is the sum of the VAT of each rate."
        },
        {
          "rule": "BR-CO-15",
          "place": "cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount (BT-112)",
          "severity": "blocking",
          "passed": true,
          "message": "The total with VAT is the net total plus VAT."
        },
        {
          "rule": "BR-CO-09",
          "place": "cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48)",
          "severity": "blocking",
          "passed": true,
          "message": "The buyer’s VAT identifier starts with a country prefix."
        },
        {
          "rule": "GW-01",
          "place": "cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent (BT-152)",
          "severity": "blocking",
          "passed": true,
          "message": "Every line carries a VAT rate in force."
        },
        {
          "rule": "GW-02",
          "place": "cbc:BuyerReference (BT-10)",
          "severity": "warning",
          "passed": true,
          "message": "The invoice carries a buyer reference."
        }
      ]
    }

    Send the invoice

    Send the revision you read as expectedRevision. If someone changed the invoice in the meantime, the answer is a 409 and nothing is applied. While a check blocks, the answer is a 422 and the invoice stays a draft.

    curl

    curl -X POST "$RDC_BASE_URL/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1/send" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "138774d1-e683-4558-a364-ae838d082f9a",
      "expectedRevision": 1
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1/send`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "138774d1-e683-4558-a364-ae838d082f9a",
        "expectedRevision": 1
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1/send',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '138774d1-e683-4558-a364-ae838d082f9a',
            'expectedRevision': 1,
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "138774d1-e683-4558-a364-ae838d082f9a",
      "expectedRevision": 1
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1/send');
    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/5081abd5-935d-4688-b961-0715c149fbd1/send");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "138774d1-e683-4558-a364-ae838d082f9a",
      "expectedRevision": 1
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "138774d1-e683-4558-a364-ae838d082f9a",
      "status": "accepted",
      "aggregateId": "5081abd5-935d-4688-b961-0715c149fbd1",
      "aggregateRevision": 2
    }

    Follow the invoice

    The invoice 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 invoice to see where it is, or register an endpoint and let the events tell you: see Subscriptions.

    Get an invoice

    curl

    curl "$RDC_BASE_URL/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1`, {
      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/5081abd5-935d-4688-b961-0715c149fbd1',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/efactura/v1/invoices/5081abd5-935d-4688-b961-0715c149fbd1');
    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/5081abd5-935d-4688-b961-0715c149fbd1");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "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": "submitted",
      "uploadIndex": "5012480182",
      "revision": 2
    }