Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Reconciliation

    Compare the list of the authority with the records of the gateway and settle the differences.

    On this page

    Close a declaration the authority no longer lists

    POST /etransport/v1/declarations/{declarationId}/close

    Closes an accepted declaration that the list of the authority no longer holds, for example because another user of the company removed it in the authority’s own application. The declaration ends deleted. It is refused while the authority still lists the code.

    Parameters

    NameInTypeRequiredMeaning
    declarationId path string (uuid) Yesrequired The declaration.

    Request body

    FieldTypeRequiredMeaning
    operationId string (uuid) Yesrequired A UUID you choose for this change. Send it again to repeat the request.
    expectedRevision integer Yesrequired The revision of the declaration you read.

    Responses

    StatusMeaningBody
    202 The change was accepted. The body is the operation result: aggregateId is the record that was created or changed. OperationResult
    400 The request cannot be read or breaks the contract: the JSON is malformed, a field is missing or unknown, or a type is wrong. fields names each one. Error
    401 The token is missing, has expired or is not ours. Error
    403 The token does not give access to this company or operation. Error
    404 The declaration does not exist in your account. Error
    409 operation_reused: The operationId was already used with a different request. revision_conflict: The declaration changed since the revision you sent. Nothing was applied. invalid_status: The declaration is not in a status that allows this. still_listed: The authority still lists the UIT code, so the declaration cannot be closed as missing. Error
    429 There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. Error
    503 The gateway cannot answer now. Error

    Request

    curl

    curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/b56d6271-6c16-41b4-8b31-43ef7c1c179b/close" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "6fa5228b-1bbd-4fae-818f-4ef6861fd7b3",
      "expectedRevision": 2
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/b56d6271-6c16-41b4-8b31-43ef7c1c179b/close`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "6fa5228b-1bbd-4fae-818f-4ef6861fd7b3",
        "expectedRevision": 2
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/b56d6271-6c16-41b4-8b31-43ef7c1c179b/close',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '6fa5228b-1bbd-4fae-818f-4ef6861fd7b3',
            'expectedRevision': 2,
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "6fa5228b-1bbd-4fae-818f-4ef6861fd7b3",
      "expectedRevision": 2
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/b56d6271-6c16-41b4-8b31-43ef7c1c179b/close');
    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")}/etransport/v1/declarations/b56d6271-6c16-41b4-8b31-43ef7c1c179b/close");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "6fa5228b-1bbd-4fae-818f-4ef6861fd7b3",
      "expectedRevision": 2
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    JSON

    {
      "operationId": "6fa5228b-1bbd-4fae-818f-4ef6861fd7b3",
      "status": "accepted",
      "aggregateId": "b56d6271-6c16-41b4-8b31-43ef7c1c179b",
      "aggregateRevision": 3
    }

    Compare with the list of the authority

    GET /etransport/v1/reconciliation

    Compares the accepted declarations of a company with what the list of the authority returns for it over the last days days (1 to 60). Each entry is matched, differs (in the vehicle, the start date or the confirmation), missing (the authority does not list the code) or unknown (the authority lists a code the gateway does not know).

    Parameters

    NameInTypeRequiredMeaning
    companyId query string (uuid) Yesrequired The company whose records you want. It is the id of a company of your account.
    days query integer Nooptional How many days back the comparison reaches, from 1 to 60. Default 60 Range 1 – 60
    limit query integer Nooptional Records per page, from 1 to 500. Default 100 Range 1 – 500
    cursor query string Nooptional The nextCursor of the previous page.

    Responses

    StatusMeaningBody
    200 A page of entries. ReconciliationPage
    401 The token is missing, has expired or is not ours. Error
    403 The token does not give access to this company or operation. Error
    404 The company does not exist in your account. Error
    429 There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. Error
    503 The gateway cannot answer now. Error

    Request

    curl

    curl "$RDC_BASE_URL/etransport/v1/reconciliation?companyId=9a893b65-2286-477f-8eab-61c12f7d6b3e&limit=20" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/reconciliation?companyId=9a893b65-2286-477f-8eab-61c12f7d6b3e&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"]}/etransport/v1/reconciliation?companyId=9a893b65-2286-477f-8eab-61c12f7d6b3e&limit=20',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/reconciliation?companyId=9a893b65-2286-477f-8eab-61c12f7d6b3e&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")}/etransport/v1/reconciliation?companyId=9a893b65-2286-477f-8eab-61c12f7d6b3e&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

    JSON

    {
      "items": [
        {
          "kind": "matched",
          "uit": "4F7K2Q9M8X1D6383",
          "declarationId": "4533692d-469c-4b70-acdb-d1a9a4a0f54f",
          "differences": []
        },
        {
          "kind": "matched",
          "uit": "75LXQY50R5NU4243",
          "declarationId": "15699075-5c6a-4a8b-a225-166309ad1b48",
          "differences": []
        },
        {
          "kind": "missing",
          "uit": "08FJ6Y2T2A4WUL40",
          "declarationId": "b56d6271-6c16-41b4-8b31-43ef7c1c179b",
          "differences": []
        },
        {
          "kind": "matched",
          "uit": "PPX55NDPEX0LA680",
          "declarationId": "5a0dcf1e-b471-4126-9daa-16a8acf1fe24",
          "differences": []
        },
        {
          "kind": "differs",
          "uit": "L25N2NH2P0DWNY57",
          "declarationId": "76133192-68de-47e7-9320-08e012e7075b",
          "differences": [
            "vehicle"
          ]
        },
        {
          "kind": "unknown",
          "uit": "KMC1WQ1R1V7VCH82",
          "declarationId": null,
          "differences": []
        }
      ],
      "nextCursor": null
    }

    Take the authority’s version of a code

    POST /etransport/v1/reconciliation/adopt

    For a code the gateway does not know, creates an accepted declaration from the authority’s record (the authority returns totals, not lines, so it has no goods lines). For a record that differs, takes the authority’s vehicle, start date and confirmation. It is refused when the record already matches.

    Request body

    FieldTypeRequiredMeaning
    operationId string (uuid) Yesrequired A UUID you choose for this change. Send it again to repeat the request.
    uit string Yesrequired The UIT code in the authority’s list.

    Responses

    StatusMeaningBody
    202 The change was accepted. The body is the operation result: aggregateId is the record that was created or changed. OperationResult
    400 The request cannot be read or breaks the contract: the JSON is malformed, a field is missing or unknown, or a type is wrong. fields names each one. Error
    401 The token is missing, has expired or is not ours. Error
    403 The token does not give access to this company or operation. Error
    404 The authority’s list for the company does not hold this UIT code. Error
    409 operation_reused: The operationId was already used with a different request. invalid_status: The declaration is not in a status that allows this. in_sync: The gateway’s record already matches the authority’s. Error
    429 There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. Error
    503 The gateway cannot answer now. Error

    Request

    curl

    curl -X POST "$RDC_BASE_URL/etransport/v1/reconciliation/adopt" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "0fdbc1ea-a7f7-4ef0-a735-f9f4f1e01ab0",
      "uit": "KMC1WQ1R1V7VCH82"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/reconciliation/adopt`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "0fdbc1ea-a7f7-4ef0-a735-f9f4f1e01ab0",
        "uit": "KMC1WQ1R1V7VCH82"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/etransport/v1/reconciliation/adopt',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '0fdbc1ea-a7f7-4ef0-a735-f9f4f1e01ab0',
            'uit': 'KMC1WQ1R1V7VCH82',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "0fdbc1ea-a7f7-4ef0-a735-f9f4f1e01ab0",
      "uit": "KMC1WQ1R1V7VCH82"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/reconciliation/adopt');
    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")}/etransport/v1/reconciliation/adopt");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "0fdbc1ea-a7f7-4ef0-a735-f9f4f1e01ab0",
      "uit": "KMC1WQ1R1V7VCH82"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    JSON

    {
      "operationId": "0fdbc1ea-a7f7-4ef0-a735-f9f4f1e01ab0",
      "status": "accepted",
      "aggregateId": "0776bc3f-c5ed-4aa8-8f25-40152eee2b42",
      "aggregateRevision": 1
    }