---
title: "Declarations | Docs | e-Transport Gateway by R&D Copilot"
description: "Write, check, send and follow transport declarations; correct, delete and confirm them after the UIT code; read the history and the driver sheet."
canonical: "https://etransport.rdcopilot.com/docs/api-reference/declarations/"
language: en
updated: 2026-11-22
---

# Declarations

Write, check, send and follow transport declarations; correct, delete and confirm them after the UIT code; read the history and the driver sheet.

## List declarations

GET `/etransport/v1/declarations`

Returns the declarations of a company in pages, newest start date first. The filters combine.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `companyId` | query | `string (uuid)` | Yesrequired | The company whose records you want. It is the `id` of a company of your account. |
| `status` | query | `string` | Nooptional | Only declarations in this status. One of `draft`, `validated`, `authorized`, `queued`, `submitted`, `processing`, `accepted`, `rejected`, `manual_review`, `deleted` |
| `operationType` | query | `string` | Nooptional | Only declarations of this operation type. One of `AIC`, `LHI`, `SCI`, `LIC`, `LHE`, `SCE`, `TTN`, `IMP`, `EXP`, `DIN`, `DIE` |
| `startFrom` | query | `string (date)` | Nooptional | Only declarations that start on or after this day. |
| `startTo` | query | `string (date)` | Nooptional | Only declarations that start on or before this day. |
| `uit` | query | `string` | Nooptional | Only the declaration with this UIT code. |
| `reference` | query | `string` | Nooptional | Only declarations with this reference of yours. |
| `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

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | A page of declarations. | `DeclarationPage` |
| `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

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

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations?companyId=9a893b65-2286-477f-8eab-61c12f7d6b3e&limit=20`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations?companyId=9a893b65-2286-477f-8eab-61c12f7d6b3e&limit=20',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations?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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations?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

```json
{
  "items": [
    {
      "id": "b0bc421b-5e82-4bc2-9416-a33bd20bf92e",
      "companyId": "9a893b65-2286-477f-8eab-61c12f7d6b3e",
      "reference": "PO-8862",
      "operationType": "AIC",
      "status": "processing",
      "uit": null,
      "uploadIndex": "1000131",
      "startDate": "2026-11-24",
      "lastValidDay": "2026-12-08",
      "validity": null,
      "partner": {
        "country": "HU",
        "code": "",
        "name": "Tisza Pack Kft."
      },
      "transporter": {
        "country": "RO",
        "code": "62049137",
        "name": "Transbistrița Logistic SRL"
      },
      "vehicle": "ZZ41TBL",
      "trailers": [
        "ZZ42TBL"
      ],
      "from": {
        "kind": "border_crossing",
        "crossing": 2
      },
      "to": {
        "kind": "address",
        "county": 27,
        "locality": "Piatra-Neamț",
        "street": "Str. Depozitelor",
        "number": null,
        "notes": "Rampa 4"
      },
      "goods": [
        {
          "line": 1,
          "code": null,
          "name": "Cutii de carton ondulat, 40 de paleți",
          "tariffCode": "481910",
          "purposeCode": 101,
          "quantity": "40",
          "unit": "XPX",
          "netMass": "1180.00",
          "grossMass": "1240.00",
          "value": "18400.00"
        }
      ],
      "documents": [
        {
          "type": "cmr",
          "number": "CMR-HU-55812",
          "date": "2026-11-23",
          "remarks": null
        },
        {
          "type": "invoice",
          "number": "TP-30918",
          "date": "2026-11-22",
          "remarks": null
        }
      ],
      "totals": {
        "lines": 1,
        "netMass": "1180.00",
        "grossMass": "1240.00",
        "value": "18400.00"
      },
      "departedAt": null,
      "confirmation": null,
      "vehicleChanges": [],
      "correctionOf": null,
      "afterOutage": false,
      "source": "gateway",
      "revision": 6
    },
    {
      "id": "15699075-5c6a-4a8b-a225-166309ad1b48",
      "companyId": "9a893b65-2286-477f-8eab-61c12f7d6b3e",
      "reference": "LIV-2026-01839",
      "operationType": "TTN",
      "status": "accepted",
      "uit": "75LXQY50R5NU4243",
      "uploadIndex": "1000121",
      "startDate": "2026-11-23",
      "lastValidDay": "2026-11-27",
      "validity": "valid",
      "partner": {
        "country": "RO",
        "code": "39172614",
        "name": "Cofetăria Vălul Alb SRL"
      },
      "transporter": {
        "country": "RO",
        "code": "48290619",
        "name": "Brumar Distribuție SRL"
      },
      "vehicle": "ZZ24BRM",
      "trailers": [],
      "from": {
        "kind": "address",
        "county": 27,
        "locality": "Piatra-Neamț",
        "street": "Str. Depozitelor",
        "number": null,
        "notes": "Rampa 4"
      },
      "to": {
        "kind": "address",
        "county": 27,
        "locality": "Roman",
        "street": "Str. Principală",
        "number": null,
        "notes": null
      },
      "goods": [
        {
          "line": 1,
          "code": "ME-0307",
          "name": "Mere Golden, ladă de 12 kg",
          "tariffCode": "080810",
          "purposeCode": 101,
          "quantity": "12",
          "unit": "XCR",
          "netMass": "144.00",
          "grossMass": "154.80",
          "value": "576.00"
        },
        {
          "line": 2,
          "code": "NU-0622",
          "name": "Nuci decojite, sac de 5 kg",
          "tariffCode": "080232",
          "purposeCode": 101,
          "quantity": "6",
          "unit": "XBG",
          "netMass": "30.00",
          "grossMass": "30.60",
          "value": "1800.00"
        },
        {
          "line": 3,
          "code": "AP-0412",
          "name": "Apă minerală plată, 2 l, set de 6",
          "tariffCode": "220110",
          "purposeCode": 101,
          "quantity": "6",
          "unit": "XPK",
          "netMass": "72.00",
          "grossMass": "76.20",
          "value": "90.00"
        }
      ],
      "documents": [
        {
          "type": "delivery_note",
          "number": "AV-1039",
          "date": "2026-11-23",
          "remarks": null
        },
        {
          "type": "invoice",
          "number": "BRD-2026-00415",
          "date": "2026-11-23",
          "remarks": null
        }
      ],
      "totals": {
        "lines": 3,
        "netMass": "246.00",
        "grossMass": "261.60",
        "value": "2466.00"
      },
      "departedAt": "2026-11-23T05:48:00Z",
      "confirmation": null,
      "vehicleChanges": [
        {
          "at": "2026-11-23T06:35:00Z",
          "vehicle": "ZZ24BRM",
          "trailers": [],
          "note": "Pană de cauciuc, vehicul înlocuit"
        }
      ],
      "correctionOf": null,
      "afterOutage": false,
      "source": "gateway",
      "revision": 3
    },
    {
      "id": "4533692d-469c-4b70-acdb-d1a9a4a0f54f",
      "companyId": "9a893b65-2286-477f-8eab-61c12f7d6b3e",
      "reference": "LIV-2026-01842",
      "operationType": "TTN",
      "status": "accepted",
      "uit": "4F7K2Q9M8X1D6383",
      "uploadIndex": "1000128",
      "startDate": "2026-11-23",
      "lastValidDay": "2026-11-27",
      "validity": "valid",
      "partner": {
        "country": "RO",
        "code": "39172541",
        "name": "Hanul Ozana SRL"
      },
      "transporter": {
        "country": "RO",
        "code": "48290619",
        "name": "Brumar Distribuție SRL"
      },
      "vehicle": "ZZ21BRM",
      "trailers": [],
      "from": {
        "kind": "address",
        "county": 27,
        "locality": "Piatra-Neamț",
        "street": "Str. Depozitelor",
        "number": null,
        "notes": "Rampa 4"
      },
      "to": {
        "kind": "address",
        "county": 27,
        "locality": "Târgu Neamț",
        "street": "Str. Principală",
        "number": null,
        "notes": null
      },
      "goods": [
        {
          "line": 1,
          "code": "CA-0010",
          "name": "Cartofi albi, sac de 25 kg",
          "tariffCode": "070190",
          "purposeCode": 101,
          "quantity": "6",
          "unit": "XBG",
          "netMass": "150.00",
          "grossMass": "151.80",
          "value": "330.00"
        },
        {
          "line": 2,
          "code": "CE-0101",
          "name": "Ceapă galbenă, plasă de 10 kg",
          "tariffCode": "070310",
          "purposeCode": 101,
          "quantity": "4",
          "unit": "XBG",
          "netMass": "40.00",
          "grossMass": "40.60",
          "value": "112.00"
        },
        {
          "line": 3,
          "code": "MO-0201",
          "name": "Morcovi, sac de 10 kg",
          "tariffCode": "070610",
          "purposeCode": 101,
          "quantity": "4",
          "unit": "XBG",
          "netMass": "40.00",
          "grossMass": "40.60",
          "value": "128.00"
        },
        {
          "line": 4,
          "code": "ME-0307",
          "name": "Mere Golden, ladă de 12 kg",
          "tariffCode": "080810",
          "purposeCode": 101,
          "quantity": "8",
          "unit": "XCR",
          "netMass": "96.00",
          "grossMass": "103.20",
          "value": "384.00"
        },
        {
          "line": 5,
          "code": "AP-0412",
          "name": "Apă minerală plată, 2 l, set de 6",
          "tariffCode": "220110",
          "purposeCode": 101,
          "quantity": "10",
          "unit": "XPK",
          "netMass": "120.00",
          "grossMass": "127.00",
          "value": "150.00"
        },
        {
          "line": 6,
          "code": "SU-0518",
          "name": "Băutură carbogazoasă îndulcită, 2 l, set de 6",
          "tariffCode": "220210",
          "purposeCode": 101,
          "quantity": "3",
          "unit": "XPK",
          "netMass": "36.00",
          "grossMass": "38.10",
          "value": "72.00"
        }
      ],
      "documents": [
        {
          "type": "delivery_note",
          "number": "AV-1042",
          "date": "2026-11-23",
          "remarks": null
        },
        {
          "type": "invoice",
          "number": "BRD-2026-00418",
          "date": "2026-11-23",
          "remarks": null
        }
      ],
      "totals": {
        "lines": 6,
        "netMass": "482.00",
        "grossMass": "501.30",
        "value": "1176.00"
      },
      "departedAt": null,
      "confirmation": null,
      "vehicleChanges": [],
      "correctionOf": null,
      "afterOutage": false,
      "source": "gateway",
      "revision": 1
    }
  ],
  "nextCursor": null
}
```

## Create a declaration

POST `/etransport/v1/declarations`

Writes a draft with the fields you send. A draft may be incomplete: read its checks to see what is missing, then send it. Nothing reaches the authority until you send.

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `companyId` | `string (uuid)` | Yesrequired | The company the declaration is for. |
| `operationType` | `string` | Yesrequired | The operation type. See List the operation types. One of `AIC`, `LHI`, `SCI`, `LIC`, `LHE`, `SCE`, `TTN`, `IMP`, `EXP`, `DIN`, `DIE` |
| `startDate` | `string (date)` | Nooptional | The declared start date of the transport. A transport can be declared at most 3 calendar days before it. |
| `reference` | `string` | Nooptional | Your own reference, returned with the UIT code. At most 50 characters. |
| `partner` | `Counterparty` | Nooptional |  |
| `partner.country` | `string` | Yesrequired | The country as a two-letter code. Greece is `EL`. |
| `partner.code` | `string` | Yesrequired | The tax code when known; `PF` for a private person in Romania whose personal number you do not know; empty when unknown. |
| `partner.name` | `string` | Yesrequired | The name, at most 200 characters. |
| `transporter` | `Counterparty` | Nooptional |  |
| `transporter.country` | `string` | Yesrequired | The country as a two-letter code. Greece is `EL`. |
| `transporter.code` | `string` | Yesrequired | The tax code when known; `PF` for a private person in Romania whose personal number you do not know; empty when unknown. |
| `transporter.name` | `string` | Yesrequired | The name, at most 200 characters. |
| `vehicle` | `string` | Nooptional | The plate of the vehicle: 2 to 20 capital letters and digits, without spaces. |
| `trailers` | `string[]` | Nooptional | At most two trailers. |
| `from` | `Place` | Nooptional |  |
| `from.kind` | `string` | Yesrequired | `border_crossing` (the authority’s PTF), `customs_office` (BV) or `address` (ADR). One kind per place. One of `border_crossing`, `customs_office`, `address` |
| `from.crossing` | `integer` | Nooptional | For a border crossing: its code. See List the border crossings. |
| `from.office` | `integer` | Nooptional | For a customs office: its code. See List the customs offices. |
| `from.county` | `integer` | Nooptional | For an address: the code of the county, 1 to 40, 51 or 52. |
| `from.locality` | `string` | Nooptional | For an address: the locality, 2 to 100 characters. |
| `from.street` | `string` | Nooptional | For an address: the street, 2 to 100 characters. |
| `from.number` | `string` | Nooptional | For an address: the number. |
| `from.notes` | `string` | Nooptional | For an address: any other information, at most 200 characters. |
| `to` | `Place` | Nooptional |  |
| `to.kind` | `string` | Yesrequired | `border_crossing` (the authority’s PTF), `customs_office` (BV) or `address` (ADR). One kind per place. One of `border_crossing`, `customs_office`, `address` |
| `to.crossing` | `integer` | Nooptional | For a border crossing: its code. See List the border crossings. |
| `to.office` | `integer` | Nooptional | For a customs office: its code. See List the customs offices. |
| `to.county` | `integer` | Nooptional | For an address: the code of the county, 1 to 40, 51 or 52. |
| `to.locality` | `string` | Nooptional | For an address: the locality, 2 to 100 characters. |
| `to.street` | `string` | Nooptional | For an address: the street, 2 to 100 characters. |
| `to.number` | `string` | Nooptional | For an address: the number. |
| `to.notes` | `string` | Nooptional | For an address: any other information, at most 200 characters. |
| `goods` | `GoodsInput[]` | Nooptional | The goods lines. They replace the lines the declaration has. |
| `goods[].code` | `string` | Nooptional | Your code for the item. |
| `goods[].name` | `string` | Yesrequired | What is transported, as you declare it to the authority. At most 200 characters. |
| `goods[].tariffCode` | `string` | Nooptional | The Combined Nomenclature code: 4, 6 or 8 digits. Required unless the operation type is DIN or DIE. |
| `goods[].purposeCode` | `integer` | Yesrequired | The code of the purpose. |
| `goods[].quantity` | `string` | Yesrequired | Quantity as a decimal string, at most two decimals. |
| `goods[].unit` | `string` | Yesrequired | The unit as a UN/ECE code. |
| `goods[].netMass` | `string` | Nooptional | Net mass of the whole line in kilograms. Required unless the operation type is DIN or DIE. |
| `goods[].grossMass` | `string` | Yesrequired | Gross mass of the whole line in kilograms. Not below the net mass. |
| `goods[].value` | `string` | Nooptional | Value of the whole line in lei, without VAT. Required unless the operation type is DIN or DIE. |
| `documents` | `DocumentInput[]` | Nooptional | The transport documents. They replace the documents the declaration has. |
| `documents[].type` | `string` | Yesrequired | `cmr`, `invoice`, `delivery_note` or `other`. One of `cmr`, `invoice`, `delivery_note`, `other` |
| `documents[].number` | `string` | Nooptional | The number of the document. |
| `documents[].date` | `string (date)` | Yesrequired | The date of the document. |
| `documents[].remarks` | `string` | Nooptional | A remark, at most 200 characters. Required for the type `other`. |
| `afterOutage` | `boolean` | Nooptional | The declaration is made after an outage of the authority’s system. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `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 company does not exist in your account. | `Error` |
| `409` | The `operationId` was already used with a different request. | `Error` |
| `422` | `operation_type_unknown`: That is not an operation type of RO e-Transport. `validation_failed`: The request is well formed but a value is outside what the field accepts. | `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

```bash
curl -X POST "$RDC_BASE_URL/etransport/v1/declarations" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "e8c04ac1-44dd-49e2-bc09-9666dec1d95b",
  "companyId": "9a893b65-2286-477f-8eab-61c12f7d6b3e",
  "operationType": "TTN",
  "startDate": "2026-11-24",
  "reference": "LIV-2026-01847",
  "partner": {
    "country": "RO",
    "code": "39172789",
    "name": "Pensiunea Stânca Corbului SRL"
  },
  "transporter": {
    "country": "RO",
    "code": "48290619",
    "name": "Brumar Distribuție SRL"
  },
  "vehicle": "ZZ21BRM",
  "trailers": [],
  "from": {
    "kind": "address",
    "county": 27,
    "locality": "Piatra-Neamț",
    "street": "Str. Depozitelor",
    "number": null,
    "notes": "Rampa 4"
  },
  "to": {
    "kind": "address",
    "county": 27,
    "locality": "Bicaz",
    "street": "Str. Principală",
    "number": null,
    "notes": null
  },
  "goods": [
    {
      "code": "CA-0010",
      "name": "Cartofi albi, sac de 25 kg",
      "tariffCode": "070190",
      "purposeCode": 101,
      "quantity": "20",
      "unit": "XBG",
      "netMass": "500.00",
      "grossMass": "506.00",
      "value": "1100.00"
    },
    {
      "code": "ME-0307",
      "name": "Mere Golden, ladă de 12 kg",
      "tariffCode": "080810",
      "purposeCode": 101,
      "quantity": "10",
      "unit": "XCR",
      "netMass": "120.00",
      "grossMass": "129.00",
      "value": "480.00"
    }
  ],
  "documents": [
    {
      "type": "delivery_note",
      "number": "AV-1047",
      "date": "2026-11-24"
    },
    {
      "type": "invoice",
      "number": "BRD-2026-00426",
      "date": "2026-11-24"
    }
  ],
  "afterOutage": false
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "e8c04ac1-44dd-49e2-bc09-9666dec1d95b",
    "companyId": "9a893b65-2286-477f-8eab-61c12f7d6b3e",
    "operationType": "TTN",
    "startDate": "2026-11-24",
    "reference": "LIV-2026-01847",
    "partner": {
      "country": "RO",
      "code": "39172789",
      "name": "Pensiunea Stânca Corbului SRL"
    },
    "transporter": {
      "country": "RO",
      "code": "48290619",
      "name": "Brumar Distribuție SRL"
    },
    "vehicle": "ZZ21BRM",
    "trailers": [],
    "from": {
      "kind": "address",
      "county": 27,
      "locality": "Piatra-Neamț",
      "street": "Str. Depozitelor",
      "number": null,
      "notes": "Rampa 4"
    },
    "to": {
      "kind": "address",
      "county": 27,
      "locality": "Bicaz",
      "street": "Str. Principală",
      "number": null,
      "notes": null
    },
    "goods": [
      {
        "code": "CA-0010",
        "name": "Cartofi albi, sac de 25 kg",
        "tariffCode": "070190",
        "purposeCode": 101,
        "quantity": "20",
        "unit": "XBG",
        "netMass": "500.00",
        "grossMass": "506.00",
        "value": "1100.00"
      },
      {
        "code": "ME-0307",
        "name": "Mere Golden, ladă de 12 kg",
        "tariffCode": "080810",
        "purposeCode": 101,
        "quantity": "10",
        "unit": "XCR",
        "netMass": "120.00",
        "grossMass": "129.00",
        "value": "480.00"
      }
    ],
    "documents": [
      {
        "type": "delivery_note",
        "number": "AV-1047",
        "date": "2026-11-24"
      },
      {
        "type": "invoice",
        "number": "BRD-2026-00426",
        "date": "2026-11-24"
      }
    ],
    "afterOutage": false
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'e8c04ac1-44dd-49e2-bc09-9666dec1d95b',
        'companyId': '9a893b65-2286-477f-8eab-61c12f7d6b3e',
        'operationType': 'TTN',
        'startDate': '2026-11-24',
        'reference': 'LIV-2026-01847',
        'partner': {
            'country': 'RO',
            'code': '39172789',
            'name': 'Pensiunea Stânca Corbului SRL',
        },
        'transporter': {
            'country': 'RO',
            'code': '48290619',
            'name': 'Brumar Distribuție SRL',
        },
        'vehicle': 'ZZ21BRM',
        'trailers': [],
        'from': {
            'kind': 'address',
            'county': 27,
            'locality': 'Piatra-Neamț',
            'street': 'Str. Depozitelor',
            'number': None,
            'notes': 'Rampa 4',
        },
        'to': {
            'kind': 'address',
            'county': 27,
            'locality': 'Bicaz',
            'street': 'Str. Principală',
            'number': None,
            'notes': None,
        },
        'goods': [
            {
                'code': 'CA-0010',
                'name': 'Cartofi albi, sac de 25 kg',
                'tariffCode': '070190',
                'purposeCode': 101,
                'quantity': '20',
                'unit': 'XBG',
                'netMass': '500.00',
                'grossMass': '506.00',
                'value': '1100.00',
            },
            {
                'code': 'ME-0307',
                'name': 'Mere Golden, ladă de 12 kg',
                'tariffCode': '080810',
                'purposeCode': 101,
                'quantity': '10',
                'unit': 'XCR',
                'netMass': '120.00',
                'grossMass': '129.00',
                'value': '480.00',
            },
        ],
        'documents': [
            {
                'type': 'delivery_note',
                'number': 'AV-1047',
                'date': '2026-11-24',
            },
            {
                'type': 'invoice',
                'number': 'BRD-2026-00426',
                'date': '2026-11-24',
            },
        ],
        'afterOutage': False,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "e8c04ac1-44dd-49e2-bc09-9666dec1d95b",
  "companyId": "9a893b65-2286-477f-8eab-61c12f7d6b3e",
  "operationType": "TTN",
  "startDate": "2026-11-24",
  "reference": "LIV-2026-01847",
  "partner": {
    "country": "RO",
    "code": "39172789",
    "name": "Pensiunea Stânca Corbului SRL"
  },
  "transporter": {
    "country": "RO",
    "code": "48290619",
    "name": "Brumar Distribuție SRL"
  },
  "vehicle": "ZZ21BRM",
  "trailers": [],
  "from": {
    "kind": "address",
    "county": 27,
    "locality": "Piatra-Neamț",
    "street": "Str. Depozitelor",
    "number": null,
    "notes": "Rampa 4"
  },
  "to": {
    "kind": "address",
    "county": 27,
    "locality": "Bicaz",
    "street": "Str. Principală",
    "number": null,
    "notes": null
  },
  "goods": [
    {
      "code": "CA-0010",
      "name": "Cartofi albi, sac de 25 kg",
      "tariffCode": "070190",
      "purposeCode": 101,
      "quantity": "20",
      "unit": "XBG",
      "netMass": "500.00",
      "grossMass": "506.00",
      "value": "1100.00"
    },
    {
      "code": "ME-0307",
      "name": "Mere Golden, ladă de 12 kg",
      "tariffCode": "080810",
      "purposeCode": 101,
      "quantity": "10",
      "unit": "XCR",
      "netMass": "120.00",
      "grossMass": "129.00",
      "value": "480.00"
    }
  ],
  "documents": [
    {
      "type": "delivery_note",
      "number": "AV-1047",
      "date": "2026-11-24"
    },
    {
      "type": "invoice",
      "number": "BRD-2026-00426",
      "date": "2026-11-24"
    }
  ],
  "afterOutage": false
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "e8c04ac1-44dd-49e2-bc09-9666dec1d95b",
  "companyId": "9a893b65-2286-477f-8eab-61c12f7d6b3e",
  "operationType": "TTN",
  "startDate": "2026-11-24",
  "reference": "LIV-2026-01847",
  "partner": {
    "country": "RO",
    "code": "39172789",
    "name": "Pensiunea Stânca Corbului SRL"
  },
  "transporter": {
    "country": "RO",
    "code": "48290619",
    "name": "Brumar Distribuție SRL"
  },
  "vehicle": "ZZ21BRM",
  "trailers": [],
  "from": {
    "kind": "address",
    "county": 27,
    "locality": "Piatra-Neamț",
    "street": "Str. Depozitelor",
    "number": null,
    "notes": "Rampa 4"
  },
  "to": {
    "kind": "address",
    "county": 27,
    "locality": "Bicaz",
    "street": "Str. Principală",
    "number": null,
    "notes": null
  },
  "goods": [
    {
      "code": "CA-0010",
      "name": "Cartofi albi, sac de 25 kg",
      "tariffCode": "070190",
      "purposeCode": 101,
      "quantity": "20",
      "unit": "XBG",
      "netMass": "500.00",
      "grossMass": "506.00",
      "value": "1100.00"
    },
    {
      "code": "ME-0307",
      "name": "Mere Golden, ladă de 12 kg",
      "tariffCode": "080810",
      "purposeCode": 101,
      "quantity": "10",
      "unit": "XCR",
      "netMass": "120.00",
      "grossMass": "129.00",
      "value": "480.00"
    }
  ],
  "documents": [
    {
      "type": "delivery_note",
      "number": "AV-1047",
      "date": "2026-11-24"
    },
    {
      "type": "invoice",
      "number": "BRD-2026-00426",
      "date": "2026-11-24"
    }
  ],
  "afterOutage": false
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "e8c04ac1-44dd-49e2-bc09-9666dec1d95b",
  "status": "accepted",
  "aggregateId": "0776bc3f-c5ed-4aa8-8f25-40152eee2b42",
  "aggregateRevision": 1
}
```

## Get a declaration

GET `/etransport/v1/declarations/{declarationId}`

Returns the declaration at its current revision, with its UIT code once the authority has accepted it and the days left of its validity.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | The declaration. | `Declaration` |
| `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` |
| `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

