Companies and establishments
Companies are the legal entities on whose behalf you invoice in Scribee: seller on sales invoices, buyer on purchase invoices (Issue a sales invoice). The company part of an invoice can never point at a customers and suppliers directory record: a party_id on the seller role of a sales invoice, or the buyer role of a purchase invoice, is rejected. Omit that party and Scribee derives it from the company record; send it in full and your values are the ones stored. Establishments describe a company's physical sites. Only name is required; the SIRET (legal_identifier) is optional and has no bearing on addressing in the reform directory. It is the directory entry that carries the SIRET deciding its granularity: an entry with a SIRET addresses the establishment, a SIREN-only entry covers the whole legal entity. That entry is created with its own SIRET, independently of your establishment records, whether or not those carry one (National directory). This page covers creating and managing both through the API.
What Scribee does for you
- Normalizes a company's legal identifier and VAT number at registration: leading and trailing spaces removed, letters uppercased.
- Checks that a French company's legal identifier is its 9-digit SIREN: a SIRET is refused there.
- Locks a company's legal identifier while an Incomplete, Pending review or Active mandate covers it, and once one of its e-reporting declarations has been transmitted to the PPF.
- Checks that an establishment's SIRET has exactly 14 digits.
- Keeps at least one company per workspace: the last one cannot be deleted.
- In an accounting-firm workspace, applies an offer upgrade immediately, books a downgrade for the 1st of the following month, and keeps the history of each company's offer changes.
Step 1: create a company
This call creates the company record in your workspace. Nothing is transmitted externally: not to the PPF (Portail Public de Facturation), not to the Peppol network. It is undone with the DELETE from step 6, but only as long as the company has produced no attached data: step 6 lists every blocker, read it before relying on that reversibility. The write scope is required.
curl -X POST https://app.scribee.tech/api/v1/workspaces/YOUR_WORKSPACE_ID/companies \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"company": {
"name": "Acme Corp SAS",
"commercial_name": "Acme",
"legal_registering_country": "FR",
"legal_identifier": "443061841",
"vat_identifier": "FR32443061841"
}
}'
201 response, abridged to the fields useful here (each company also carries created_at and updated_at):
{
"data": {
"id": 7,
"name": "Acme Corp SAS",
"commercial_name": "Acme",
"legal_registering_country": "FR",
"legal_identifier": "443061841",
"vat_identifier": "FR32443061841",
"company_legal_form": null,
"late_payment_disclaimer": null,
"recovery_costs_disclaimer": null,
"cash_discount_disclaimer": null,
"sep_manager": false,
"parent_id": null,
"e_reporting_declarant": "sole_company"
}
}
name is the only required field. legal_registering_country names the country that registered the company; left blank, it counts as France. When it is FR or blank, legal_identifier carries the company's SIREN, exactly 9 digits: a 14-digit SIRET, like any other value, is refused with 422 and the error under details.legal_identifier (Errors and edge cases). Spaces between the digits are allowed and removed when stored: 552 100 554 is accepted and stored as 552100554. The SIRET identifies an establishment and goes in the establishment's legal_identifier (step 4). For any other country, the format is free. For e-reporting, a company registered in another country nevertheless carries a SIREN when its legal_identifier is one: exactly 9 digits, without spaces, whose check key (Luhn algorithm) is valid, 000000000 excepted. Scribee then reads it as the company's SIREN, just as it reads that of a company registered in France, for e-reporting and for its attachment to the other companies of the workspace carrying this SIREN. The national directory and the mandates never read it: for them, only a company registered in France carries a SIREN, and the number of the mandates of a company registered elsewhere takes the historical shape (Electronic invoicing mandates). Any other legal_identifier of a company registered outside France is never read as a SIREN, whatever its digits: 14 digits are not truncated to their first 9. In every case, legal_identifier is at most 50 characters long, 32 for vat_identifier. Neither is unique: several companies, in the same workspace or in different workspaces, may carry the same SIREN or the same VAT number. The SIREN check applies on creation, then on every change to legal_identifier or legal_registering_country: a company recorded before this check with another identifier can still be modified on its other fields. Together with legal_identifier, the country decides the registration scheme carried by the invoice party derived from this record - a SIREN under a French country gives siren, and a foreign registration gives no scheme at all, even when it carries a SIREN (Issue a sales invoice). parent_id attaches the company to a parent company in the same workspace, making it a subsidiary; a circular attachment is rejected with a 422 status, and so is a parent company located in another workspace. A parent_id that points at no existing company is refused with a 422 too, with the error under details.parent (Errors and edge cases). No active company is attached to an archived parent company: a POST answers 403 and a PATCH 422 (403 Forbidden: archived company). Check the identifier with step 2 before sending it.
Three optional fields carry the legal mentions Scribee carries over onto your sales documents: late_payment_disclaimer (late-payment penalties), recovery_costs_disclaimer (fixed indemnity for recovery costs) and cash_discount_disclaimer (early-payment discount). They are free texts, stored as you send them, and every response returns them, as null until they are filled in. Each filled-in mention becomes a document-level note, under a fixed code: payment_detail_remittance_information for late_payment_disclaimer, payment_information for recovery_costs_disclaimer, terms_of_payment for cash_discount_disclaimer. It is added to every sales invoice created or modified through the API without an item_notes key (Issue a sales invoice), and to every quote created or modified through the API (Quotes). The note is copied when the document is built: changing a mention does not touch existing documents, only the ones you create or modify afterwards. A sales invoice Scribee issues that lacks one of the three notes is refused at deposit (The invoice lifecycle).
sep_manager declares that the company is the manager of one or more sociétés en participation (SEP) that it invoices (XP Z12-014 Annexe A, case 37). This optional boolean is false until you set it to true, and every response returns it; it is the "Gérant de sociétés en participation (SEP)" setting of the Electronic invoicing tab of the company's settings on Scribee. A SEP has no legal personality: the invoice its manager addresses to it carries the seller's SIREN as the buyer's. At true, Scribee no longer refuses at deposit a sales invoice of the company whose buyer carries its own SIREN; at false, that deposit is refused (The invoice lifecycle).
Step 2: list and look up your companies
GET /api/v1/workspaces/{workspace_id}/companies returns the workspace's companies; the read scope is enough. The include parameter (values parent, subsidiaries, establishments, comma-separated) adds the associations to each record.
curl "https://app.scribee.tech/api/v1/workspaces/YOUR_WORKSPACE_ID/companies?include=establishments" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
"data": [
{
"id": 7,
"name": "Acme Corp SAS",
"legal_identifier": "443061841",
"establishments": [
{
"id": 21,
"name": "Siège Paris",
"legal_identifier": "44306184100025",
"headquarters": true
}
]
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total_pages": 1,
"total_count": 1
}
}
The list is paginated (page, per_page - 20 by default, 100 maximum) and sortable (sort_by: name, commercial_name, legal_identifier, created_at, or updated_at; sort_order: asc or desc; default sort: name ascending). The envelope and pagination are described in API conventions. GET /api/v1/companies/{id} returns a single record, with the same include parameter.
By default, the list returns only active companies. The status parameter picks the listed companies by their archiving: active (the default), archived for archived companies only, all for every company; any other value answers 400 (see Errors and edge cases). Every record carries archived_at, read-only: the date of the archiving, null while the company is active. An archived company stays readable through GET /api/v1/companies/{id}, but refuses its modification and its deletion, as well as the modification and deletion of its establishments and most other writes that concern it (see 403 Forbidden: archived company). The API neither archives nor unarchives a company.
Each record also carries e_reporting_declarant, read-only: it places the company with regard to the workspace's designation of the company that declares the e-reporting (flux 10) periods of the company's SIREN, read from the first 9 characters of legal_identifier when legal_registering_country is FR or blank. A company registered in another country carries a SIREN only if its whole legal_identifier is one, check key included (step 1); otherwise, even when its legal_identifier starts with 9 digits, it belongs to the SIREN of no other company of the workspace (Transmit a declaration). It appears in the list, detail, create, and update responses. Only one company declares a period for the whole SIREN: its declaration carries the operations recorded, for the same period, on every company of the workspace carrying this SIREN, and the others do not transmit theirs. Each e-reporting declaration also returns this field, along with declared_by_company_id, which names the company that declares that declaration's period: a period a company already holds stays with that company, even when another company has been designated since.
designated: the workspace designated this company for its SIREN.another_company_designated: the workspace designated another company carrying the same SIREN.not_designated: several companies of the workspace carry this SIREN and none is designated. A period is then declared by the company already holding it or, failing that, by the only one with data for it; when several have data for a period none holds, its transmission is refused until a company is designated.sole_company: no other company of the workspace carries this SIREN.null: the first 9 characters oflegal_identifierare not a SIREN (9 digits), orlegal_registering_countrynames a country other than France andlegal_identifieris not a SIREN with a valid check key.
A designation counts only while the designated company carries this SIREN. It is chosen in the company's settings on Scribee, Electronic invoicing tab, by a member whose access covers the whole workspace. The API neither sets nor removes it.
Step 3: modify a company
This call modifies the record in your workspace, with no external transmission. It is undone by restoring the previous values through the same endpoint, except legal_identifier once the company is under a mandate or once one of its e-reporting declarations has been transmitted to the PPF (see below). The fields are the same as at creation.
curl -X PATCH https://app.scribee.tech/api/v1/companies/7 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "company": { "commercial_name": "Acme France" } }'
200 response with the updated record, in the same format as step 1. To remove a legal mention, send its field as null: the response returns it as null. An empty string is stored and returned as is; like null, it produces no note.
legal_identifier can no longer change once the company carries an Incomplete, Pending review or Active mandate, including to fill in an identifier left blank: a mandate names the company by its SIREN, and it is under that SIREN that the reception mandate lets it manage its directory entries. The PATCH then answers 422 with the error under details.legal_identifier, and no field of the request is saved (Errors and edge cases). Re-sending the stored value is still accepted, including a SIREN written with spaces. A Rejected, Terminated or Deleted mandate locks nothing, and creating a company is not affected. To change the identifier, first delete the Incomplete or Pending review mandate, or terminate the Active mandate: a scheduled termination leaves the mandate Active until its date, and the identifier stays locked until state reads terminated.
legal_identifier can no longer change either once an e-reporting declaration of the company has been transmitted to the PPF, unless its only answer is a rejection ("301"): it stays attached to the SIREN it was filed under, and the PATCH answers 422 with the error under details.legal_identifier (Errors and edge cases).
Both locks also cover legal_registering_country when changing it moves the company's SIREN; the PATCH then answers 422 with the same error, under details.legal_identifier. The mandate lock reads the SIREN as the directory does: only a company registered in France carries one, so moving from FR (or blank) to another country a company whose legal_identifier carries a SIREN takes that SIREN away from it, and the reverse gives it one. The e-reporting declaration lock reads it as e-reporting does: a company registered in another country carries a SIREN when its legal_identifier is one, check key included (step 1), so that country change does not move the SIREN of a company whose legal_identifier is a SIREN with a valid check key. A country change that moves no SIREN - from one foreign country to another, or between FR and a blank value - is not affected.
A company created (POST) under a SIREN other companies of the workspace already carry takes on their assujetti unique (a setting of the company's screen). A PATCH of legal_identifier or legal_registering_country that makes the company carry such a SIREN is accepted only if the company already belongs to the same assujetti unique as they do: otherwise the call answers 422 with the error under details.legal_identifier (Errors and edge cases), as does a creation under the SIREN of companies that do not all state the same assujetti unique.
A company's subscribed offer
In an accounting-firm workspace, each company subscribes to an offer - start, run, or premium - on which some of its capabilities depend, such as issuing sales invoices (Issue a sales invoice). Each record of a company of that workspace then carries two keys, in the list, detail, creation, and modification responses:
subscribed_offer: the offer in force;pending_offer_change: the booked offer downgrade,nullwhen nothing is booked; otherwise an object whosesubscribed_offernames the upcoming offer andeffective_onthe day it applies.
In any other workspace, both keys are absent from the record, and a POST or a PATCH that sends subscribed_offer answers 422 (Errors and edge cases).
At creation (POST /api/v1/workspaces/{workspace_id}/companies), subscribed_offer chooses the starting offer; without it, the company subscribes to run. At modification (PATCH /api/v1/companies/{id}), the direction of the change decides when it applies:
- a higher offer applies immediately:
subscribed_offercarries it from the response on, and a booked downgrade is cancelled; - a lower offer is booked for the 1st of the following month:
subscribed_offerkeeps the offer in force andpending_offer_changecarries the downgrade; a new downgrade replaces the previous one; - the offer in force cancels the booked downgrade:
pending_offer_changegoes back tonull.
A booked downgrade takes effect on its date: subscribed_offer then takes the booked offer, and pending_offer_change goes back to null. A downgrade sent in November 2026 on a company on run:
curl -X PATCH https://app.scribee.tech/api/v1/companies/7 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "company": { "subscribed_offer": "start" } }'
200 response, abridged:
{
"data": {
"id": 7,
"name": "Acme Corp SAS",
"subscribed_offer": "run",
"pending_offer_change": {
"subscribed_offer": "start",
"effective_on": "2026-12-01"
}
}
}
The history of offer changes
GET /api/v1/workspaces/{workspace_id}/companies/{company_id}/offer_changes lists a company's effective offer changes, newest first (by effective_on, then by recording order); the read scope is enough. The list is paginated (page, per_page - 20 by default, 100 at most) and answers 404 for a company of a workspace that is not an accounting firm. An archived company keeps its history readable.
curl "https://app.scribee.tech/api/v1/workspaces/YOUR_WORKSPACE_ID/companies/7/offer_changes" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
"data": [
{
"id": 42,
"origin": "immediate_upgrade",
"previous_offer": "run",
"new_offer": "premium",
"effective_on": "2026-11-20",
"created_at": "2026-11-20T09:12:00+01:00"
},
{
"id": 17,
"origin": "backfill",
"previous_offer": null,
"new_offer": "run",
"effective_on": "2026-11-09",
"created_at": "2026-11-09T10:30:00+01:00"
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total_pages": 1,
"total_count": 2
}
}
origin says where each row comes from:
initial: the offer the company was created on;previous_offerisnull;backfill: the offer in force on the day Scribee started keeping this history, which goes no further back; or an offer the history had missed, recorded on the day a check finds that the company has no row or that its latest row does not hold the offer in force. Either way,effective_onis that day, not the day the offer started, andprevious_offerisnull;immediate_upgrade: a higher offer, applied immediately;applied_booking: a booked downgrade, applied on its date.
A downgrade still booked does not appear in the history: it is read in pending_offer_change. Cancelling it adds no row.
Step 4: declare establishments
This call creates the establishment record under the company, with no external transmission. It is undone with the DELETE from step 5 as long as no organizational unit is assigned to the establishment and no directory request references it. name is the only required field; legal_identifier carries the SIRET (exactly 14 digits). That SIRET is not unique: several establishments may carry the same one.
curl -X POST https://app.scribee.tech/api/v1/companies/7/establishments \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"establishment": {
"name": "Siège Paris",
"legal_identifier": "44306184100025",
"headquarters": true,
"address_line_1": "123 Rue de Paris",
"postal_code": "75001",
"city": "Paris",
"country": "FR"
}
}'
{
"data": {
"id": 21,
"company_id": 7,
"name": "Siège Paris",
"legal_identifier": "44306184100025",
"headquarters": true,
"address_line_1": "123 Rue de Paris",
"postal_code": "75001",
"city": "Paris",
"country": "FR"
}
}
The head office is the establishment whose headquarters flag is true. Creating a company creates no establishment: declare the head office yourself with this flag. The flag is not exclusive; mark only one establishment as head office per company.
Step 5: list, modify, delete an establishment
GET /api/v1/companies/{company_id}/establishments returns the company's establishments - paginated and sortable (sort_by: name, legal_identifier, headquarters, created_at, or updated_at), with include=company to echo the company on each record. GET /api/v1/establishments/{id} returns a single record.
curl -X PATCH https://app.scribee.tech/api/v1/establishments/21 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "establishment": { "address_line_2": "Bâtiment A" } }'
DELETE /api/v1/establishments/{id} permanently deletes the record - 204 response with no body; the write scope is required. Deletion is refused with a 422 as long as organizational units are assigned to the establishment (organizational units are managed from the Scribee interface). It is refused with the same 422 if a directory change request references the establishment - a registration made through the national directory endpoints is enough to create that reference. Both refusals carry the code dependent_records.
Step 6: delete a company
This call permanently deletes the company record and its attached data, including its establishments and its customer and supplier records. Nothing is transmitted externally. The write scope is required.
curl -X DELETE https://app.scribee.tech/api/v1/companies/7 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
204 response with no body.
A company that has carried at least one invoice cannot be deleted through the API. That is the common case in production: treat DELETE as reserved for records created by mistake and still untouched, not as a general undo mechanism.
Here is the complete list of conditions that make deletion fail. The first is checked before all the others: the last company in the workspace gets operation_failed, even when another condition in the table also applies.
| Condition | Response |
|---|---|
| The company is the last one in the workspace | 422, code = operation_failed, "Impossible de supprimer la dernière entreprise de l'espace de travail" |
| The company carries at least one mandate, whatever its state | 422, code = dependent_records, "Impossible de supprimer une entreprise qui a des mandats" |
| The company has subsidiaries | 422, code = dependent_records, "Impossible de supprimer une entreprise qui a des filiales" |
| The company holds finalized documents that must be retained | 422, code = dependent_records, "Impossible de supprimer une entreprise qui détient des documents finalisés : ils doivent être conservés" |
| The company has direct debit requests or direct debit mandates | 422, code = dependent_records, retained-records message |
| Any other retained document is attached to the company or to data deleted with it, such as an establishment: in particular an invoice, an invoice upload batch, a purchasing document (order, receipt, request, match), a directory change request, a received flow, a bank payment batch or payment instruction | 422, code = dependent_records, retained-records message |
| One of the company's e-reporting declarations has a registered network transmission still owed | 422, code = dependent_records, message carrying the declaration's own reason |
Three notes on that table:
- The mandate blocker is permanent.
DELETE /api/v1/mandates/{id}moves the mandate to thedeletedstate and termination moves it toterminated, but both keep the row. A company that has ever carried a mandate stays blocked, whatever cleanup you perform afterwards (Electronic invoicing mandates). - The retained-records message does not name the blocking document. For the two rows that carry it, the
messageis"Cette entreprise ne peut pas être supprimée : elle contient des données qui doivent être conservées, comme des factures, des flux échangés, des mandats ou des paiements."whatever the document involved, including when it is attached to one of the company's establishments. That text is written to be read by a person, as is the reason carried over in the last row: build your retry logic on thecode, never on the text. - The only way through is to handle the documents first. Delete or reassign the invoices, purchasing documents and directory requests involved from the Scribee interface, then replay the
DELETE. If those documents must be kept, the company is not deletable: leave it in place and contact Scribee.
The deletion can also answer 409, with error = conflict and code = concurrent_modification: another operation registered a network transmission against one of the company's e-reporting declarations, or changed one, while the deletion was being decided. Nothing is deleted. Send the same request again, unchanged.
What happens next
- The company record feeds every invoice issued under its identity (Issue a sales invoice): when you do not send the seller party of a sales invoice, or the buyer party of a purchase invoice, Scribee builds it from the company record and its head office.
- Settings consumed by invoicing are configured per company from the Scribee interface and do not appear in the API record: the numbering pattern for invoices and quotes, and the share capital.
company_legal_form(the legal form) is present for reading in responses but is set from the interface. The legal mentions (late-payment penalties, recovery costs, early-payment discount), on the other hand, are fields of the record, readable and writable (step 1). - Registering companies in the reform's national directory is handled through the directory endpoints, described in The national directory.
Errors and edge cases
422: missing field or invalid format
An establishment legal_identifier that is not a 14-digit SIRET:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"base": ["Legal identifier doit être un SIRET valide (14 chiffres)"]
}
}
The two resources do not fill details the same way. An establishment groups its errors under the base key, each message prefixed with the humanized field name, as above. A company carries one key per faulty field - the field name as it appears in the API - and its messages have no such prefix: a company without name gives "name": ["doit être rempli(e)"]. Fix the field and replay the call.
A French company legal_identifier that is not a 9-digit SIREN - here a SIRET, which belongs on the establishment:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"legal_identifier": ["doit être le SIREN à 9 chiffres d'une entreprise française, et non un SIRET à 14 chiffres : le SIRET identifie l'un de ses établissements et se renseigne sur l'établissement"]
}
}
422: legal identifier locked by a mandate
A PATCH that changes the legal_identifier - or the legal_registering_country, when that change moves its SIREN - of a company covered by an Incomplete, Pending review or Active mandate (step 3):
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"legal_identifier": ["ne peut pas être modifié tant qu'un mandat couvre la société : supprimez ou résiliez d'abord le mandat"]
}
}
Remove legal_identifier from the request to modify the other fields, or first release the identifier as described in step 3.
422: legal identifier locked by an e-reporting declaration
A PATCH that changes the legal_identifier - or the legal_registering_country, when that change moves its SIREN - of a company with an e-reporting declaration transmitted to the PPF (step 3):
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"legal_identifier": ["ne peut pas être modifié une fois qu'une déclaration e-reporting de la société a été transmise au PPF : elle reste rattachée au SIREN sous lequel elle a été déposée"]
}
}
Remove legal_identifier from the request to modify the other fields.
422: SIREN of another assujetti unique
A PATCH that gives the company a SIREN that companies of another assujetti unique already carry in the workspace, or a POST under the SIREN of companies that do not all state the same assujetti unique:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"legal_identifier": ["ne peut pas rejoindre ce SIREN : les autres sociétés de l'espace qui le portent appartiennent à un autre assujetti unique ; une entreprise n'a qu'une appartenance, alignez d'abord le réglage d'assujetti unique"]
}
}
First state the same assujetti unique on the company, or remove legal_identifier from the request.
422: deletion blocked
A refused deletion returns the reason in message, with no details object:
{
"error": "unprocessable_entity",
"code": "dependent_records",
"message": "Impossible de supprimer une entreprise qui a des filiales"
}
"Impossible de supprimer une entreprise qui a des mandats": this blocker is permanent, no API call lifts it (see step 6)."Impossible de supprimer la dernière entreprise de l'espace de travail": every workspace keeps at least one company. This refusal alone carries the codeoperation_failedrather thandependent_records."Impossible de supprimer un établissement auquel des unités organisationnelles sont assignées": remove the assignments from the Scribee interface first."Cette entreprise ne peut pas être supprimée : elle contient des données qui doivent être conservées, comme des factures, des flux échangés, des mandats ou des paiements.": the company, or one of its establishments, holds documents that must be kept. The message does not name the document involved; the cases are listed in step 6.- An establishment referenced by a directory change request produces a message built by Scribee that names the blocking association.
422: unknown offer or workspace without offers
A company POST or PATCH that sends a subscribed_offer outside start, run, and premium:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"subscribed_offer": ["Offre inconnue : gold"]
}
}
In a workspace that is not an accounting firm, any subscribed_offer sent is refused the same way, with the message Une offre ne peut être définie que pour une entreprise d'un espace de travail cabinet comptable under details.subscribed_offer. In both cases, nothing is created or changed: send the call again without subscribed_offer, or with an offer from the list.
422: unresolved reference
Two situations come down to a reference that does not resolve. Both stay inside the usual error envelope:
- A company
POSTorPATCHwhoseparent_idpoints at no existing company:codeisvalidation_failedanddetailscarries theparentkey. Check the identifier with step 2 before sending it. - A
DELETEof a company or establishment still referenced by documents (see step 6):codeisdependent_records. For an establishment, themessagenames the blocking association. For a company, themessagedepends on the refusal: a retained document attached to the company, or to data deleted with it, produces the retained-records message, which does not name the document; an e-reporting declaration with a registered network transmission still owed produces that declaration's own reason; mandates, subsidiaries and finalized pro-forma invoices each have their own message (see the step 6 table).
In both cases, fix the data upstream, or contact Scribee.
404 Not Found
The company or establishment does not exist, or belongs to a workspace outside your application's scope:
{
"error": "not_found",
"message": "La ressource demandée est introuvable"
}
Check the identifier and the workspace attachment (Your first call).
On GET, PATCH and DELETE /api/v1/companies/{id} and /api/v1/establishments/{id}, an IP address missing from the workspace's allowlist produces this same 404, not a 403: the record exists, but your call does not see it. Check your calling IP before concluding the identifier is wrong.
On GET /api/v1/workspaces/{workspace_id}/companies/{company_id}/offer_changes, this same 404 also answers when the company belongs to another workspace than the one in the path, or when that workspace is not an accounting firm. An archived company (archived_at set) is not one of them: its history reads as before.
403 Forbidden
On endpoints prefixed by {workspace_id}, an OAuth client not attached to the workspace receives "L'application n'a pas accès à cet espace de travail", and an IP address missing from the workspace's allowlist receives "Cette adresse IP n'est pas autorisée pour cet espace de travail". A token without the required scope (write to create, modify and delete) receives:
{
"error": "forbidden",
"message": "Vous n'êtes pas autorisé à effectuer cette action"
}
Request a new token with the scopes you need (Authentication).
An archived company (archived_at set) answers with this same response to PATCH and DELETE /api/v1/companies/{id}, as well as to PATCH and DELETE /api/v1/establishments/{id} on its establishments; its other writes, and those that stay open to it, are detailed in 403 Forbidden: archived company.
403 Forbidden: archived company
An archived company (archived_at set) stays readable: its reads answer as before, and the reception of the invoices addressed to it through Peppol or the PPF is not affected. Its writes, however, answer 403 forbidden with the body above, except the answers it still owes on the invoices it holds and its e-reporting declarations.
Still open on an archived company:
PATCH /api/v1/invoices/{id}/transitionwith the eventstake_in_charge(204, the step an approval circuit needs beforeapprove),approve(205),dispute(207),refuse(210) and, on a sales invoice only,collect(212) (The statuses);- the payments of its invoices:
POST /api/v1/invoices/{invoice_id}/payments,PATCHandDELETE /api/v1/invoices/{invoice_id}/payments/{id}(Recording payments); - its e-reporting declarations, transactions and payments alike:
POST /api/v1/e_reportings/{e_reporting_id}/transactions,POST /api/v1/e_reportings/{e_reporting_id}/invoicesandPOST /api/v1/e_reportings/{e_reporting_id}/payments,PATCHandDELETE /api/v1/e_reportings/transactions/{id},PATCHandDELETE /api/v1/e_reportings/invoices/{id},PATCHandDELETE /api/v1/e_reportings/payments/{id}, and the transmission of either declaration throughPOST /api/v1/workspaces/{workspace_id}/e_reportings/{id}/submit(Declaring transactions, Declaring payments).
Answer 403 forbidden on an archived company:
- the company and its establishments:
PATCHandDELETE /api/v1/companies/{id},POST /api/v1/companies/{company_id}/establishments,PATCHandDELETE /api/v1/establishments/{id}; - its subsidiaries:
POST /api/v1/workspaces/{workspace_id}/companieswhoseparent_idnames it - nothing is created under an archived company; - its invoices:
POST /api/v1/workspaces/{workspace_id}/invoicesandPOST /api/v1/workspaces/{workspace_id}/invoices/uploadwhosecompany_idnames it,PATCHandDELETE /api/v1/invoices/{id},POST /api/v1/invoices/{id}/send_by_email, andPATCH /api/v1/invoices/{id}/transitionwith any other event, an unknown event included; - its quotes:
POST /api/v1/workspaces/{workspace_id}/quoteswhosecompany_idnames it,PATCHandDELETE /api/v1/quotes/{id},PATCH /api/v1/quotes/{id}/transition,POST /api/v1/quotes/{id}/convertandPOST /api/v1/quotes/{id}/send_by_email; - its customers and suppliers:
POST /api/v1/workspaces/{workspace_id}/customersandPOST /api/v1/workspaces/{workspace_id}/supplierswhosecompany_idnames it; - supporting documents:
POST /api/v1/invoices/{invoice_id}/supporting_documentson its invoices andPOST /api/v1/parties/{party_id}/supporting_documentson its customers and suppliers; - the invitations to update the record of one of its customers or suppliers:
POST /api/v1/workspaces/{workspace_id}/parties/{party_id}/update_invitationsandDELETE /api/v1/party_update_invitations/{id}. The batchPOST /api/v1/workspaces/{workspace_id}/parties/update_invitations/batchdoes not answer403: it leaves these parties out and counts them inskipped_count; - its mandates:
POST /api/v1/companies/{company_id}/mandates, the writes on an existing mandate (/api/v1/mandates/{id}and its actions) andPOST /api/v1/mandates/{mandate_id}/kyc_documents; - the national directory:
POST /api/v1/companies/{company_id}/france/pid/entries,PATCHandDELETE /api/v1/companies/{company_id}/france/pid/entries/{id}; - banking:
POST /api/v1/workspaces/{workspace_id}/companies/{company_id}/bank_syncs,POST /api/v1/workspaces/{workspace_id}/companies/{company_id}/bank_connectionsandPOST /api/v1/workspaces/{workspace_id}/companies/{company_id}/bank_statements; - its payment batches:
POST /api/v1/workspaces/{workspace_id}/companies/{company_id}/payment_batches,PATCH /api/v1/payment_batches/{id},POST /api/v1/payment_batches/{id}/submit_for_approval,POST /api/v1/payment_batches/{id}/approve,POST /api/v1/payment_batches/{id}/refuse,POST /api/v1/payment_batches/{id}/submit,POST /api/v1/payment_batches/{id}/consent_session,POSTandGET /api/v1/payment_batches/{id}/sepa_export, and thePOSToperations ofsettlement(Payment batches).
A PATCH /api/v1/companies/{id} that attaches an active company to an archived company through its parent_id answers, for its part, 422 validation_failed, with est archivée under details.parent; the company stays unchanged.
Without company_id, POST /api/v1/workspaces/{workspace_id}/invoices and POST /api/v1/workspaces/{workspace_id}/invoices/upload use the first active company of the workspace, never an archived one. Before writing, check the archived_at of the company concerned.
400 Bad Request: unknown status value
On GET /api/v1/workspaces/{workspace_id}/companies, a status other than active, archived or all answers:
{
"error": "bad_request",
"message": "status doit valoir active, archived ou all"
}
400 Bad Request: page beyond the last
On lists, requesting a page beyond the last page of a non-empty collection returns "Le numéro de page dépasse le nombre de pages disponibles". Bound your requests with meta.total_pages.
Related pages
- The national directory - register your companies in the reform's directory and look them up
- Issue a sales invoice - the journey in which the company record becomes the seller party
- API reference: list companies
- API reference: create a company
- API reference: list a company's establishments
- API reference: list a company's offer changes