PHP developer in Bucharest

WordPress for businesses in Bucharest, delivered remotely by one developer.

PHP developer

My place in the WordPress community

  • I have had a wordpress.org account since 2006.
  • I contributed to WordPress core for versions 7.0 and 7.1.
  • I maintain 30 plugins on wordpress.org.
  • I organise and speak at WordCamps.
  • I have attended every WordCamp Europe from 2017 to 2026.
  • Local WordPress meetup: Bucharest WordPress Meetup

My WordPress.org profile

A Bucharest company that moves goods by road can have a declaration duty before the truck leaves. This page is about the ANAF and Ministry of Finance rules for RO e-Transport and how a custom PHP logistics or order system should carry the declaration data. The author is Mariusz Szatkowski, an independent developer who works from Gdynia, by email and shared documents. I am not a lawyer: scope questions go to your adviser, and I build what the documents describe.

The Romanian Athenaeum seen along Calea Victoriei in Bucharest

Photograph of the Romanian Athenaeum on Calea Victoriei by Ion Gheban, shared under CC BY-SA 4.0 on Wikimedia Commons.

#What is RO e-Transport?

RO e-Transport is the national system for monitoring the road transport of goods. According to the Ministry of Finance presentation page, it generates a unique registration code for each transport. The ANAF page for RO e-Transport leads to the Ministry of Finance documentation site, and the technical files for developers sit there.

The procedure that governs it is approved by the joint order of the ANAF president and the president of the Romanian Customs Authority, 1,337/1,268/2024, published in Official Gazette 597 of 27 June 2024. It repealed the earlier Order 2,545/6,316/2022. I read the English informative version published by the Ministry of Finance. The legal text is the Romanian one in the gazette.

Under Article 1 of the procedure, the system monitors the international road transport of goods of any kind, and the road transport of goods with high fiscal risk. It covers a laden journey on public roads with a place of departure or entry on the national territory and a point of arrival or exit, on the territory of Romania.

#Which transports are in scope?

The order sets a threshold in Article 1(4). Vehicles subject to monitoring are those with a technically permissible maximum mass of at least 2.5 tonnes, loaded with goods with a total gross mass of more than 500 kg or a total value of more than 10,000 lei, relating to at least one part of the goods being transported.

Scope still depends on the operation and on who the declaring party is. The procedure points to Emergency Ordinance 41/2022 for the categories and for the users who must declare. The Ministry of Finance lists the amending acts on its legislation page, up to Emergency Ordinance 129/2024 published on 11 November 2024. I read the order and the technical pages, not every amending act. For a given product line, the question “does this shipment need a declaration” goes to your adviser or forwarder, and the answer becomes configuration in the system.

#What is a UIT code?

After the data of a transport is transmitted, the system automatically assigns a unique identification number, the UIT. Article 3 sets how many: when a shipment includes several transports that meet the Article 1(4) conditions, one UIT is issued for each transport. For a shipment crossing the border or running within Romania, all transports of the shipment are declared and the system generates a single UIT for them.

The UIT travels with the shipment:

  • the transport organiser or carrier has to hand the UIT to the driver in an intelligible form (Article 8(3))
  • where the vehicle has a device for transmitting positioning data, the UIT codes are entered into it before the journey, and the driver switches it on and enters the codes before the national leg starts (Articles 8(1) and 9(1))

The format is fixed in the ANAF XML schema. A UIT is 16 characters: 14 from the digits and the capital letters except O, I, Z, S, G and B, then two digits. A comment in the schema says the last two digits are the last two digits of the sum of the ASCII codes of the preceding characters. I tested this in PHP against the UIT codes in the ANAF sample files, and both matched:

<?php
declare(strict_types=1);

function uitIsValid(string $uit): bool
{
    if (preg_match('/^[0-9ACDEFHJKLMNPQRTUVWXY]{14}[0-9]{2}$/', $uit) !== 1) {
        return false;
    }
    $sum = array_sum(array_map('ord', str_split(substr($uit, 0, 14))));
    return substr($uit, 14) === sprintf('%02d', $sum % 100);
}

var_dump(uitIsValid('4L5Y2W6Q0C8K4A05')); // bool(true), from an ANAF sample file
var_dump(uitIsValid('4L5Y2W6Q0C8K4A06')); // bool(false), wrong check digits