```bash
curl "$RDC_BASE_URL/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f");
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

```json
{
  "id": "4533692d-469c-4b70-acdb-d1a9a4a0f54f",
  "companyId": "9a893b65-2286-477f-8eab-61c12f7d6b3e",
  "reference": "LIV-2026-01842",
  "operationType": "TTN",
  "status": "accepted",
  "uit": "4F7K2Q9M8X1D6383",
  "uploadIndex": "1000128",
  "startDate": "2026-11-23",
  "lastValidDay": "2026-11-27",
  "validity": "valid",
  "partner": {
    "country": "RO",
    "code": "39172541",
    "name": "Hanul Ozana SRL"
  },
  "transporter": {
    "country": "RO",
    "code": "48290619",
    "name": "Brumar Distribuție SRL"
  },
  "vehicle": "ZZ21BRM",
  "trailers": [],
  "from": {
    "kind": "address",
    "county": 27,
    "locality": "Piatra-Neamț",
    "street": "Str. Depozitelor",
    "number": null,
    "notes": "Rampa 4"
  },
  "to": {
    "kind": "address",
    "county": 27,
    "locality": "Târgu Neamț",
    "street": "Str. Principală",
    "number": null,
    "notes": null
  },
  "goods": [
    {
      "line": 1,
      "code": "CA-0010",
      "name": "Cartofi albi, sac de 25 kg",
      "tariffCode": "070190",
      "purposeCode": 101,
      "quantity": "6",
      "unit": "XBG",
      "netMass": "150.00",
      "grossMass": "151.80",
      "value": "330.00"
    },
    {
      "line": 2,
      "code": "CE-0101",
      "name": "Ceapă galbenă, plasă de 10 kg",
      "tariffCode": "070310",
      "purposeCode": 101,
      "quantity": "4",
      "unit": "XBG",
      "netMass": "40.00",
      "grossMass": "40.60",
      "value": "112.00"
    },
    {
      "line": 3,
      "code": "MO-0201",
      "name": "Morcovi, sac de 10 kg",
      "tariffCode": "070610",
      "purposeCode": 101,
      "quantity": "4",
      "unit": "XBG",
      "netMass": "40.00",
      "grossMass": "40.60",
      "value": "128.00"
    },
    {
      "line": 4,
      "code": "ME-0307",
      "name": "Mere Golden, ladă de 12 kg",
      "tariffCode": "080810",
      "purposeCode": 101,
      "quantity": "8",
      "unit": "XCR",
      "netMass": "96.00",
      "grossMass": "103.20",
      "value": "384.00"
    },
    {
      "line": 5,
      "code": "AP-0412",
      "name": "Apă minerală plată, 2 l, set de 6",
      "tariffCode": "220110",
      "purposeCode": 101,
      "quantity": "10",
      "unit": "XPK",
      "netMass": "120.00",
      "grossMass": "127.00",
      "value": "150.00"
    },
    {
      "line": 6,
      "code": "SU-0518",
      "name": "Băutură carbogazoasă îndulcită, 2 l, set de 6",
      "tariffCode": "220210",
      "purposeCode": 101,
      "quantity": "3",
      "unit": "XPK",
      "netMass": "36.00",
      "grossMass": "38.10",
      "value": "72.00"
    }
  ],
  "documents": [
    {
      "type": "delivery_note",
      "number": "AV-1042",
      "date": "2026-11-23",
      "remarks": null
    },
    {
      "type": "invoice",
      "number": "BRD-2026-00418",
      "date": "2026-11-23",
      "remarks": null
    }
  ],
  "totals": {
    "lines": 6,
    "netMass": "482.00",
    "grossMass": "501.30",
    "value": "1176.00"
  },
  "departedAt": null,
  "confirmation": null,
  "vehicleChanges": [],
  "correctionOf": null,
  "afterOutage": false,
  "source": "gateway",
  "revision": 1
}
```

## Update a draft

PATCH `/etransport/v1/declarations/{declarationId}`

Changes the fields of a draft. Only the fields you send change; `goods` and `documents` replace the whole list. After the draft was sent, use Correct a declaration.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `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. |
| `startDate` | `string (date)` | Nooptional | The declared start date of the transport. A transport can be declared at most 3 calendar days before it. |
| `reference` | `string` | Nooptional | Your own reference, returned with the UIT code. At most 50 characters. |
| `partner` | `Counterparty` | Nooptional |  |
| `partner.country` | `string` | Yesrequired | The country as a two-letter code. Greece is `EL`. |
| `partner.code` | `string` | Yesrequired | The tax code when known; `PF` for a private person in Romania whose personal number you do not know; empty when unknown. |
| `partner.name` | `string` | Yesrequired | The name, at most 200 characters. |
| `transporter` | `Counterparty` | Nooptional |  |
| `transporter.country` | `string` | Yesrequired | The country as a two-letter code. Greece is `EL`. |
| `transporter.code` | `string` | Yesrequired | The tax code when known; `PF` for a private person in Romania whose personal number you do not know; empty when unknown. |
| `transporter.name` | `string` | Yesrequired | The name, at most 200 characters. |
| `vehicle` | `string` | Nooptional | The plate of the vehicle: 2 to 20 capital letters and digits, without spaces. |
| `trailers` | `string[]` | Nooptional | At most two trailers. |
| `from` | `Place` | Nooptional |  |
| `from.kind` | `string` | Yesrequired | `border_crossing` (the authority’s PTF), `customs_office` (BV) or `address` (ADR). One kind per place. One of `border_crossing`, `customs_office`, `address` |
| `from.crossing` | `integer` | Nooptional | For a border crossing: its code. See List the border crossings. |
| `from.office` | `integer` | Nooptional | For a customs office: its code. See List the customs offices. |
| `from.county` | `integer` | Nooptional | For an address: the code of the county, 1 to 40, 51 or 52. |
| `from.locality` | `string` | Nooptional | For an address: the locality, 2 to 100 characters. |
| `from.street` | `string` | Nooptional | For an address: the street, 2 to 100 characters. |
| `from.number` | `string` | Nooptional | For an address: the number. |
| `from.notes` | `string` | Nooptional | For an address: any other information, at most 200 characters. |
| `to` | `Place` | Nooptional |  |
| `to.kind` | `string` | Yesrequired | `border_crossing` (the authority’s PTF), `customs_office` (BV) or `address` (ADR). One kind per place. One of `border_crossing`, `customs_office`, `address` |
| `to.crossing` | `integer` | Nooptional | For a border crossing: its code. See List the border crossings. |
| `to.office` | `integer` | Nooptional | For a customs office: its code. See List the customs offices. |
| `to.county` | `integer` | Nooptional | For an address: the code of the county, 1 to 40, 51 or 52. |
| `to.locality` | `string` | Nooptional | For an address: the locality, 2 to 100 characters. |
| `to.street` | `string` | Nooptional | For an address: the street, 2 to 100 characters. |
| `to.number` | `string` | Nooptional | For an address: the number. |
| `to.notes` | `string` | Nooptional | For an address: any other information, at most 200 characters. |
| `goods` | `GoodsInput[]` | Nooptional | The goods lines. They replace the lines the declaration has. |
| `goods[].code` | `string` | Nooptional | Your code for the item. |
| `goods[].name` | `string` | Yesrequired | What is transported, as you declare it to the authority. At most 200 characters. |
| `goods[].tariffCode` | `string` | Nooptional | The Combined Nomenclature code: 4, 6 or 8 digits. Required unless the operation type is DIN or DIE. |
| `goods[].purposeCode` | `integer` | Yesrequired | The code of the purpose. |
| `goods[].quantity` | `string` | Yesrequired | Quantity as a decimal string, at most two decimals. |
| `goods[].unit` | `string` | Yesrequired | The unit as a UN/ECE code. |
| `goods[].netMass` | `string` | Nooptional | Net mass of the whole line in kilograms. Required unless the operation type is DIN or DIE. |
| `goods[].grossMass` | `string` | Yesrequired | Gross mass of the whole line in kilograms. Not below the net mass. |
| `goods[].value` | `string` | Nooptional | Value of the whole line in lei, without VAT. Required unless the operation type is DIN or DIE. |
| `documents` | `DocumentInput[]` | Nooptional | The transport documents. They replace the documents the declaration has. |
| `documents[].type` | `string` | Yesrequired | `cmr`, `invoice`, `delivery_note` or `other`. One of `cmr`, `invoice`, `delivery_note`, `other` |
| `documents[].number` | `string` | Nooptional | The number of the document. |
| `documents[].date` | `string (date)` | Yesrequired | The date of the document. |
| `documents[].remarks` | `string` | Nooptional | A remark, at most 200 characters. Required for the type `other`. |
| `afterOutage` | `boolean` | Nooptional | The declaration is made after an outage of the authority’s system. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `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. | `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

