Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Correct and delete

    Correct the data of an accepted declaration while the vehicle is still in the yard, or delete the declaration, each as a message to the authority.

    On this page

    After the authority said ok, the declared data can still change until the vehicle is on the road. Each change is a message of its own to the authority, with its own upload index and its own answer, and the declaration changes only when the authority answers ok. One message at a time: while one waits, every other change is refused with notification_pending.

    Correct

    A correction carries the fields that change, with the same names as when the declaration was created: startDate, reference, partner, transporter, vehicle, trailers, from, to, goods, documents, afterOutage. A list you send, such as goods, replaces the list. The UIT code stays. Send the revision you read.

    curl

    curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/correct" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "81dbaf8d-995a-414a-abb7-92c070adbbec",
      "expectedRevision": 1,
      "vehicle": "ZZ22BRM",
      "trailers": [
        "ZZ31RMB"
      ]
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/correct`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "81dbaf8d-995a-414a-abb7-92c070adbbec",
        "expectedRevision": 1,
        "vehicle": "ZZ22BRM",
        "trailers": [
          "ZZ31RMB"
        ]
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/correct',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '81dbaf8d-995a-414a-abb7-92c070adbbec',
            'expectedRevision': 1,
            'vehicle': 'ZZ22BRM',
            'trailers': [
                'ZZ31RMB',
            ],
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "81dbaf8d-995a-414a-abb7-92c070adbbec",
      "expectedRevision": 1,
      "vehicle": "ZZ22BRM",
      "trailers": [
        "ZZ31RMB"
      ]
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/correct');
    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/4533692d-469c-4b70-acdb-d1a9a4a0f54f/correct");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "81dbaf8d-995a-414a-abb7-92c070adbbec",
      "expectedRevision": 1,
      "vehicle": "ZZ22BRM",
      "trailers": [
        "ZZ31RMB"
      ]
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "81dbaf8d-995a-414a-abb7-92c070adbbec",
      "status": "accepted",
      "aggregateId": "4533692d-469c-4b70-acdb-d1a9a4a0f54f",
      "aggregateRevision": 2
    }

    What a correction of the vehicle carries (besides `operationId` and `expectedRevision`)

    {
      "vehicle": "ZZ22BRM",
      "trailers": [
        "ZZ31RMB"
      ]
    }

    The gateway runs the checks on the declaration as it would be after the correction. A correction that would break a blocking rule is refused with blocked_by_checks and nothing is sent.

    Refused withCodeWhy
    409invalid_statusThe declaration is not accepted.
    409already_departedThe vehicle left. The gateway refuses a correction from then on; the vehicle can still change: see Change the vehicle.
    409uit_expiredThe last valid day has passed.
    409notification_pendingAnother message waits for the authority.
    409authorisation_not_in_forceThe access of the company is not in force.
    409revision_conflictThe declaration changed after you read it.
    422blocked_by_checksThe corrected declaration fails a blocking check.

    Delete

    A deletion sends the message DEL. When the authority answers ok the declaration ends deleted, the UIT code is no longer valid and the authority no longer lists it. The validity does not limit a deletion. Deleting changes the registered data, so the gateway refuses it once the vehicle left (already_departed): the gateway’s rule.

    curl

    curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/delete" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "d7fc2081-9a15-4034-93c3-24fc9203e2cf",
      "expectedRevision": 1
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/delete`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "d7fc2081-9a15-4034-93c3-24fc9203e2cf",
        "expectedRevision": 1
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/delete',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': 'd7fc2081-9a15-4034-93c3-24fc9203e2cf',
            'expectedRevision': 1,
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "d7fc2081-9a15-4034-93c3-24fc9203e2cf",
      "expectedRevision": 1
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/delete');
    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/4533692d-469c-4b70-acdb-d1a9a4a0f54f/delete");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "d7fc2081-9a15-4034-93c3-24fc9203e2cf",
      "expectedRevision": 1
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "d7fc2081-9a15-4034-93c3-24fc9203e2cf",
      "status": "accepted",
      "aggregateId": "4533692d-469c-4b70-acdb-d1a9a4a0f54f",
      "aggregateRevision": 2
    }

    Refused withCodeWhy
    409invalid_statusThe declaration is not accepted.
    409already_departedThe vehicle left.
    409notification_pendingAnother message waits for the authority.
    409authorisation_not_in_forceThe access of the company is not in force.
    409revision_conflictThe declaration changed after you read it.

    The answer of the authority

    Follow the message like the first upload: events, the declaration or refreshDeclaration. A message moves from submitted to processing (în prelucrare) to accepted (ok) or rejected (nok). On nok the declaration stays as it was, and the message carries the words of the authority.

    A message the authority refused

    {
      "id": "a1c76502-05bd-47a1-bf19-b445841ec243",
      "declarationId": "ffe03a6e-e050-4a07-8043-dec108572aa9",
      "companyId": "9a893b65-2286-477f-8eab-61c12f7d6b3e",
      "kind": "new",
      "authorityKind": "NOT",
      "status": "rejected",
      "uploadIndex": null,
      "at": "2026-11-12T07:04:50Z",
      "message": "Nu aveti drept in SPV pentru CIF=48290619"
    }

    A nok can carry words such as “UIT-ul nu poate fi identificat.”. Compare your records with the authority’s list: see List and reconcile.

    A rejected declaration

    A rejected declaration has no UIT code at the authority, so there is nothing to correct or delete. Write a new draft from it: see Send and follow.