Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Change the vehicle

    Replace the vehicle or a trailer: with a correction before the truck leaves, with a vehicle change once it is on the road.

    On this page

    A truck breaks down, a trailer is swapped. After the vehicle left, the gateway accepts a change of the plates and no other change of the declared data. Which request you use depends on one thing: has the vehicle left?

    The vehicleRequestMessage to the authority
    has not leftcorrectDeclarationCorrection (COR). The UIT code stays. See Correct and delete.
    has leftchangeVehicleVehicle change (MVH). The UIT code stays.

    Record the departure

    The authority has no message for the departure, so the gateway keeps it itself: when the vehicle leaves, your software calls markDeparted. Nothing is sent to the authority. The gateway needs the record because it is the place that knows the truck left: from then on it refuses correctDeclaration and deleteDeclaration with already_departed, and it allows changeVehicle and confirmReceipt.

    curl

    curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/depart" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "0e998551-b365-4455-b169-93eaa509d3e5",
      "expectedRevision": 1
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/depart`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "0e998551-b365-4455-b169-93eaa509d3e5",
        "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/depart',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '0e998551-b365-4455-b169-93eaa509d3e5',
            'expectedRevision': 1,
        },
    )
    result = response.json()

    PHP

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

    Response 202

    {
      "operationId": "0e998551-b365-4455-b169-93eaa509d3e5",
      "status": "accepted",
      "aggregateId": "4533692d-469c-4b70-acdb-d1a9a4a0f54f",
      "aggregateRevision": 2
    }

    Refused withCodeWhy
    409invalid_statusThe declaration is not accepted.
    409already_departedThe departure is already recorded.
    409uit_not_startedThe declared start date has not come. The code is valid from that day.
    409uit_expiredThe last valid day has passed.
    409notification_pendingA message about the declaration still waits for the authority. A correction that is on its way would reach the authority after the vehicle left.

    Change the vehicle on the road

    Send the plates of the vehicle that carries the goods now and, if it has any, of its trailers: at most two. A plate is 2 to 20 capital letters and digits, without spaces or hyphens; a plate with lower case, a space or a hyphen is refused with invalid_vehicle. note is optional and at most 200 characters. The time of the change is the time the gateway receives the request.

    curl

    curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "58ccd74e-a566-4307-a4ca-0aac87636ae6",
      "expectedRevision": 3,
      "vehicle": "ZZ21BRM",
      "trailers": [],
      "note": "Vehicul înlocuit după o pană"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "58ccd74e-a566-4307-a4ca-0aac87636ae6",
        "expectedRevision": 3,
        "vehicle": "ZZ21BRM",
        "trailers": [],
        "note": "Vehicul înlocuit după o pană"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '58ccd74e-a566-4307-a4ca-0aac87636ae6',
            'expectedRevision': 3,
            'vehicle': 'ZZ21BRM',
            'trailers': [],
            'note': 'Vehicul înlocuit după o pană',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "58ccd74e-a566-4307-a4ca-0aac87636ae6",
      "expectedRevision": 3,
      "vehicle": "ZZ21BRM",
      "trailers": [],
      "note": "Vehicul înlocuit după o pană"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes');
    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/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "58ccd74e-a566-4307-a4ca-0aac87636ae6",
      "expectedRevision": 3,
      "vehicle": "ZZ21BRM",
      "trailers": [],
      "note": "Vehicul înlocuit după o pană"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "58ccd74e-a566-4307-a4ca-0aac87636ae6",
      "status": "accepted",
      "aggregateId": "15699075-5c6a-4a8b-a225-166309ad1b48",
      "aggregateRevision": 4
    }

    The request answers 202 and sends the message vehicle_change (MVH) to the authority. The declaration shows the new vehicle only when the authority answers ok; until then vehicle is the old one and the message waits (notification_pending for any other message). If the authority answers nok, the declaration stays as it was and the words of the authority are on the message.

    Refused withCodeWhy
    409invalid_statusThe declaration is not accepted.
    409revision_conflictThe declaration changed after you read it.
    409not_departedThe vehicle did not leave. Correct the declaration instead.
    409uit_expiredThe last valid day has passed.
    409same_vehicleThe vehicle and the trailers are the ones already declared.
    409notification_pendingAnother message waits for the authority.
    409authorisation_not_in_forceThe access of the company is not in force.
    422invalid_vehicleA plate is not valid, or there are more than two trailers.
    422note_too_longThe note is too long.

    Read what changed

    The vehicle changes of a declaration are listed oldest first, each with its time, the plates, the note and the upload index of its message. The declaration carries the same list as vehicleChanges, and its vehicle and trailers are the current ones. The driver sheet shows the current vehicle.

    curl

    curl "$RDC_BASE_URL/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes?limit=20" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes?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/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes?limit=20',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes?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/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/vehicle-changes?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": [
        {
          "at": "2026-11-23T06:35:00Z",
          "vehicle": "ZZ24BRM",
          "trailers": [],
          "note": "Pană de cauciuc, vehicul înlocuit",
          "uploadIndex": "1000221"
        }
      ],
      "nextCursor": null
    }

    One vehicle change

    {
      "at": "2026-11-23T06:35:00Z",
      "vehicle": "ZZ24BRM",
      "trailers": [],
      "note": "Pană de cauciuc, vehicul înlocuit",
      "uploadIndex": "1000221"
    }