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 vehicle | Request | Message to the authority |
|---|---|---|
| has not left | correctDeclaration | Correction (COR). The UIT code stays. See Correct and delete. |
| has left | changeVehicle | Vehicle 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(); {
"operationId": "0e998551-b365-4455-b169-93eaa509d3e5",
"status": "accepted",
"aggregateId": "4533692d-469c-4b70-acdb-d1a9a4a0f54f",
"aggregateRevision": 2
} | Refused with | Code | Why |
|---|---|---|
409 | invalid_status | The declaration is not accepted. |
409 | already_departed | The departure is already recorded. |
409 | uit_not_started | The declared start date has not come. The code is valid from that day. |
409 | uit_expired | The last valid day has passed. |
409 | notification_pending | A 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(); {
"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 with | Code | Why |
|---|---|---|
409 | invalid_status | The declaration is not accepted. |
409 | revision_conflict | The declaration changed after you read it. |
409 | not_departed | The vehicle did not leave. Correct the declaration instead. |
409 | uit_expired | The last valid day has passed. |
409 | same_vehicle | The vehicle and the trailers are the ones already declared. |
409 | notification_pending | Another message waits for the authority. |
409 | authorisation_not_in_force | The access of the company is not in force. |
422 | invalid_vehicle | A plate is not valid, or there are more than two trailers. |
422 | note_too_long | The 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(); {
"items": [
{
"at": "2026-11-23T06:35:00Z",
"vehicle": "ZZ24BRM",
"trailers": [],
"note": "Pană de cauciuc, vehicul înlocuit",
"uploadIndex": "1000221"
}
],
"nextCursor": null
} {
"at": "2026-11-23T06:35:00Z",
"vehicle": "ZZ24BRM",
"trailers": [],
"note": "Pană de cauciuc, vehicul înlocuit",
"uploadIndex": "1000221"
}