Skip to content

Legal Entities API

Provision, list, authorise, and off-board your customers as Peppol legal entities. The multi-tenant surface for platforms.

Every endpoint here requires a master key with the matching legal_entities:* scope. A standard key receives 403. Customers you don't own return 404, never another platform's data. Looking for your own account's identity instead? That is GET /v1/identity — it works with any API key and needs no platform activation.

Getting a master key. In the sandbox, an organisation admin starts the platform sandbox trial from the console overview, then creates a sandbox master key from the console. Production platform access is set up with our team — email hello@getpeppr.dev to request it. Onboarding your own company needs none of this: that is done in the console, on the Peppol identity page.
POST/v1/legal-entities#

Create a customer as a draft Peppol legal entity. getpeppr validates the identifier format (for example, a Luhn check), then kicks off registry verification asynchronously. Returns 202 on creation, or 200 if the same externalId is replayed with the same normalized Peppol participant (the call is idempotent, including scheme aliases and identifier case).

A participant can belong to only one active customer reference in your account and environment. Reusing it under another externalId returns 409 with code: "identifier_already_in_use" before any provider creation. When the owner is already committed, existingLegalEntity contains its getpeppr id and your externalId; no other account's data is ever exposed. An overlapping request can temporarily return 409 legal_entity_creation_in_progress; retry the same payload.
Suspended billing. While your platform billing is suspended, a production key cannot create a new customer or correct one: the request returns 422 with code: "platform_billing_suspended" and nothing is created. Customers you already have keep receiving documents, and replaying the externalId of an existing customer still returns it. The restriction ends when the suspension does.
Network registration capacity. getpeppr holds a place for every production customer before registering it on the Peppol network. If that capacity is full, a production create returns 503 with code: "provider_capacity_reached" (Getpeppr-Result-Code: provider.capacity_reached, not retryable): nothing was created, and customers you already have keep sending and receiving. Contact support. A correction replaces the customer it corrects, so a full capacity does not refuse it by itself; while an identical correction is still in flight it answers 409 with code: "legal_entity_creation_in_progress" — retry the same request. A correction refused with 503 leaves the existing customer in place. Replaying the externalId of an existing customer returns it without taking a place.
Creating the Legal Entity and attaching its Peppol Identifier are separate outcomes. A sandbox create can return 202 while the identifier later settles as unsupported_scheme, verification_failed, or registration_failed if automatic verification is unavailable, the registry check fails, or the identifier is already registered elsewhere or not attachable on the test network. Poll GET /v1/legal-entities/:id or subscribe to legal_entity.* webhooks before treating the customer as send-ready — and for a Norwegian customer, read vatRegistration too.

Body parameters

NameTypeRequiredDescription
externalIdstringRequiredYour stable reference for this customer (1–64 chars). Echoed on every response and webhook.
companyNamestringRequiredLegal company name (2–64 chars). Compared with the returned name when the relevant verification source provides one.
countrystringRequiredISO 3166-1 alpha-2 country code (e.g. GB).
address.line1stringRequiredStreet address (2–192 chars).
address.citystringRequiredCity (2–64 chars).
address.zipstringRequiredPostal / ZIP code (2–32 chars).
identifier.schemestringOptionalPeppol identifier scheme (1–16 chars, e.g. GB:VAT, 0208). Send identifier or identifiers, never both.
identifier.valuestringOptionalThe identifier value (1–64 chars). Format-checked (e.g. Luhn) before verification.
identifiersarrayOptionalSandbox only for now. One to three { scheme, value } entries, primary first — see French customers below. The order is registered on the network as declared and cannot be changed.
networkRolestringOptionalsend_and_receive (default) or send_only. Fixed at creation. send_only is open to every platform account in the sandbox and enabled per account by getpeppr in production — see Network role below.
customerReferencestringOptionalYour reference for your contract with this customer (1–64 chars, never invoice data). Required for a production send_only entity. Fixed at creation.

Network role

networkRole says what getpeppr does on the Peppol network for the customer. Without it, the customer is send_and_receive: getpeppr sends and receives for it, as for every customer created so far. Every response carries the field, so you can read the role of any customer.