```bash
curl -X PATCH "$RDC_BASE_URL/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "43fafee2-5fd5-48e0-bbc3-765225141b69",
  "expectedRevision": 1,
  "goods": [
    {
      "code": "CA-0010",
      "name": "Cartofi albi, sac de 25 kg",
      "tariffCode": "070190",
      "purposeCode": 704,
      "quantity": "40",
      "unit": "XBG",
      "netMass": "1000.00",
      "grossMass": "1012.00",
      "value": "2200.00"
    },
    {
      "code": "ME-0307",
      "name": "Mere Golden, ladă de 12 kg",
      "tariffCode": "080810",
      "purposeCode": 704,
      "quantity": "30",
      "unit": "XCR",
      "netMass": "360.00",
      "grossMass": "387.00",
      "value": "1440.00"
    },
    {
      "code": "AP-0412",
      "name": "Apă minerală plată, 2 l, set de 6",
      "tariffCode": "220110",
      "purposeCode": 704,
      "quantity": "80",
      "unit": "XPK",
      "netMass": "960.00",
      "grossMass": "1016.00",
      "value": "1200.00"
    },
    {
      "code": "SU-0518",
      "name": "Băutură carbogazoasă îndulcită, 2 l, set de 6",
      "tariffCode": "220210",
      "purposeCode": 704,
      "quantity": "36",
      "unit": "XPK",
      "netMass": "432.00",
      "grossMass": "457.20",
      "value": "864.00"
    }
  ]
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443`, {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "43fafee2-5fd5-48e0-bbc3-765225141b69",
    "expectedRevision": 1,
    "goods": [
      {
        "code": "CA-0010",
        "name": "Cartofi albi, sac de 25 kg",
        "tariffCode": "070190",
        "purposeCode": 704,
        "quantity": "40",
        "unit": "XBG",
        "netMass": "1000.00",
        "grossMass": "1012.00",
        "value": "2200.00"
      },
      {
        "code": "ME-0307",
        "name": "Mere Golden, ladă de 12 kg",
        "tariffCode": "080810",
        "purposeCode": 704,
        "quantity": "30",
        "unit": "XCR",
        "netMass": "360.00",
        "grossMass": "387.00",
        "value": "1440.00"
      },
      {
        "code": "AP-0412",
        "name": "Apă minerală plată, 2 l, set de 6",
        "tariffCode": "220110",
        "purposeCode": 704,
        "quantity": "80",
        "unit": "XPK",
        "netMass": "960.00",
        "grossMass": "1016.00",
        "value": "1200.00"
      },
      {
        "code": "SU-0518",
        "name": "Băutură carbogazoasă îndulcită, 2 l, set de 6",
        "tariffCode": "220210",
        "purposeCode": 704,
        "quantity": "36",
        "unit": "XPK",
        "netMass": "432.00",
        "grossMass": "457.20",
        "value": "864.00"
      }
    ]
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'PATCH',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '43fafee2-5fd5-48e0-bbc3-765225141b69',
        'expectedRevision': 1,
        'goods': [
            {
                'code': 'CA-0010',
                'name': 'Cartofi albi, sac de 25 kg',
                'tariffCode': '070190',
                'purposeCode': 704,
                'quantity': '40',
                'unit': 'XBG',
                'netMass': '1000.00',
                'grossMass': '1012.00',
                'value': '2200.00',
            },
            {
                'code': 'ME-0307',
                'name': 'Mere Golden, ladă de 12 kg',
                'tariffCode': '080810',
                'purposeCode': 704,
                'quantity': '30',
                'unit': 'XCR',
                'netMass': '360.00',
                'grossMass': '387.00',
                'value': '1440.00',
            },
            {
                'code': 'AP-0412',
                'name': 'Apă minerală plată, 2 l, set de 6',
                'tariffCode': '220110',
                'purposeCode': 704,
                'quantity': '80',
                'unit': 'XPK',
                'netMass': '960.00',
                'grossMass': '1016.00',
                'value': '1200.00',
            },
            {
                'code': 'SU-0518',
                'name': 'Băutură carbogazoasă îndulcită, 2 l, set de 6',
                'tariffCode': '220210',
                'purposeCode': 704,
                'quantity': '36',
                'unit': 'XPK',
                'netMass': '432.00',
                'grossMass': '457.20',
                'value': '864.00',
            },
        ],
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "43fafee2-5fd5-48e0-bbc3-765225141b69",
  "expectedRevision": 1,
  "goods": [
    {
      "code": "CA-0010",
      "name": "Cartofi albi, sac de 25 kg",
      "tariffCode": "070190",
      "purposeCode": 704,
      "quantity": "40",
      "unit": "XBG",
      "netMass": "1000.00",
      "grossMass": "1012.00",
      "value": "2200.00"
    },
    {
      "code": "ME-0307",
      "name": "Mere Golden, ladă de 12 kg",
      "tariffCode": "080810",
      "purposeCode": 704,
      "quantity": "30",
      "unit": "XCR",
      "netMass": "360.00",
      "grossMass": "387.00",
      "value": "1440.00"
    },
    {
      "code": "AP-0412",
      "name": "Apă minerală plată, 2 l, set de 6",
      "tariffCode": "220110",
      "purposeCode": 704,
      "quantity": "80",
      "unit": "XPK",
      "netMass": "960.00",
      "grossMass": "1016.00",
      "value": "1200.00"
    },
    {
      "code": "SU-0518",
      "name": "Băutură carbogazoasă îndulcită, 2 l, set de 6",
      "tariffCode": "220210",
      "purposeCode": 704,
      "quantity": "36",
      "unit": "XPK",
      "netMass": "432.00",
      "grossMass": "457.20",
      "value": "864.00"
    }
  ]
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Patch, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "43fafee2-5fd5-48e0-bbc3-765225141b69",
  "expectedRevision": 1,
  "goods": [
    {
      "code": "CA-0010",
      "name": "Cartofi albi, sac de 25 kg",
      "tariffCode": "070190",
      "purposeCode": 704,
      "quantity": "40",
      "unit": "XBG",
      "netMass": "1000.00",
      "grossMass": "1012.00",
      "value": "2200.00"
    },
    {
      "code": "ME-0307",
      "name": "Mere Golden, ladă de 12 kg",
      "tariffCode": "080810",
      "purposeCode": 704,
      "quantity": "30",
      "unit": "XCR",
      "netMass": "360.00",
      "grossMass": "387.00",
      "value": "1440.00"
    },
    {
      "code": "AP-0412",
      "name": "Apă minerală plată, 2 l, set de 6",
      "tariffCode": "220110",
      "purposeCode": 704,
      "quantity": "80",
      "unit": "XPK",
      "netMass": "960.00",
      "grossMass": "1016.00",
      "value": "1200.00"
    },
    {
      "code": "SU-0518",
      "name": "Băutură carbogazoasă îndulcită, 2 l, set de 6",
      "tariffCode": "220210",
      "purposeCode": 704,
      "quantity": "36",
      "unit": "XPK",
      "netMass": "432.00",
      "grossMass": "457.20",
      "value": "864.00"
    }
  ]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "43fafee2-5fd5-48e0-bbc3-765225141b69",
  "status": "accepted",
  "aggregateId": "1cf74abb-68ce-4948-b2e5-3ddace415443",
  "aggregateRevision": 2
}
```

## Get the checks of a declaration

GET `/etransport/v1/declarations/{declarationId}/checks`

Runs the checks of the gateway on the declaration as it is now and returns what fails. An `error` blocks sending; a `warning` does not. `rule` names the rule of the authority behind the check, where it has one.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | The checks. | `Checks` |
| `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` |
| `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

