Next.js developer in Iași

Next.js for businesses in Iași, delivered remotely by one developer.

Next.js 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.

My WordPress.org profile

A checkout that sells to Romanian companies often needs one fact before it prices an order: is the buyer registered for VAT? ANAF, the Romanian tax authority, publishes a web service that answers that for a CUI. I am Mariusz Szatkowski, one developer in Gdynia working on Next.js projects remotely and in writing, with WordPress since 2006. This page is based on the ANAF documentation of version 9 of the service, read on 4 December 2026, and on test calls I made to it. I am not a lawyer or an accountant, so what the answer means for an invoice is for your accountant.

Palace of Culture in Iași

The Palace of Culture in Iași, a view of the city and not a client reference. Photograph by Pierre André Leclercq (CC BY-SA 3.0 RO), via Wikimedia Commons.

#What is the ANAF VAT web service?

ANAF documents a web service for checking taxpayers against five registers, in the words of its documentation: the taxpayers registered under art. 316 of the Fiscal Code, the register of persons applying the VAT on cash accounting system, the register of inactive and reactivated taxpayers, the register of persons applying split VAT payment, and the RO e-Factura register. The documentation is a plain text file on static.anaf.ro, and the version in its address is v9.

Requests go to one address by POST: https://webservicesp.anaf.ro/api/PlatitorTvaRest/v9/tva. The documentation is written in Romanian and I translate its terms below.

#How do I send a request?

The body is a JSON array. Each item has two fields: cui, the tax identification number, and data, which the documentation describes as the date for which the search is run. The content type is application/json. The example in the documentation uses fictive numbers and the date format 2015-02-14, so the date is year, month, day.

[
  { "cui": 1234, "data": "2026-12-04" }
]

The cui appears as a number in the example. In my test, a value sent as the text RO2816464 got HTTP 400, and the digits alone as a number were answered. So a checkout field that accepts “RO 2816464” needs a normalisation step that strips the prefix and spaces before the call. The documentation does not describe this case, which is why I tested it.

#What does the response contain?

The documented answer has two top-level lists: found, with one object per CUI that was found, and notFound, with the CUI numbers that were not. The documentation’s sample also shows cod and message fields. In my test calls the answer had only found and notFound, so code should not depend on cod.

Each object in found is split into groups:

GroupWhat it holds, as documented
date_generalename, address of the tax domicile, trade register number, registration status and date, CAEN code, IBAN, RO e-Factura status
inregistrare_scop_TvaVAT registration: the flag scpTVA and the periods
inregistrare_RTVAIVAT on cash accounting: dates and the flag statusTvaIncasare
stare_inactivinactive and reactivated status with dates and the flag statusInactivi
inregistrare_SplitTVAsplit VAT payment: dates and the flag statusSplitTVA
adresa_sediu_social, adresa_domiciliu_fiscalregistered office and tax domicile, split into street, number, locality, county, country and postal code

The documentation defines the flags in terms of the date you searched. scpTVA is true for a VAT payer at the searched date and false when the taxpayer is not a VAT payer at that date. statusInactivi is true for an inactive taxpayer and false when it is not inactive at the searched date. statusRO_e_Factura is true when the taxpayer is in the RO e-Factura register at the searched date.

One shape detail: the documentation’s sample shows the VAT periods as an object, but my test returned them as a list, perioade_TVA, with a start date, an end date, the date the cancellation was recorded and a legal reason message. Code that reads the field should accept a list.

#What are the limits?

The documentation sets two rules. A request may contain at most 100 CUI numbers, and a client may send at most one request per second. It adds that any attempt to overload the server will be penalised according to the regulations in force. A checkout that serves one buyer at a time stays far below that. A batch job that re-checks a customer list does not: 100 numbers per call and one call per second is the ceiling, so 10,000 customers take at least 100 seconds, and the job should pace itself and not retry in a tight loop.

An unknown CUI is not an error. The service answers with the number in notFound, as my test with an invalid number showed.

#Where does the call belong in a Next.js checkout?

On the server. The Next.js documentation says Server Functions are reachable by direct POST requests, so a function that does the check must verify authentication and authorization itself. A public checkout lets guests in, so the check needs its own limit per visitor, or the form becomes a way to push traffic at ANAF through your server. That matters because of the one-request-per-second rule, which applies to your client address.

The extended fetch in Next.js lets each server request set its caching. The documentation says cache: 'no-store' fetches on every request, and that caching is opt-in for POST requests. The answer depends on the date asked, so a checkout that asks for the order date should not cache it at all:

// app/lib/anaf-vat.ts
import 'server-only'

const ANAF_URL = 'https://webservicesp.anaf.ro/api/PlatitorTvaRest/v9/tva'

export async function checkVat(rawCui: string, date: string) {
  // Strip the RO prefix and spaces: the service wants a number
  const digits = rawCui.replace(/^RO/i, '').replace(/\s/g, '')
  if (!/^\d+$/.test(digits)) return { status: 'invalid' as const }

  const res = await fetch(ANAF_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify([{ cui: Number(digits), data: date }]),
    cache: 'no-store',
  })
  if (!res.ok) return { status: 'unavailable' as const }

  const body = await res.json()
  if (body.found?.length !== 1) return { status: 'not-found' as const }
  const vat = body.found[0].inregistrare_scop_Tva
  return { status: 'ok' as const, vatPayer: vat.scpTVA === true, checkedOn: date, body }
}

The function separates four outcomes: invalid input, ANAF not reachable, number not found, and an answer. That separation is the useful part. What the shop does on “unavailable” is a business decision: let the order through and check later, or hold it. The code only has to make that decision visible.

#What should the shop store?

The answer refers to a date. If the checkout stores the date it asked for, the flag it received and the raw body, the accountant later sees what the shop knew on the day of the order. I would keep that record with the order, and not re-run the check at invoice time and overwrite it. This is a design choice of mine. Whether the check has any effect on the VAT treatment of the invoice is for the accountant, and the documentation I read does not say.

#What does the check not tell you?

The service reports registration states. It does not say whether the person typing the CUI works for that company. It does not decide how a sale to that buyer is taxed. It also says nothing about customers outside Romania, since it is a Romanian register. The documented flags say what ANAF lists for a CUI at a date, and nothing beyond that.

Two cases are worth a test before launch:

  1. A company flagged inactive at the order date, so statusInactivi is true. The form should show that state and not hide it.
  2. A company whose VAT registration was cancelled, with an end date in perioade_TVA. The checkout asks for the order date, and the flag for that date is what counts.

WordPress support & development in Iași

Need this service: Next.js developer in Iași?

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

Describe your project

Explore other WordPress services and knowledge base