A check like this catches a mistyped code in a warehouse screen before it reaches the driver. It does not prove the UIT exists in the ANAF system.

#What does the XML declaration contain?

The declaration is an XML file. The Ministry of Finance publishes schema version 2 (dated 26 January 2023), a Schematron file, a field structure sheet and sample files. The root element is eTransport with the attributes codDeclarant and refDeclarant, and it holds exactly one of four children: a notification, a deletion, a confirmation or a vehicle change.

A notification carries:

  • the goods lines, each with a tariff code, name, quantity, unit, net and gross weight and the value in lei without VAT
  • the commercial partner
  • transport data such as the vehicle plate, the carrier and the date of transport
  • the start and end of the road route
  • at least one transport document, such as an invoice

The operation type is a code: 10, 12, 14, 20, 22, 24, 30, 40, 50, 60 or 70. The list in the API description names them: 10 AIC, 12 LHI, 14 SCI, 20 LIC, 22 LHE, 24 SCE, 30 TTN, 40 IMP, 50 EXP, 60 DIN and 70 DIE. Each operation type allows its own purpose codes in the schema. For a TTN, transport on the national territory, the ANAF sample uses purpose code 101, commercialisation.

Article 3 of the procedure also fixes how the numbers are filled:

  • the total value excludes VAT
  • a value in foreign currency is converted to lei at the National Bank of Romania rate valid on the day of the declaration
  • the gross mass counts the net mass plus the packaging needed to sell and transport the goods

These rules belong in one place in code, a mapper from your order and shipping records to the XML, with tests. A rounding difference or a VAT-inclusive total in a warehouse export would otherwise be sent as it is.

#Which API calls does ANAF document?

The Ministry of Finance publishes a description of the services, last dated 29 July 2024. Authentication is either a digital certificate presented at call time, or OAuth2. The paths differ by host: the certificate variant uses webserviceapl.anaf.ro, the OAuth2 variant uses api.anaf.ro, and each has a test and a prod environment.

ServiceCallPurpose
UploadPOST on /ETRANSPORT/ws/v1/upload/ with the standard, the tax code and the versionsubmits the XML, with Content-Type: application/xml
StatusGET on /ETRANSPORT/ws/v1/stareMesaj/ with the upload indexstate of a submitted declaration
ListGET on /ETRANSPORT/ws/v1/lista/ with days (1 to 60) and the tax codefinal states of valid notifications and notifications with errors
InfoGET on /ETRANSPORT/ws/v1/info with query parametersactive notifications in which the given tax code is the transport organiser

The standard value accepted is ETRANSP, the tax code is numeric with at most 13 digits and the version is 1 or 2. The upload index returned at upload is the key for the status call. The same page says the earlier download service was removed from both the test and production environments, and that the list service changed, so a client written from an older description should be rechecked against the current documentation.

The list service returns no intermediate states for valid notifications, and the records are not sorted. The description tells users to sort locally by the creation date field. Each record carries the UIT, the declarant’s reference, the operation type and the transport date.

A minimal upload from PHP with the standard curl functions looks like this. Authentication is left out, because it follows the ANAF method you choose:

<?php
declare(strict_types=1);

function uploadTransport(string $baseUrl, string $cif, string $xml): string|false
{
    $ch = curl_init("$baseUrl/ETRANSPORT/ws/v1/upload/ETRANSP/$cif/2");
    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => $xml,
        CURLOPT_HTTPHEADER => ['Content-Type: application/xml'],
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT => 30,
        // add the certificate or OAuth2 authentication ANAF documents
    ]);
    $response = curl_exec($ch);
    curl_close($ch);
    return $response;
}

Here $baseUrl is one of the test or production hosts named above, and the test host comes first in any new build.

#How should the shipment model look?

A declaration is not a field on an order. It is a record with its own life, and one shipment can have several. A table that works for this keeps:

  • the shipment and the declaring tax code
  • the operation type and purpose code
  • refDeclarant, your own reference, up to 50 characters in the schema, which the list and info services echo back
  • the upload index returned by the API
  • the status and the UIT once issued
  • the error messages from the response, as text
  • the XML that was sent, kept as sent
  • the date of transport and the dates of each change