```bash
curl "$RDC_BASE_URL/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443/checks" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443/checks`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443/checks',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443/checks');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations/1cf74abb-68ce-4948-b2e5-3ddace415443/checks");
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

```json
{
  "declarationId": "1cf74abb-68ce-4948-b2e5-3ddace415443",
  "revision": 1,
  "canSend": false,
  "blocking": 1,
  "checks": [
    {
      "id": "tariff_code",
      "severity": "error",
      "field": "goods.tariffCode",
      "line": 4,
      "rule": "BR-034 BR-206",
      "message": "The tariff code of the line is missing or not valid: 4, 6 or 8 digits."
    }
  ]
}
```

## Send a declaration

POST `/etransport/v1/declarations/{declarationId}/send`

Sends a draft to the authority. In one operation the gateway passes `validated`, `authorized` and `queued`, uploads the declaration and takes the upload index. It is refused while a blocking check fails and while the access of the company is not in force. When the authority no longer holds the access of the company it refuses the upload at once and the declaration ends `rejected`.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `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

| Status | Meaning | Body |
| --- | --- | --- |
| `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. `authorisation_not_in_force`: The company’s access to the authority is not in force. Nothing was sent. | `Error` |
| `422` | A blocking check still fails. Nothing was sent. | `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

```bash
curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/0776bc3f-c5ed-4aa8-8f25-40152eee2b42/send" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "6256604e-3b85-4790-bca3-20628a474b86",
  "expectedRevision": 1
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/0776bc3f-c5ed-4aa8-8f25-40152eee2b42/send`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "6256604e-3b85-4790-bca3-20628a474b86",
    "expectedRevision": 1
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/0776bc3f-c5ed-4aa8-8f25-40152eee2b42/send',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '6256604e-3b85-4790-bca3-20628a474b86',
        'expectedRevision': 1,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "6256604e-3b85-4790-bca3-20628a474b86",
  "expectedRevision": 1
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/0776bc3f-c5ed-4aa8-8f25-40152eee2b42/send');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations/0776bc3f-c5ed-4aa8-8f25-40152eee2b42/send");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "6256604e-3b85-4790-bca3-20628a474b86",
  "expectedRevision": 1
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "6256604e-3b85-4790-bca3-20628a474b86",
  "status": "accepted",
  "aggregateId": "0776bc3f-c5ed-4aa8-8f25-40152eee2b42",
  "aggregateRevision": 2
}
```

