Sirenic: the ready customer file, Google Sheets template Version 2026-11-12. En français : https://api.sirenic.eu/modeles/fichier-clients-pret-mode-d-emploi.txt WHAT THE TEMPLATE DOES It completes each row of your customer file with Sirenic's batch identity route (/v1/identite/lot): SIREN, head office SIRET, company status and cessation date, VAT number checked on VIES, duplicates over the whole file. It only reads the input columns below, and only sends the row it read for each customer. INSTALL, ONCE PER SPREADSHEET 1. Open your file in Google Sheets; the first row carries the column headers. 2. Extensions > Apps Script: replace the content of the Code.gs file with the code served at https://api.sirenic.eu/modeles/fichier-clients-pret.gs, then save. 3. Reload the spreadsheet: the Sirenic menu appears. On first run, Google asks for your permission: the template reads and writes this spreadsheet only, and calls https://api.sirenic.eu. 4. Sirenic > Enter my key: paste your key (it starts with srn_live_). It is kept in the script properties for your Google account only, never in a cell. An editor of the spreadsheet can change the script: only paste your key in a spreadsheet whose editors you know, preferably a separate key for the template, revocable from your account. Sirenic > Forget my key removes it. No key yet: https://api.sirenic.eu/compte?utm_source=template&utm_campaign=tableur-sheets THE COLUMNS READ (the header of the first row, read case and accents aside, any sign other than a letter or a digit read as _: "VAT number" reads vat_number) - SIREN: siren, n_siren, no_siren, num_siren, numero_siren, siren_client - SIRET: siret, n_siret, no_siret, num_siret, numero_siret, siret_client - French VAT number: tva, n_tva, no_tva, num_tva, numero_tva, numero_de_tva, tva_intracommunautaire, n_tva_intracommunautaire, vat, vat_number, vat_id - name: denomination, raison_sociale, societe, entreprise, company_name, legal_name, company, nom_client, nom, name, client - postcode: code_postal, cp, codepostal, postcode, postal_code, zip, zip_code - address: adresse, adresse_postale, adresse_complete, address, postal_address, street_address For each input, the column with the most precise header wins, wherever it stands (in the order of the lists above: denomination or raison_sociale before nom); a nom or name column next to a first name column (prenom, prenoms, first_name, firstname, given_name) is a contact's name: it is never sent. Each row is sent by its SIREN when filled, else by its SIRET, else by its French VAT number, else by its name and postcode; with no postcode, the template takes the last five-digit postcode of the address column. A value present but unreadable is never replaced by the next column: the row is marked entree_illisible. A SIREN, SIRET or postcode whose leading zeros the spreadsheet dropped gets them back. THE COLUMNS ADDED BY SIRENIC (right of the file) Each header starts with sirenic_ and is read as is, letter for letter: one of your columns ("État", "A revoir", "Status") is never taken for a Sirenic column, never filled nor overwritten; a column that carries exactly one of these headers is filled by Sirenic. A missing column is added on the right. - sirenic_statut : the row state: complete, a_completer (nothing to send), entree_illisible, ligne_trop_longue, a_verifier (an answer without readable rows, which may have been charged: the row is not sent again on its own), or non_envoyee_ when the pass stopped before it - sirenic_resolution : the route's resolution (resolu, a_confirmer, introuvable, siren_invalide, siren_inconnu, non_diffusible) - sirenic_siren : the SIREN found - sirenic_siret_siege : the head office SIRET - sirenic_denomination : the legal name, for a legal person with full disclosure only - sirenic_etat : the company status (actif, cesse) - sirenic_date_cessation : the cessation date of a ceased company - sirenic_tva : the computed intra-EU VAT number - sirenic_tva_vies : its check on VIES (valide, invalide, indisponible, non_verifie), with the reason of an unchecked number - sirenic_candidats : for an a_confirmer row, the legal persons proposed: SIREN, legal name and score - sirenic_doublon_de : the number of the higher row that carries the same SIREN, over the whole file - sirenic_a_revoir : the reasons to review the row (list below), empty otherwise - sirenic_date_lecture : the day (UTC) of the last identity read - sirenic_ligne_envoyee : the row sent, as the template read it from your columns: it tells whether the input changed since (compared case, accents and spaces aside) - sirenic_requete : the request number of the call that served the row, the one in the numero_requete column of the log - sirenic_changements_depuis : the date from which changes were read - sirenic_changements_verdict : the re-read verdict (nouveautes, rien_de_nouveau, lecture_incomplete, ligne_non_resolue, non_diffusible, budget_lot_epuise) - sirenic_changements_nombre : the number of changes - sirenic_changements_derniers : the most recent ones: date and type - sirenic_date_relecture : the day (UTC) from which the next re-read reads changes: that of the last complete re-read, or the start date kept from an incomplete re-read THE sirenic_a_revoir COLUMN - entree_illisible : a value present but unreadable (SIREN, SIRET, VAT, name or postcode): nothing is sent for the row - ligne_trop_longue : the row read (mostly the name) is too long for the address of a Google call: nothing is sent; shorten the name - code_postal_manquant : a name with no postcode, neither in its column nor in the address - nom_manquant : a postcode or an address with no name - non_envoyee : the pass stopped before the row: run it again - reponse_a_verifier : the service answered without readable rows: the call may have been charged (log, number in sirenic_requete); the row is not sent again on its own: clear its sirenic_statut cell (for a re-read, this code) to send it again, it will be paid again - feuille_changee : the sheet changed during the pass: the result already received for the same input was set on this row; check it - introuvable : no company found - a_confirmer : several possible companies: see sirenic_candidats - siren_invalide : the SIREN check digit is wrong - siren_inconnu : SIREN absent from the Sirene stock served - non_diffusible : no name and no address served (sole proprietor, or restricted unit); SIREN, head office SIRET, status and VAT are - recherche_partielle : part of the search could not be read: to read the row again, clear its sirenic_statut cell then run Complete again; it is paid again - cessee : the company has ceased - tva_invalide : VIES says the VAT number is invalid - tva_non_verifiee : the VAT number could not be checked on VIES - doublon : same SIREN as a higher row (sirenic_doublon_de) - a_change : changes since the last pass - changements_incomplets : the re-read did not read everything: its start date is kept, the next re-read, on another day (UTC), reads the whole period again Sirenic > Rows to review sets a filter on this column. COMPLETE THE FILE Sirenic > Complete the file. Each call sends at most the number of rows a free call accepts, read from https://api.sirenic.eu at the start of each pass: with a free key, a call falls within the month's free lines if it fits in what is left of them; otherwise it is paid in full from your credits, at the published price list, and what is left of the free lines serves a shorter call. Identical rows are sent once. A completed row is never sent again, unless you change its input. A single row is sent with a copy of itself: the route requires two rows; outside the free lines, the copy costs one row (within the month's free lines, it takes one of them), and the log says so. Google stops a script after a few minutes: the pass stops before and says so; run it again to continue. Do not edit the sheet during a pass. Before writing, the template reads the input of each row again: if it moved (row inserted, deleted or sorted, input edited), it stops, writes nothing on another row, and sets the results already received on the rows with the same input (code feuille_changee), so that nothing is paid twice. THE LOG The Journal Sirenic sheet keeps one row per call (horodatage_utc, action, lignes_envoyees, statut_http, resultat, credits_debites, lignes_gratuites_restantes, credits_restants, numero_requete), read from the response: it shows what each call charged and the free lines left this month. ERRORS - 401: the key is refused (unknown, expired or badly copied); the pass stops. - 402: the call does not fit in the free lines left this month, and the credit balance does not cover it; nothing is charged, the pass stops and gives the call price and the balance, read from the response. - 429: the service is rate limiting; the template waits the announced delay and tries once more, then stops and says when to try again. - 503: the service is temporarily unavailable; nothing is charged; same wait, same retry. - 200 without readable rows: the call may have been charged; the pass stops, its rows carry sirenic_statut a_verifier and the request number, and are not sent again on their own. An answer in error is never charged. The rows of a stopped call carry sirenic_statut non_envoyee_. WHAT HAS CHANGED SINCE MY LAST PASS At the end of a pass, the template offers the re-read. Sirenic > What has changed since my last pass sends the resolu rows again by their SIREN, with the date of their last read (parameter depuis), and writes sirenic_changements_verdict, sirenic_changements_nombre and sirenic_changements_derniers; the identity is read again at the same time. A re-read row costs the price list's price with depuis; calls follow the same free lines rule. A single row is sent with a copy of itself: the route requires two rows; outside the free lines, the copy costs one row (within the month's free lines, it takes one of them), and the log says so. A row read or re-read today (UTC) is not sent again the same day: a stopped re-read goes on with the other rows. An incomplete re-read keeps its start date: the next one reads the whole period again. EXPORT Sirenic > Export as CSV: a semicolon-separated file, with BOM, that opens as is in Excel. A cell that would start a formula (=, +, -, @) gets an apostrophe in front. Google Sheets' File > Download menu stays available. PERSONAL DATA Sirenic never serves the name or the address of a sole proprietor: the row carries the resolution non_diffusible, with its SIREN, head office SIRET, status and VAT. The candidates of an a_confirmer row are legal persons. The API never echoes the typed name in its response or its logs. Your file stays in your spreadsheet. LANGUAGE The menu and messages follow the spreadsheet language (File > Settings).