Confirm receipt
Say what arrived once the transport is finished: confirmed, partly confirmed or rejected, and what counts when nobody says anything.
On this page
A confirmation records what arrived. It tells the authority whether the goods arrived as declared. It is a message of its own (CON) with its own upload index and its own answer, and it comes after departure.
The three kinds
| `kind` | Authority code | Use it when | `note` |
|---|---|---|---|
confirmed | 10 | Everything arrived as declared. | Optional. |
partly_confirmed | 20 | Part of the goods came back or was not received. Write the quantities returned in the note. | Required. |
rejected | 30 | The goods were not received, or the transport was not finished. Write the cause in the note. | Required. |
A note is at most 200 characters. The gateway refuses a partly_confirmed or a rejected confirmation without a note (note_required) and a note that is too long (note_too_long): the gateway’s own rule.
Send a confirmation
curl
curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/confirmation" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "e1bb11f2-8c23-4010-8e1e-510059fa0fe4",
"expectedRevision": 3,
"kind": "partly_confirmed",
"note": "Trei lăzi lipsă"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/confirmation`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "e1bb11f2-8c23-4010-8e1e-510059fa0fe4",
"expectedRevision": 3,
"kind": "partly_confirmed",
"note": "Trei lăzi lipsă"
}),
});
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/confirmation',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': 'e1bb11f2-8c23-4010-8e1e-510059fa0fe4',
'expectedRevision': 3,
'kind': 'partly_confirmed',
'note': 'Trei lăzi lipsă',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "e1bb11f2-8c23-4010-8e1e-510059fa0fe4",
"expectedRevision": 3,
"kind": "partly_confirmed",
"note": "Trei lăzi lipsă"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/15699075-5c6a-4a8b-a225-166309ad1b48/confirmation');
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/confirmation");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "e1bb11f2-8c23-4010-8e1e-510059fa0fe4",
"expectedRevision": 3,
"kind": "partly_confirmed",
"note": "Trei lăzi lipsă"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "e1bb11f2-8c23-4010-8e1e-510059fa0fe4",
"status": "accepted",
"aggregateId": "15699075-5c6a-4a8b-a225-166309ad1b48",
"aggregateRevision": 4
} {
"kind": "partly_confirmed",
"note": "Trei lăzi lipsă"
} | Refused with | Code | Why |
|---|---|---|
409 | invalid_status | The declaration is not accepted. |
409 | not_departed | The vehicle did not leave. Record the departure first: see Change the vehicle. |
409 | uit_expired | The last valid day has passed. |
409 | notification_pending | Another message waits for the authority. |
409 | authorisation_not_in_force | The access of the company is not in force. |
422 | note_required | A partial confirmation or a refusal has no note. |
422 | note_too_long | The note is too long. |
The declaration shows the confirmation only when the authority answers ok. A new confirmation replaces the one before it: the last one counts. If the authority answers nok, the confirmation before it stays.
When nobody confirms
A transport whose confirmation is not given by the end of the validity of the UIT code counts as confirmed. The gateway shows it the same way: after the last valid day the declaration carries confirmation with kind confirmed and automatic true, and the at is null. After that day a confirmation is refused with uit_expired, so say what happened while the code is valid.