## Send a declaration again

POST `/etransport/v1/declarations/{declarationId}/resend`

Queues and uploads a declaration whose outcome is unknown (`manual_review`): the gateway could not tell whether the authority received it.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `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

| Status | Meaning | Body |
| --- | --- | --- |
| `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. `authorisation_not_in_force`: The company’s access to the authority is not in force. Nothing was sent. | `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

```bash
curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/8088e3f2-9e6b-4d2a-a9b6-cc9fbb3b3b12/resend" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "41b89b64-8075-4311-b273-2217509bcb10",
  "expectedRevision": 5
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/8088e3f2-9e6b-4d2a-a9b6-cc9fbb3b3b12/resend`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "41b89b64-8075-4311-b273-2217509bcb10",
    "expectedRevision": 5
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/8088e3f2-9e6b-4d2a-a9b6-cc9fbb3b3b12/resend',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '41b89b64-8075-4311-b273-2217509bcb10',
        'expectedRevision': 5,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "41b89b64-8075-4311-b273-2217509bcb10",
  "expectedRevision": 5
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/8088e3f2-9e6b-4d2a-a9b6-cc9fbb3b3b12/resend');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations/8088e3f2-9e6b-4d2a-a9b6-cc9fbb3b3b12/resend");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "41b89b64-8075-4311-b273-2217509bcb10",
  "expectedRevision": 5
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "41b89b64-8075-4311-b273-2217509bcb10",
  "status": "accepted",
  "aggregateId": "8088e3f2-9e6b-4d2a-a9b6-cc9fbb3b3b12",
  "aggregateRevision": 6
}
```