send_only is for a company that already receives its invoices at another access point and keeps doing so. In the sandbox it is open to every platform account. In production it is enabled per account by getpeppr: an account that is not enabled receives 403 legal_entities.send_only_not_enabled. Otherwise the request is checked in this order, before the rest of the body, the first refusal winning, and nothing is created when it is refused:

  • the country offers send-only — Belgium only (422 legal_entities.send_only_not_available_in_country);
  • the identifiers start with the one the company already receives on — in Belgium its enterprise number, scheme 0208 (422 legal_entities.send_only_proof_identifier_missing) — optionally followed by its own VAT number, scheme 9925, which must be BE followed by the same enterprise number (sandbox only for now: a production customer carries one identifier), and nothing else (400 legal_entities.identifier_set_invalid);
  • in production, customerReference is present (422 legal_entities.send_only_customer_reference_missing); in the sandbox, every identifier belongs to the sandbox test range: an enterprise number made of 0000 and six digits with a valid modulo-97 check, such as 0000500044, never a real company's, and that no access point already serves on the Peppol test network — many low numbers of the range are taken by other providers' tests (422 legal_entities.send_only_sandbox_identity_required) — getpeppr's own sandbox proof identities, such as the one below, are the exception;
  • in production, another access point publishes a receiving service for that identifier on the Peppol network (422 legal_entities.receiving_registration_not_found; 503 legal_entities.receiving_registration_unverifiable when the network cannot be read, in either environment — retry the same request).
A send-only customer is created with reception off at getpeppr. In production its email attestation is refused (422 attestation.send_only_not_available), and it does not reach active or send yet. The role cannot be changed: replaying the externalId with another role returns 409 legal_entities.network_role_change_not_available, and with another customerReference 409 legal_entities.customer_reference_immutable.

In the sandbox, a send-only customer on test-range identifiers moves through its lifecycle by itself. Its identity is not looked up in the company registry (the test range is unknown to it): its identifiers read as test identities, and its authorisation is simulated — authorisation.method is sandbox_simulated. getpeppr then checks its receiving on the Peppol test network, with the same rule as in production. A test-range number that no access point serves ends suspended with the reason receiving_registration_not_found and receiving.handledBy none, and legal_entity.suspended is sent, within minutes of the creation (getpeppr runs these checks every 5 minutes).

To try the path of a company that already receives elsewhere, create the customer on getpeppr's sandbox proof identity 0208:0000146389 (optionally followed by 9925:BE0000146389). getpeppr keeps it published in reception on the Peppol test network from a test entity of its own, outside every platform, so it counts as received elsewhere: within minutes the customer becomes active with receiving.handledBy elsewhere and its smpHost, legal_entity.send_ready is sent, and it can send to a test buyer. Every sandbox account may use it at the same time. Documents sent to that identity reach getpeppr's test entity, never your customer: use it to send, not to receive.

Every response carries receiving: getpeppr for a send-and-receive customer; for a send-only customer, what getpeppr last found on the Peppol network — elsewhere (with the SMP host serving its address), none or unknown. Once a send-only customer is authorised, getpeppr re-checks that receiving every 6 hours. When it is confirmed gone, or cannot be confirmed for 72 hours, the customer becomes suspended with its reasons in suspension, and legal_entity.suspended is sent; legal_entity.resumed follows when receiving comes back. Its documents stop at delivered: the buyer's responses go to its other access point (receiving.lifecycleResponses is false).

A send-only customer sends once it is active, with the same sender as any sub-tenant. While it is suspended, a send on its behalf answers 422 invoices.sender_sending_suspended with the reasons in suspension. For its first 30 days after activation it can send at most 50 documents per UTC day; the next one answers 429 invoices.send_only_daily_limit with a Retry-After pointing at the next 00:00 UTC. In the sandbox, the ceiling does not apply to an account whose latest signed Platform agreement promises unlimited test documents. A document that reaches getpeppr for a send-only customer is not delivered and not billed: it arrives as inbound.document.undeliverable with reason send_only_entity.

With @getpeppr/sdk 6.7.0 and later, legalEntities.create() takes networkRole and customerReference, and the returned LegalEntity carries networkRole, customerReference, receiving, suspension and authorisation. They are optional in its type: the SDK copies them only when the response carries them well-formed, so read an absent networkRole as unknown, never as send_and_receive. Earlier versions drop these fields.

send-only.ts
import { Peppol } from "@getpeppr/sdk"; // 6.7.0 or later

const peppol = new Peppol({ apiKey: "sk_sandbox_your_master_key" });

const customer = await peppol.legalEntities.create({
  externalId: "be-customer-7",
  companyName: "Example BV",
  country: "BE",
  address: { line1: "Rue de la Loi 1", city: "Bruxelles", zip: "1000" },
  identifiers: [{ scheme: "0208", value: "0000500044" }], // sandbox test range
  networkRole: "send_only",
  customerReference: "CTR-2026-0412", // required with a production key
});