The upload does not give the final answer. Article 6(3) says that until validation and storage finish, the data has the status processing. So the code sends the XML in a queued job, stores the upload index, and a second job reads the status until it is final. Printing the delivery note waits for a UIT. A shipment without one is blocked in the warehouse screen with the reason shown.

Validate the XML against the published schema before sending. PHP can do that with DOMDocument::schemaValidate() on the file from the Ministry of Finance, and libxml_use_internal_errors() collects the messages. The Schematron rules are a second layer, and the system’s semantic checks run on ANAF’s side in any case. A failed file is not a submitted declaration, so a retry is a new upload, not a duplicate.

#What happens after the UIT is issued?

The procedure covers the cases that break a clean flow, and each one should have a path in the code.

  • Changes before departure. Within the validity period, and not later than the moment the vehicle actually starts on public roads, the data is modified under the original UIT (Article 4(1)). The order refers to a validity period of 3 calendar days set in Article 11(1) of Emergency Ordinance 41/2022.
  • Vehicle swap. After the vehicle has started, the transport organiser updates the vehicle data through its own account (Article 4(2)). In the XML this is the vehicle change element, which needs the UIT, the plate and the date and time of the change.
  • Confirmation. After the shipment is finalised, the user can confirm it as confirmed, partially confirmed or rejected, with a comment (Article 5). If the user does nothing by the end of the UIT validity, the system treats the shipment as confirmed.
  • Goods not accepted. Returned goods go back to the loading warehouse or the nearest warehouse of the consignor on the original UIT. The return of the accepted part is a new shipment that needs a new UIT (Article 3(11)). The declarant records the return in the confirmation, with the quantities in the comment field (Article 3(13)).
  • Transport not finished in time. The declarant invalidates the transport and obtains a new UIT. Once the vehicle has started, the way to invalidate is the confirmation option “Revoked”, with the cause in the comment (Article 3(18)).
  • Van sales. When the recipients are not known at departure, the order says to choose the TTN operation with the purpose “transfer between management”, and to enter the furthest address of the route (Article 3(17)).

A queue-based design keeps these as separate message types: notification, correction, vehicle change, confirmation, deletion. They match the four XML children plus a correction inside the notification. Each message links to the UIT of the shipment, and the history stays in the table.

#What can break an integration?

Most failures follow from the documents above, not from PHP:

  • an old description of the services, with a removed download call or a changed list call
  • the wrong schema version in a template after ANAF publishes a new Schematron file (the 12 August 2024 release added the code XK for Kosovo to the country lists)
  • a value with VAT, or in euro without conversion, in the lei field
  • a reference longer than the 50 characters the schema accepts
  • a polling job that treats processing as an error and sends the same file again
  • a warehouse screen that lets the driver leave without a UIT

The test environment exists for the first four. Run a full cycle there with the sample files from the Ministry of Finance, and then with a few real shipments of your own, before production.

#How does a project run?

  1. You send the shape of the flow: where shipments originate, who the carrier is, which operation types occur, and what your ERP or order system exports today. A first answer with my questions on the flow arrives by email on the next working day.
  2. I write down the scope, my assumptions and the questions for your adviser on which shipments are in scope.
  3. I build on a staging copy with the ANAF test environment, and you check declarations and error cases with sample shipments.
  4. Once you accept in writing, I move the integration to production, with the queue, status polling and an error view for the warehouse team.

I need read access to the order and shipping data model, and test credentials for the ANAF environment. What I offer for custom PHP work in general is on the PHP developer page.

#Bring the shipment flow

If your Bucharest company ships goods on Romanian roads and the declarations still go through a web form by hand, send the flow and the operation types through the contact form. A written estimate for the PHP integration costs nothing, and the adviser’s answer on scope comes first.

Need this service: PHP developer in Bucharest?

Describe your project by e-mail. I reply within 24 hours.

Describe your project

Latest PHP developer articles

Dec 2, 2026

Laravel Rust: what does it mean for PHP apps?

On 1 December 2026 Taylor Otwell shipped the Laravel Rust beta, and Laravel Go followed a day later. What the framework contains, what the 18x benchmark really measures, what happens to Laravel PHP and WordPress, and when a rewrite makes sense.

Explore other WordPress services and knowledge base