## Ask the authority now

POST `/etransport/v1/declarations/{declarationId}/refresh`

Reads the answer of the authority for the message that is waiting, without waiting for the event. A message moves from `submitted` to `processing` (în prelucrare) and then to `accepted` (ok) or `rejected` (nok). It is refused when no message is waiting.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `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

| Status | Meaning | Body |
| --- | --- | --- |
| `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. `nothing_pending`: No message about this declaration is waiting for the authority. | `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

```bash
curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/b0bc421b-5e82-4bc2-9416-a33bd20bf92e/refresh" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "7dcc00ba-98ef-4f14-a52f-14a3ab2eaf7d",
  "expectedRevision": 6
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/b0bc421b-5e82-4bc2-9416-a33bd20bf92e/refresh`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "7dcc00ba-98ef-4f14-a52f-14a3ab2eaf7d",
    "expectedRevision": 6
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/b0bc421b-5e82-4bc2-9416-a33bd20bf92e/refresh',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '7dcc00ba-98ef-4f14-a52f-14a3ab2eaf7d',
        'expectedRevision': 6,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "7dcc00ba-98ef-4f14-a52f-14a3ab2eaf7d",
  "expectedRevision": 6
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/b0bc421b-5e82-4bc2-9416-a33bd20bf92e/refresh');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations/b0bc421b-5e82-4bc2-9416-a33bd20bf92e/refresh");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "7dcc00ba-98ef-4f14-a52f-14a3ab2eaf7d",
  "expectedRevision": 6
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "7dcc00ba-98ef-4f14-a52f-14a3ab2eaf7d",
  "status": "accepted",
  "aggregateId": "b0bc421b-5e82-4bc2-9416-a33bd20bf92e",
  "aggregateRevision": 7
}
```

