Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Post a supplier invoice

    Submit the facts of a supplier invoice and handle the three ways the request can go: posted, waiting for an approver, rejected.

    On this page

    A supplier invoice arrives in your system with a number, a date, the partner, a base and a VAT for each rate and a total. Submit these facts as a posting request of the type supplier_invoice. For AC-0094412 the net amount is 4128.70 and the total 4995.73; the Quickstart follows that invoice to its entry.

    1. Build the facts

      One document fact, one partner fact, one amount fact per VAT rate with the base and the VAT as decimal strings, and the total. Take the amounts from the invoice; do not recompute them.

    2. Choose the ids

      postingRequestId for the request and operationId for this attempt, both stored before you send. sourceDocumentId is the id of the invoice in your system and sourceRevision its revision.

    3. Send and follow

      The 202 is the acceptance. Read the request or wait for the event to learn the outcome.

    Waiting for an approver

    An invoice at or above the approval limit of your company is not posted until a finance approver approves it in Accounting. The request is accepted and stays accepted. Nothing is wrong, and the request needs no action from your software. When the approver approves, the entry is posted and the status changes.

    Submit an invoice above the limit

    curl

    curl -X POST "$RDC_BASE_URL/accounting/v1/posting-requests" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "ce5653a6-6f61-4c4c-a4eb-8d731ffce539",
      "postingRequestId": "52330eaa-1840-49f8-895a-81219a047cf3",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "sourceDocumentId": "ba5fba82-7611-4773-b950-793839664863",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "eventId": "0fb32b66-d3ed-427a-9fc1-80aec14a65a6",
      "effectiveDate": "2026-10-22",
      "currency": "RON",
      "mappingPolicyVersion": "ro-2026.1",
      "correlationId": "b513bf39-d7f3-4e1d-a35f-527f466d7ee7",
      "facts": [
        {
          "type": "document",
          "number": "BT-558201",
          "date": "2026-10-22"
        },
        {
          "type": "partner",
          "name": "Băuturi Trotuș SRL",
          "vatId": "RO51603783"
        },
        {
          "type": "amount",
          "rate": "21",
          "base": "32864.00",
          "vat": "6901.44"
        },
        {
          "type": "total",
          "gross": "39765.44"
        }
      ]
    }'

    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": "ce5653a6-6f61-4c4c-a4eb-8d731ffce539",
        "postingRequestId": "52330eaa-1840-49f8-895a-81219a047cf3",
        "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
        "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
        "sourceDocumentId": "ba5fba82-7611-4773-b950-793839664863",
        "sourceDocumentType": "supplier_invoice",
        "sourceRevision": 2,
        "eventId": "0fb32b66-d3ed-427a-9fc1-80aec14a65a6",
        "effectiveDate": "2026-10-22",
        "currency": "RON",
        "mappingPolicyVersion": "ro-2026.1",
        "correlationId": "b513bf39-d7f3-4e1d-a35f-527f466d7ee7",
        "facts": [
          {
            "type": "document",
            "number": "BT-558201",
            "date": "2026-10-22"
          },
          {
            "type": "partner",
            "name": "Băuturi Trotuș SRL",
            "vatId": "RO51603783"
          },
          {
            "type": "amount",
            "rate": "21",
            "base": "32864.00",
            "vat": "6901.44"
          },
          {
            "type": "total",
            "gross": "39765.44"
          }
        ]
      }),
    });
    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': 'ce5653a6-6f61-4c4c-a4eb-8d731ffce539',
            'postingRequestId': '52330eaa-1840-49f8-895a-81219a047cf3',
            'customerOrgId': 'bdbc5b26-3f8a-4c1a-8c21-6c396293da32',
            'legalCompanyId': '8373a2b0-3239-4aee-b6c8-56d7829a746d',
            'sourceDocumentId': 'ba5fba82-7611-4773-b950-793839664863',
            'sourceDocumentType': 'supplier_invoice',
            'sourceRevision': 2,
            'eventId': '0fb32b66-d3ed-427a-9fc1-80aec14a65a6',
            'effectiveDate': '2026-10-22',
            'currency': 'RON',
            'mappingPolicyVersion': 'ro-2026.1',
            'correlationId': 'b513bf39-d7f3-4e1d-a35f-527f466d7ee7',
            'facts': [
                {
                    'type': 'document',
                    'number': 'BT-558201',
                    'date': '2026-10-22',
                },
                {
                    'type': 'partner',
                    'name': 'Băuturi Trotuș SRL',
                    'vatId': 'RO51603783',
                },
                {
                    'type': 'amount',
                    'rate': '21',
                    'base': '32864.00',
                    'vat': '6901.44',
                },
                {
                    'type': 'total',
                    'gross': '39765.44',
                },
            ],
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "ce5653a6-6f61-4c4c-a4eb-8d731ffce539",
      "postingRequestId": "52330eaa-1840-49f8-895a-81219a047cf3",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "sourceDocumentId": "ba5fba82-7611-4773-b950-793839664863",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "eventId": "0fb32b66-d3ed-427a-9fc1-80aec14a65a6",
      "effectiveDate": "2026-10-22",
      "currency": "RON",
      "mappingPolicyVersion": "ro-2026.1",
      "correlationId": "b513bf39-d7f3-4e1d-a35f-527f466d7ee7",
      "facts": [
        {
          "type": "document",
          "number": "BT-558201",
          "date": "2026-10-22"
        },
        {
          "type": "partner",
          "name": "Băuturi Trotuș SRL",
          "vatId": "RO51603783"
        },
        {
          "type": "amount",
          "rate": "21",
          "base": "32864.00",
          "vat": "6901.44"
        },
        {
          "type": "total",
          "gross": "39765.44"
        }
      ]
    }
    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": "ce5653a6-6f61-4c4c-a4eb-8d731ffce539",
      "postingRequestId": "52330eaa-1840-49f8-895a-81219a047cf3",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "sourceDocumentId": "ba5fba82-7611-4773-b950-793839664863",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "eventId": "0fb32b66-d3ed-427a-9fc1-80aec14a65a6",
      "effectiveDate": "2026-10-22",
      "currency": "RON",
      "mappingPolicyVersion": "ro-2026.1",
      "correlationId": "b513bf39-d7f3-4e1d-a35f-527f466d7ee7",
      "facts": [
        {
          "type": "document",
          "number": "BT-558201",
          "date": "2026-10-22"
        },
        {
          "type": "partner",
          "name": "Băuturi Trotuș SRL",
          "vatId": "RO51603783"
        },
        {
          "type": "amount",
          "rate": "21",
          "base": "32864.00",
          "vat": "6901.44"
        },
        {
          "type": "total",
          "gross": "39765.44"
        }
      ]
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "ce5653a6-6f61-4c4c-a4eb-8d731ffce539",
      "status": "accepted",
      "aggregateId": "52330eaa-1840-49f8-895a-81219a047cf3",
      "aggregateRevision": 1
    }

    Read it while it waits

    curl

    curl "$RDC_BASE_URL/accounting/v1/posting-requests/52330eaa-1840-49f8-895a-81219a047cf3" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/accounting/v1/posting-requests/52330eaa-1840-49f8-895a-81219a047cf3`, {
      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/52330eaa-1840-49f8-895a-81219a047cf3',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/accounting/v1/posting-requests/52330eaa-1840-49f8-895a-81219a047cf3');
    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/52330eaa-1840-49f8-895a-81219a047cf3");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "postingRequestId": "52330eaa-1840-49f8-895a-81219a047cf3",
      "status": "accepted",
      "sourceDocumentId": "ba5fba82-7611-4773-b950-793839664863",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "effectiveDate": "2026-10-22",
      "mappingPolicyVersion": "ro-2026.1",
      "journalEntryId": null,
      "rejection": null,
      "aggregateRevision": 1
    }

    When the facts do not balance

    Accounting posts only an entry whose debit equals its credit. When the total stated on the invoice is not the net amount plus VAT, even by 0.01, the entry cannot balance. The request is accepted and then rejected with the code unbalanced. The rejection.message says by how much the two sides differ. Nothing is posted.

    Submit the invoice

    curl

    curl -X POST "$RDC_BASE_URL/accounting/v1/posting-requests" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "1a68663c-a9b3-48ce-aba4-bd227fb9be5c",
      "postingRequestId": "eefbc55a-4da9-42d9-8c56-9764421e1fff",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "sourceDocumentId": "3795da47-15fc-4086-a5f5-f33e0bcd2efe",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "eventId": "b23ae413-521b-4da0-9661-d155736ad12b",
      "effectiveDate": "2026-10-29",
      "currency": "RON",
      "mappingPolicyVersion": "ro-2026.1",
      "correlationId": "a798f0ad-d77e-4473-a4b6-36311803e74d",
      "facts": [
        {
          "type": "document",
          "number": "MV-26-1231",
          "date": "2026-10-29"
        },
        {
          "type": "partner",
          "name": "Moara Vadului SRL",
          "vatId": "RO51603473"
        },
        {
          "type": "amount",
          "rate": "11",
          "base": "2250.00",
          "vat": "247.50"
        },
        {
          "type": "total",
          "gross": "2497.51"
        }
      ]
    }'

    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": "1a68663c-a9b3-48ce-aba4-bd227fb9be5c",
        "postingRequestId": "eefbc55a-4da9-42d9-8c56-9764421e1fff",
        "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
        "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
        "sourceDocumentId": "3795da47-15fc-4086-a5f5-f33e0bcd2efe",
        "sourceDocumentType": "supplier_invoice",
        "sourceRevision": 2,
        "eventId": "b23ae413-521b-4da0-9661-d155736ad12b",
        "effectiveDate": "2026-10-29",
        "currency": "RON",
        "mappingPolicyVersion": "ro-2026.1",
        "correlationId": "a798f0ad-d77e-4473-a4b6-36311803e74d",
        "facts": [
          {
            "type": "document",
            "number": "MV-26-1231",
            "date": "2026-10-29"
          },
          {
            "type": "partner",
            "name": "Moara Vadului SRL",
            "vatId": "RO51603473"
          },
          {
            "type": "amount",
            "rate": "11",
            "base": "2250.00",
            "vat": "247.50"
          },
          {
            "type": "total",
            "gross": "2497.51"
          }
        ]
      }),
    });
    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': '1a68663c-a9b3-48ce-aba4-bd227fb9be5c',
            'postingRequestId': 'eefbc55a-4da9-42d9-8c56-9764421e1fff',
            'customerOrgId': 'bdbc5b26-3f8a-4c1a-8c21-6c396293da32',
            'legalCompanyId': '8373a2b0-3239-4aee-b6c8-56d7829a746d',
            'sourceDocumentId': '3795da47-15fc-4086-a5f5-f33e0bcd2efe',
            'sourceDocumentType': 'supplier_invoice',
            'sourceRevision': 2,
            'eventId': 'b23ae413-521b-4da0-9661-d155736ad12b',
            'effectiveDate': '2026-10-29',
            'currency': 'RON',
            'mappingPolicyVersion': 'ro-2026.1',
            'correlationId': 'a798f0ad-d77e-4473-a4b6-36311803e74d',
            'facts': [
                {
                    'type': 'document',
                    'number': 'MV-26-1231',
                    'date': '2026-10-29',
                },
                {
                    'type': 'partner',
                    'name': 'Moara Vadului SRL',
                    'vatId': 'RO51603473',
                },
                {
                    'type': 'amount',
                    'rate': '11',
                    'base': '2250.00',
                    'vat': '247.50',
                },
                {
                    'type': 'total',
                    'gross': '2497.51',
                },
            ],
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "1a68663c-a9b3-48ce-aba4-bd227fb9be5c",
      "postingRequestId": "eefbc55a-4da9-42d9-8c56-9764421e1fff",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "sourceDocumentId": "3795da47-15fc-4086-a5f5-f33e0bcd2efe",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "eventId": "b23ae413-521b-4da0-9661-d155736ad12b",
      "effectiveDate": "2026-10-29",
      "currency": "RON",
      "mappingPolicyVersion": "ro-2026.1",
      "correlationId": "a798f0ad-d77e-4473-a4b6-36311803e74d",
      "facts": [
        {
          "type": "document",
          "number": "MV-26-1231",
          "date": "2026-10-29"
        },
        {
          "type": "partner",
          "name": "Moara Vadului SRL",
          "vatId": "RO51603473"
        },
        {
          "type": "amount",
          "rate": "11",
          "base": "2250.00",
          "vat": "247.50"
        },
        {
          "type": "total",
          "gross": "2497.51"
        }
      ]
    }
    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": "1a68663c-a9b3-48ce-aba4-bd227fb9be5c",
      "postingRequestId": "eefbc55a-4da9-42d9-8c56-9764421e1fff",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "sourceDocumentId": "3795da47-15fc-4086-a5f5-f33e0bcd2efe",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "eventId": "b23ae413-521b-4da0-9661-d155736ad12b",
      "effectiveDate": "2026-10-29",
      "currency": "RON",
      "mappingPolicyVersion": "ro-2026.1",
      "correlationId": "a798f0ad-d77e-4473-a4b6-36311803e74d",
      "facts": [
        {
          "type": "document",
          "number": "MV-26-1231",
          "date": "2026-10-29"
        },
        {
          "type": "partner",
          "name": "Moara Vadului SRL",
          "vatId": "RO51603473"
        },
        {
          "type": "amount",
          "rate": "11",
          "base": "2250.00",
          "vat": "247.50"
        },
        {
          "type": "total",
          "gross": "2497.51"
        }
      ]
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "1a68663c-a9b3-48ce-aba4-bd227fb9be5c",
      "status": "accepted",
      "aggregateId": "eefbc55a-4da9-42d9-8c56-9764421e1fff",
      "aggregateRevision": 1
    }

    Read the rejection

    curl

    curl "$RDC_BASE_URL/accounting/v1/posting-requests/eefbc55a-4da9-42d9-8c56-9764421e1fff" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/accounting/v1/posting-requests/eefbc55a-4da9-42d9-8c56-9764421e1fff`, {
      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/eefbc55a-4da9-42d9-8c56-9764421e1fff',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/accounting/v1/posting-requests/eefbc55a-4da9-42d9-8c56-9764421e1fff');
    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/eefbc55a-4da9-42d9-8c56-9764421e1fff");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "postingRequestId": "eefbc55a-4da9-42d9-8c56-9764421e1fff",
      "status": "rejected",
      "sourceDocumentId": "3795da47-15fc-4086-a5f5-f33e0bcd2efe",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "effectiveDate": "2026-10-29",
      "mappingPolicyVersion": "ro-2026.1",
      "journalEntryId": null,
      "rejection": {
        "code": "unbalanced",
        "message": "Debit and credit of the facts differ by 0.01. Nothing was posted."
      },
      "aggregateRevision": 2
    }

    Do not send the same request again: it would be the same request, and the same answer. Correct the invoice at its source so that its total is the sum of its parts, then submit the new revision with a new postingRequestId. You receive a posting.rejected event when this happens: see the Event catalogue.

    Conflicts

    • payload_conflict: the postingRequestId was used before with other content.
    • stale_source: the invoice has a newer revision than sourceRevision.
    • period_closed: the date falls in a locked month. See Period locks.
    • policy_conflict: the mappingPolicyVersion is not one of your company.