Attestwire › Rule reference › ATW-SIREN-INVALID

ATW-SIREN-INVALID A SIREN must be nine digits with a valid check digit

noun · Attestwire · warning · BT-30

For a sample invoice, the library reports: The seller legal registration identifier (BT-30) is "123456789" under scheme 0002, the French SIRENE register, which makes it a SIREN: the nine digits INSEE gives a company. This one fails the Luhn check its ninth digit exists for, so a digit is almost certainly mistyped or swapped.

Business term
BT-30
Severity
warning

The fix

Take the SIREN from the company's registration, such as its Kbis extract or the SIRENE register, rather than retyping it, and write seller.legalRegistrationId as nine digits without spaces.

A passing value

the shape this field expects
"legalRegistrationId": "123456782", "legalRegistrationSchemeId": "0002"

What the library returns

The full error returned by @attestwire/en16931. It includes the rule ID, affected field and suggested correction. Developers can use this object in their application:

TeachingError
{
  "rule": "ATW-SIREN-INVALID",
  "field": "BT-30",
  "severity": "warning",
  "message": "The seller legal registration identifier (BT-30) is \"123456789\" under scheme 0002, the French SIRENE register, which makes it a SIREN: the nine digits INSEE gives a company. This one fails the Luhn check its ninth digit exists for, so a digit is almost certainly mistyped or swapped. French invoicing platforms, Chorus Pro among them, find the company or establishment by this number, so an invoice carrying one that does not exist cannot be matched to it. This is a warning of this library, not a rule of EN 16931 or of a CIUS, so it never makes the invoice invalid.",
  "fix": "Take the SIREN from the company's registration, such as its Kbis extract or the SIRENE register, rather than retyping it, and write seller.legalRegistrationId as nine digits without spaces.",
  "example": "\"legalRegistrationId\": \"123456782\", \"legalRegistrationSchemeId\": \"0002\"",
  "xpath": "/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID",
  "docsUrl": "https://github.com/attestwire/en16931#not-implemented-yet"
}

xpath is always a UBL path. On a CII invoice, look for the matching CII field instead.