## Write a new draft from a rejected declaration

POST `/etransport/v1/declarations/{declarationId}/reopen`

A rejected declaration is final. This writes a new draft with the same fields that names it in `correctionOf`; `aggregateId` of the result is the new draft. It is refused when such a draft already exists.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `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

| Status | Meaning | Body |
| --- | --- | --- |
| `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. `already_reopened`: A new draft was already written from this rejected declaration. | `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

```bash
curl -X POST "$RDC_BASE_URL/etransport/v1/declarations/ffe03a6e-e050-4a07-8043-dec108572aa9/reopen" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "7cca047a-05fc-48e7-860e-2a77dbeb2aca",
  "expectedRevision": 5
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/ffe03a6e-e050-4a07-8043-dec108572aa9/reopen`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "7cca047a-05fc-48e7-860e-2a77dbeb2aca",
    "expectedRevision": 5
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/ffe03a6e-e050-4a07-8043-dec108572aa9/reopen',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '7cca047a-05fc-48e7-860e-2a77dbeb2aca',
        'expectedRevision': 5,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "7cca047a-05fc-48e7-860e-2a77dbeb2aca",
  "expectedRevision": 5
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/ffe03a6e-e050-4a07-8043-dec108572aa9/reopen');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations/ffe03a6e-e050-4a07-8043-dec108572aa9/reopen");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "7cca047a-05fc-48e7-860e-2a77dbeb2aca",
  "expectedRevision": 5
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "7cca047a-05fc-48e7-860e-2a77dbeb2aca",
  "status": "accepted",
  "aggregateId": "0776bc3f-c5ed-4aa8-8f25-40152eee2b42",
  "aggregateRevision": 1
}
```

## Correct a declaration

POST `/etransport/v1/declarations/{declarationId}/correct`

Sends a correction of an accepted declaration to the authority. The UIT code stays. The declaration changes when the authority answers ok. It is allowed until the vehicle leaves and within the validity of the code; after departure use Change the vehicle.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `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. |
| `startDate` | `string (date)` | Nooptional | The declared start date of the transport. A transport can be declared at most 3 calendar days before it. |
| `reference` | `string` | Nooptional | Your own reference, returned with the UIT code. At most 50 characters. |
| `partner` | `Counterparty` | Nooptional |  |
| `partner.country` | `string` | Yesrequired | The country as a two-letter code. Greece is `EL`. |
| `partner.code` | `string` | Yesrequired | The tax code when known; `PF` for a private person in Romania whose personal number you do not know; empty when unknown. |
| `partner.name` | `string` | Yesrequired | The name, at most 200 characters. |
| `transporter` | `Counterparty` | Nooptional |  |
| `transporter.country` | `string` | Yesrequired | The country as a two-letter code. Greece is `EL`. |
| `transporter.code` | `string` | Yesrequired | The tax code when known; `PF` for a private person in Romania whose personal number you do not know; empty when unknown. |
| `transporter.name` | `string` | Yesrequired | The name, at most 200 characters. |
| `vehicle` | `string` | Nooptional | The plate of the vehicle: 2 to 20 capital letters and digits, without spaces. |
| `trailers` | `string[]` | Nooptional | At most two trailers. |
| `from` | `Place` | Nooptional |  |
| `from.kind` | `string` | Yesrequired | `border_crossing` (the authority’s PTF), `customs_office` (BV) or `address` (ADR). One kind per place. One of `border_crossing`, `customs_office`, `address` |
| `from.crossing` | `integer` | Nooptional | For a border crossing: its code. See List the border crossings. |
| `from.office` | `integer` | Nooptional | For a customs office: its code. See List the customs offices. |
| `from.county` | `integer` | Nooptional | For an address: the code of the county, 1 to 40, 51 or 52. |
| `from.locality` | `string` | Nooptional | For an address: the locality, 2 to 100 characters. |
| `from.street` | `string` | Nooptional | For an address: the street, 2 to 100 characters. |
| `from.number` | `string` | Nooptional | For an address: the number. |
| `from.notes` | `string` | Nooptional | For an address: any other information, at most 200 characters. |
| `to` | `Place` | Nooptional |  |
| `to.kind` | `string` | Yesrequired | `border_crossing` (the authority’s PTF), `customs_office` (BV) or `address` (ADR). One kind per place. One of `border_crossing`, `customs_office`, `address` |
| `to.crossing` | `integer` | Nooptional | For a border crossing: its code. See List the border crossings. |
| `to.office` | `integer` | Nooptional | For a customs office: its code. See List the customs offices. |
| `to.county` | `integer` | Nooptional | For an address: the code of the county, 1 to 40, 51 or 52. |
| `to.locality` | `string` | Nooptional | For an address: the locality, 2 to 100 characters. |
| `to.street` | `string` | Nooptional | For an address: the street, 2 to 100 characters. |
| `to.number` | `string` | Nooptional | For an address: the number. |
| `to.notes` | `string` | Nooptional | For an address: any other information, at most 200 characters. |
| `goods` | `GoodsInput[]` | Nooptional | The goods lines. They replace the lines the declaration has. |
| `goods[].code` | `string` | Nooptional | Your code for the item. |
| `goods[].name` | `string` | Yesrequired | What is transported, as you declare it to the authority. At most 200 characters. |
| `goods[].tariffCode` | `string` | Nooptional | The Combined Nomenclature code: 4, 6 or 8 digits. Required unless the operation type is DIN or DIE. |
| `goods[].purposeCode` | `integer` | Yesrequired | The code of the purpose. |
| `goods[].quantity` | `string` | Yesrequired | Quantity as a decimal string, at most two decimals. |
| `goods[].unit` | `string` | Yesrequired | The unit as a UN/ECE code. |
| `goods[].netMass` | `string` | Nooptional | Net mass of the whole line in kilograms. Required unless the operation type is DIN or DIE. |
| `goods[].grossMass` | `string` | Yesrequired | Gross mass of the whole line in kilograms. Not below the net mass. |
| `goods[].value` | `string` | Nooptional | Value of the whole line in lei, without VAT. Required unless the operation type is DIN or DIE. |
| `documents` | `DocumentInput[]` | Nooptional | The transport documents. They replace the documents the declaration has. |
| `documents[].type` | `string` | Yesrequired | `cmr`, `invoice`, `delivery_note` or `other`. One of `cmr`, `invoice`, `delivery_note`, `other` |
| `documents[].number` | `string` | Nooptional | The number of the document. |
| `documents[].date` | `string (date)` | Yesrequired | The date of the document. |
| `documents[].remarks` | `string` | Nooptional | A remark, at most 200 characters. Required for the type `other`. |
| `afterOutage` | `boolean` | Nooptional | The declaration is made after an outage of the authority’s system. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `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. `notification_pending`: A message about this declaration is still waiting for the authority’s answer. One message at a time. `authorisation_not_in_force`: The company’s access to the authority is not in force. Nothing was sent. `already_departed`: The vehicle already left. The gateway refuses a correction and a deletion from then on. `uit_expired`: The validity of the UIT code ended. The gateway refuses a correction, a vehicle change and a confirmation; a deletion is still accepted. | `Error` |
| `422` | A blocking check still fails. Nothing was sent. | `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

```bash
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