const current = await peppol.legalEntities.get(customer.id);
console.log(current.networkRole, current.receiving?.handledBy);
// "send_only", "unknown" until getpeppr has checked its receiving
if (current.status === "suspended") console.log(current.suspension?.reasons);
import { Peppol } from "@getpeppr/sdk";

const peppol = new Peppol({ apiKey: "sk_live_your_master_key" });

const customer = await peppol.legalEntities.create({
  externalId: "customer_be_001",
  companyName: "Your Customer SRL",
  country: "BE",
  address: { line1: "Customer street and number", city: "Brussels", zip: "1000" },
  identifier: { scheme: "0208", value: "YOUR_10_DIGIT_KBO" },
});

console.log(customer.id, customer.status, customer.networkDiscovery.state);
// "7c9a1b34-…", "pending", "pending"
Response
// 202 Accepted — verification runs asynchronously
{
  "id": "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
  "externalId": "customer_be_001",
  "companyName": "Your Customer SRL",
  "country": "BE",
  "networkRole": "send_and_receive",
  "customerReference": null,
  "receiving": { "handledBy": "getpeppr", "smpHost": null, "lastVerifiedAt": null, "lifecycleResponses": true },
  "identifier": { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO" },
  "status": "pending",
  "networkDiscovery": { "state": "pending", "attempts": 0 },
  "environment": "production",
  "createdAt": "2026-06-01T10:00:00.000Z",
  "identifiers": [
    { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO", "status": "pending", "networkDiscovery": { "state": "pending", "attempts": 0 } }
  ]
}
GET/v1/legal-entities#

List the customers you manage, newest first. Results are isolated to your platform account. When offset exceeds the total, data is empty and has_more is false.

Your identifier, not ours. Two ids name every customer: the externalId you chose, and the getpeppr id we returned when you created them. Your own code almost certainly holds the first one, so this endpoint accepts it: GET /v1/legal-entities?externalId=your-ref returns that customer, and data[0].id is our id for them. You do not need to have stored it, and you never need to page through your whole portfolio to find one.

The other read, GET /v1/legal-entities/:id, takes our id only — passing one of your own references there returns 404. Sending works the same way: sender.legalEntityId takes our id, and your own reference goes in sender.externalSubTenantId. A reference in the wrong field answers 404 with a message that names both. The match on externalId is exact: no prefix search, no case folding, no trimming. A reference you never used, or one belonging to a customer you have archived, gives an empty data with total_count: 0 — that is an answer, not an error, and it says nothing about whether another platform uses the same string. A reference that is empty, longer than 64 characters, or supplied twice is a 400: a malformed reference is refused rather than answered with an empty list, which would read as “no such customer”.

Query parameters

NameTypeRequiredDescription
externalIdstringOptionalReturn only the customer you registered under this reference of yours (1–64 chars). Matched exactly — no prefix search, no case folding, no trimming. Unknown or archived yields an empty data array; empty, over 64 chars, or repeated is a 400.
limitnumberOptionalMax results (default 50, max 100).
offsetnumberOptionalPagination offset (default 0, max 100000).
import { Peppol } from "@getpeppr/sdk";

const peppol = new Peppol({ apiKey: "sk_live_your_master_key" });

// One page
const page = await peppol.legalEntities.list({ limit: 20, offset: 0 });
console.log(page.data, page.meta.hasMore);

// Find ONE customer by your own reference — no need to have stored our id
const { data } = await peppol.legalEntities.list({
  externalId: "customer_be_001",
});
const customer = data[0]; // undefined if you have no live customer under it
console.log(customer?.id);

// …or iterate every customer — pagination handled for you
for await (const c of peppol.legalEntities.listAll()) {
  console.log(c.externalId, c.status, c.networkDiscovery.state);
}
Response — unfiltered page
{
  "data": [
    {
      "id": "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
      "externalId": "customer_be_001",
      "companyName": "Your Customer SRL",
      "country": "BE",
      "networkRole": "send_and_receive",
      "customerReference": null,
      "receiving": { "handledBy": "getpeppr", "smpHost": null, "lastVerifiedAt": null, "lifecycleResponses": true },
      "identifier": { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO" },
      "status": "active",
      "networkDiscovery": {
        "state": "verified",
        "attempts": 0,
        "checkedAt": "2026-06-01T10:02:00.000Z",
        "nextAttemptAt": "2026-06-02T10:02:00.000Z"
      },
      "environment": "production",
      "createdAt": "2026-06-01T10:00:00.000Z",
      "identifiers": [
        { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO", "status": "active", "networkDiscovery": { "state": "verified", "attempts": 0, "checkedAt": "2026-06-01T10:02:00.000Z", "nextAttemptAt": "2026-06-02T10:02:00.000Z" } }
      ]
    }
  ],
  "pagination": { "total_count": 42, "offset": 0, "limit": 20, "has_more": true }
}
Response — lookup by externalId
{
  "data": [
    {
      "id": "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
      "externalId": "customer_be_001",
      "companyName": "Your Customer SRL",
      "country": "BE",
      "networkRole": "send_and_receive",
      "customerReference": null,
      "receiving": { "handledBy": "getpeppr", "smpHost": null, "lastVerifiedAt": null, "lifecycleResponses": true },
      "identifier": { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO" },
      "status": "active",
      "networkDiscovery": {
        "state": "verified",
        "attempts": 0,
        "checkedAt": "2026-06-01T10:02:00.000Z",
        "nextAttemptAt": "2026-06-02T10:02:00.000Z"
      },
      "environment": "production",
      "createdAt": "2026-06-01T10:00:00.000Z",
      "identifiers": [
        { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO", "status": "active", "networkDiscovery": { "state": "verified", "attempts": 0, "checkedAt": "2026-06-01T10:02:00.000Z", "nextAttemptAt": "2026-06-02T10:02:00.000Z" } }
      ]
    }
  ],
  "pagination": { "total_count": 1, "offset": 0, "limit": 50, "has_more": false }
}
GET/v1/legal-entities/:id#

Retrieve a single customer by their getpeppr id. On production this surfaces the full attestation lifecycle status (see the status reference); in sandbox it returns the verification status. When status is registration_failed, or provisioning_failed with a recorded cause, registrationDetail.reason is one of already_registered, invalid_format, or provider_error. When status is awaiting_release (production: another Peppol access point still holds the address), registrationDetail also carries heldBy — that access point's SMP host, when known — and waitingUntil, the end of getpeppr's 30-day wait. The same additive field appears in LIST results and is absent for every other status. Unknown, unowned and archived ids all return 404 with legal_entities.not_found — deliberately indistinguishable, so no caller can probe another platform's entities. An id that is not in the getpeppr id format also returns 404, but with a different result code, request.resource_id_malformed: pass the id exactly as we returned it, not your own customer reference. Its body keeps error: "Malformed resource id" and adds a message pointing your reference to GET /v1/legal-entities?externalId=, which returns our id. A well-formed id we never issued is not in that branch — it answers legal_entities.not_found like any other id we hold nothing for.

import { Peppol } from "@getpeppr/sdk";

const peppol = new Peppol({ apiKey: "sk_live_your_master_key" });

const customer = await peppol.legalEntities.get(
  "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
);
console.log(customer.status, customer.networkDiscovery.state);
// "active", "verified" once cross-AP receive readiness is proven
Response
{
  "id": "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
  "externalId": "customer_be_001",
  "companyName": "Your Customer SRL",
  "country": "BE",
  "networkRole": "send_and_receive",
  "customerReference": null,
  "receiving": { "handledBy": "getpeppr", "smpHost": null, "lastVerifiedAt": null, "lifecycleResponses": true },
  "identifier": { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO" },
  "status": "active",
  "networkDiscovery": {
    "state": "verified",
    "attempts": 0,
    "checkedAt": "2026-06-01T10:02:00.000Z",
    "nextAttemptAt": "2026-06-02T10:02:00.000Z"
  },
  "environment": "production",
  "createdAt": "2026-06-01T10:00:00.000Z",
  "identifiers": [
    { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO", "status": "active", "networkDiscovery": { "state": "verified", "attempts": 0, "checkedAt": "2026-06-01T10:02:00.000Z", "nextAttemptAt": "2026-06-02T10:02:00.000Z" } }
  ]
}
Registration failure
{
  "id": "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
  "externalId": "customer_be_001",
  "companyName": "Your Customer SRL",
  "country": "BE",
  "networkRole": "send_and_receive",
  "customerReference": null,
  "receiving": { "handledBy": "getpeppr", "smpHost": null, "lastVerifiedAt": null, "lifecycleResponses": true },
  "identifier": { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO" },
  "status": "registration_failed",
  "registrationDetail": { "reason": "already_registered" },
  "networkDiscovery": { "state": "pending", "attempts": 0 },
  "environment": "sandbox",
  "createdAt": "2026-06-01T10:00:00.000Z",
  "identifiers": [
    { "scheme": "0208", "value": "YOUR_10_DIGIT_KBO", "status": "registration_failed", "registrationDetail": { "reason": "already_registered" }, "networkDiscovery": { "state": "pending", "attempts": 0 } }
  ]
}
DELETE/v1/legal-entities/:id#

Off-board a customer. The legal entity is archived: the customer drops out of active lists and can no longer send, while audit records, attestations, and history are retained for compliance. Returns 200 with the archived entity. You can also archive a customer from the console (Legal Entities → the row's Archive action), which applies the same retention rules — production archives require typing the customer reference to confirm.

import { Peppol } from "@getpeppr/sdk";

const peppol = new Peppol({ apiKey: "sk_live_your_master_key" });

const result = await peppol.legalEntities.archive(
  "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
);
console.log(result.status); // "archived"
Response
{
  "id": "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
  "externalId": "customer_be_001",
  "status": "archived"
}
POST/v1/legal-entities/:id/attestation#

Request (or resend) the customer's authorisation. getpeppr emails a co-branded, getpeppr-signed attestation link to the contact; once they confirm, the customer advances toward active. Production only — calling this with a sandbox key returns 400.

Body parameters

NameTypeRequiredDescription
contactEmailstringRequiredEmail of the person who will authorise invoicing for this customer (max 254 chars).
contactNamestringOptionalDisplay name shown in the authorisation email (max 128 chars).
languagestringOptionalLanguage of the email, the confirmation page and the wording confirmed, as a BCP 47 tag (e.g. en). Omit it for English. Matched without regard to case, never approximated: nl or en-GB is refused, not mapped to a neighbour.
Returns 409 if the customer isn't verified yet or has already attested — except after a failed registration (provisioning_failed): the same call then answers 202 with attestation.registration_rearmed and status: "provisioning" (no expiresAt, since no link is sent) and retries the registration for up to 30 days (a definitive refusal by the provider ends it earlier), with no new email and no new confirmation. The body is validated as for a first request, so still send contactEmail. A re-arm acknowledges the failure: if its legal_entity.registration_failed event had not been queued for delivery yet, it is not sent. An event already queued may still arrive after the 202; compare its occurredAt with the time of your re-arm. It returns 422 with code: "platform_billing_suspended" while your platform billing is suspended (no link is created and no email is sent), and 502 if the email couldn't be sent (retry to mint a fresh link). Issuing an attestation emits a legal_entity.awaiting_authz webhook.
Customer switching from another Peppol provider? You can request the authorisation before the previous provider removes the address. If it still holds the address when your customer confirms, the status becomes awaiting_release and getpeppr sends legal_entity.awaiting_release (an endpoint that lists event names explicitly must add it; one subscribed to * receives it). getpeppr then checks the network every minute and registers the address as soon as it is free. France (0225) is not covered by this automatic wait.
The email and the confirmation page use the branding you set in the console under Branding: display name, logo and support email (see Platform branding). Until you save it, they show your company's legal name, with no logo and no support contact. Replies to the email go to your support email (Reply-To). The branding is fixed when the request is issued: a pending request keeps the branding it was sent with, and a resend applies your current branding and invalidates the previous link.
Language. The response says which language the request went out in (language) and whether you chose it (languageSource: explicit) or it defaulted to English (default). A translation is used on production only once a native reader has approved its wording; the table below says which languages production uses today. A language that is not available returns 400 with the code attestation.language_unsupported and a supportedLanguages list — the request is never sent in another language instead. The confirmation page lets your customer switch to another available language for the same wording, and records the language they confirmed in. A resend may use a different language.

Supported languages

Languages an authorisation request can be sent in
LanguagelanguageProduction
English (default)enAvailable
Dutch (Belgium)nl-BEAvailable
French (Belgium)fr-BEAvailable

Need another language? We assess and add languages on request: write to hello@getpeppr.dev. A new language goes through the same native review before production uses it.

import { Peppol } from "@getpeppr/sdk";

const peppol = new Peppol({ apiKey: "sk_live_your_master_key" });

const attestation = await peppol.legalEntities.requestAttestation(
  "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
  {
    contactEmail: "owner@customer.example",
    contactName: "Customer Owner",
    language: "en",
  },
);
console.log(attestation.status, attestation.language); // "awaiting_authz", "en"
Response
// 202 Accepted — co-branded email sent to the customer
{
  "id": "7c9a1b34-2d5e-4f60-8a1b-9c2d3e4f5a6b",
  "externalId": "customer_be_001",
  "status": "awaiting_authz",
  "expiresAt": "2026-06-08T10:00:00.000Z",
  "language": "en",
  "languageSource": "explicit"
}