```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

```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
<?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#

```csharp
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`

JSON

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

## Delete a declaration

POST `/etransport/v1/declarations/{declarationId}/delete`

Sends a deletion to the authority. When it answers ok the declaration ends `deleted` and its UIT code is no longer valid. A deletion changes the registered data, so it is refused after the vehicle left.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `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

| Status | Meaning | Body |
| --- | --- | --- |
| `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. `notification_pending`: A message about this declaration is still waiting for the authority’s answer. One message at a time. `authorisation_not_in_force`: The company’s access to the authority is not in force. Nothing was sent. `already_departed`: The vehicle already left. The gateway refuses a correction and a deletion from then on. | `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

```bash
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

```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

```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
<?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#

```csharp
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`

JSON

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

## Mark the vehicle as departed

POST `/etransport/v1/declarations/{declarationId}/depart`

Records in the gateway that the vehicle left. Nothing is sent to the authority. From then on the gateway refuses corrections and deletion; a vehicle change and a confirmation become possible. Allowed on the days the UIT code is valid.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `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

| Status | Meaning | Body |
| --- | --- | --- |
| `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. `notification_pending`: A message about this declaration is still waiting for the authority’s answer. One message at a time. `already_departed`: The vehicle already left. The gateway refuses a correction and a deletion from then on. `uit_not_started`: The UIT code is valid from the declared start date; that day has not come. `uit_expired`: The validity of the UIT code ended. The gateway refuses a correction, a vehicle change and a confirmation; a deletion is still accepted. | `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

```bash
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

```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

```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
<?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#

```csharp
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`

JSON

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

## Confirm receipt

POST `/etransport/v1/declarations/{declarationId}/confirmation`

Sends the confirmation of the transport after it is finished: `confirmed`, `partly_confirmed` or `rejected`. The last two need a `note` with the quantities returned or the cause. A confirmation never given before the validity ends counts as given. The last confirmation counts.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `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. |
| `kind` | `string` | Yesrequired | `confirmed`, `partly_confirmed` or `rejected`. One of `confirmed`, `partly_confirmed`, `rejected` |
| `note` | `string` | Nooptional | What happened, at most 200 characters. Required unless `kind` is `confirmed`. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `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. `notification_pending`: A message about this declaration is still waiting for the authority’s answer. One message at a time. `authorisation_not_in_force`: The company’s access to the authority is not in force. Nothing was sent. `not_departed`: The vehicle did not leave yet. A vehicle change and a confirmation come after departure. `uit_expired`: The validity of the UIT code ended. The gateway refuses a correction, a vehicle change and a confirmation; a deletion is still accepted. | `Error` |
| `422` | `note_required`: A partial confirmation or a refusal needs a note that says what happened. `note_too_long`: The note is longer than 200 characters. | `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

```bash
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

```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

```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
<?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#

```csharp
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();
```

### Response `202`

JSON

```json
{
  "operationId": "e1bb11f2-8c23-4010-8e1e-510059fa0fe4",
  "status": "accepted",
  "aggregateId": "15699075-5c6a-4a8b-a225-166309ad1b48",
  "aggregateRevision": 4
}
```

## List the history of a declaration

GET `/etransport/v1/declarations/{declarationId}/history`

Returns everything that happened to the declaration, oldest first, with the time. The entry of `submitted` carries the `uploadIndex`, the entry of `accepted` the `uit`, and the entry of a `rejected` message the words of the authority exactly as it wrote them.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |
| `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

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | A page of history entries. | `HistoryPage` |
| `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` |
| `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

```bash
curl "$RDC_BASE_URL/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/history?limit=20" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/history?limit=20`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/history?limit=20',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/history?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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/history?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

```json
{
  "items": [
    {
      "event": "created",
      "at": "2026-11-23T07:02:10Z",
      "uploadIndex": null,
      "uit": null,
      "message": null
    },
    {
      "event": "validated",
      "at": "2026-11-23T07:04:31Z",
      "uploadIndex": null,
      "uit": null,
      "message": null
    },
    {
      "event": "authorized",
      "at": "2026-11-23T07:04:31Z",
      "uploadIndex": null,
      "uit": null,
      "message": null
    },
    {
      "event": "queued",
      "at": "2026-11-23T07:04:32Z",
      "uploadIndex": null,
      "uit": null,
      "message": null
    },
    {
      "event": "submitted",
      "at": "2026-11-23T07:04:35Z",
      "uploadIndex": "1000128",
      "uit": null,
      "message": null
    },
    {
      "event": "processing",
      "at": "2026-11-23T07:05:05Z",
      "uploadIndex": "1000128",
      "uit": null,
      "message": null
    },
    {
      "event": "accepted",
      "at": "2026-11-23T07:05:41Z",
      "uploadIndex": "1000128",
      "uit": "4F7K2Q9M8X1D6383",
      "message": null
    }
  ],
  "nextCursor": null
}
```

## Get the driver sheet

GET `/etransport/v1/declarations/{declarationId}/driver-sheet`

Returns what the driver carries: the UIT code, the plates, the route, the goods and the days the code is valid. It exists once the declaration has a UIT code.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `declarationId` | path | `string (uuid)` | Yesrequired | The declaration. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | The driver sheet. | `DriverSheet` |
| `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` | `declaration_not_found`: The declaration does not exist in your account. `driver_sheet_not_found`: The declaration has no driver sheet: it has no UIT code yet, it was deleted, or its validity ended. | `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

```bash
curl "$RDC_BASE_URL/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/driver-sheet" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/driver-sheet`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/driver-sheet',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/driver-sheet');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/etransport/v1/declarations/4533692d-469c-4b70-acdb-d1a9a4a0f54f/driver-sheet");
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

```json
{
  "declarationId": "4533692d-469c-4b70-acdb-d1a9a4a0f54f",
  "uit": "4F7K2Q9M8X1D6383",
  "reference": "LIV-2026-01842",
  "operationType": "TTN",
  "vehicle": "ZZ21BRM",
  "trailers": [],
  "validFrom": "2026-11-23",
  "lastValidDay": "2026-11-27",
  "from": {
    "kind": "address",
    "county": 27,
    "locality": "Piatra-Neamț",
    "street": "Str. Depozitelor",
    "number": null,
    "notes": "Rampa 4"
  },
  "to": {
    "kind": "address",
    "county": 27,
    "locality": "Târgu Neamț",
    "street": "Str. Principală",
    "number": null,
    "notes": null
  },
  "goods": [
    {
      "name": "Cartofi albi, sac de 25 kg",
      "quantity": "6",
      "unit": "XBG",
      "grossMass": "151.80"
    },
    {
      "name": "Ceapă galbenă, plasă de 10 kg",
      "quantity": "4",
      "unit": "XBG",
      "grossMass": "40.60"
    },
    {
      "name": "Morcovi, sac de 10 kg",
      "quantity": "4",
      "unit": "XBG",
      "grossMass": "40.60"
    },
    {
      "name": "Mere Golden, ladă de 12 kg",
      "quantity": "8",
      "unit": "XCR",
      "grossMass": "103.20"
    },
    {
      "name": "Apă minerală plată, 2 l, set de 6",
      "quantity": "10",
      "unit": "XPK",
      "grossMass": "127.00"
    },
    {
      "name": "Băutură carbogazoasă îndulcită, 2 l, set de 6",
      "quantity": "3",
      "unit": "XPK",
      "grossMass": "38.10"
    }
  ],
  "documents": [
    {
      "type": "delivery_note",
      "number": "AV-1042",
      "date": "2026-11-23"
    },
    {
      "type": "invoice",
      "number": "BRD-2026-00418",
      "date": "2026-11-23"
    }
  ],
  "totals": {
    "lines": 6,
    "grossMass": "501.30",
    "value": "1176.00"
  }
}
```
