Skip to content
Back to News
Changelog

SDK 6.6.0 and CLI 0.16.0 tell you when your country is not served yet

sdkcli

You can create a sandbox account in any country, and a sandbox send from a country getpeppr does not serve yet can succeed. That first invoice going through does not mean your country is served: the network provider applies each sender country's own rules, and a later send can be refused for a reason your request cannot fix.

Since 10 November the API says so, in a field named senderCountryNotice, on GET /v1/identity, on POST /v1/validate/server and on the 201 of an accepted send. These two releases bring that notice to SDK and CLI users. The countries getpeppr serves are on the countries page.

SDK 6.6.0 returns the notice

const identity = await peppol.identity.get();
if (identity.senderCountryNotice) {
  // { code: "sender_country_not_served", country: "SK", message, docs, contact }
  console.warn(identity.senderCountryNotice.message);
}

The same object, typed SenderCountryNotice, comes back from three kinds of call. What "nothing to say" looks like differs on each, as it does in the API:

  • peppol.identity.get(), for your own legal entity: senderCountryNotice is null.
  • peppol.invoices.validateServer(), also for a sub-tenant named in sender: senderCountryNotice is null.
  • The methods that send (invoices.send(), sendBatch(), importFile(), creditNotes.send()), on an accepted send: the key is absent.

Measured on one sandbox account whose test legal entity is in Slovakia, with the published 6.5.2 and then with 6.6.0, on the same calls:

  • identity.get() returned no senderCountryNotice property in 6.5.2. 6.6.0 returns the notice.
  • The result of an accepted invoices.send() had no such property in 6.5.2. 6.6.0 returns the notice, including on a resend under the same Idempotency-Key.
  • validateServer() already returned the object at runtime in 6.5.2, without a type. 6.6.0 declares it on ServerValidationResult.

It is a notice, never a verdict. No method refuses or throws because of it, and sandboxFirstSend, valid and the rest of the send result are unchanged. On a send result, its absence proves nothing: a resend the gateway rebuilds from its record omits it. For the standing answer about your own legal entity, read identity.get().

Against a gateway that predates the field, identity.get() returns null rather than throwing, and validateServer() leaves the property undefined.

No method signature changes. In TypeScript, AccountIdentity gains a required property, so code that builds an AccountIdentity object itself, such as a test double, must add senderCountryNotice: null.

A send the provider refuses for a reason getpeppr cannot identify still throws a PeppolApiError (422). Its message already said that the sender's country is not served in 6.5.2.

CLI 0.16.0 prints it

getpeppr send with a sandbox key reads your identity before sending, as it did before. When the identity carries a notice, 0.16.0 prints it on stderr before the send:

! getpeppr does not serve senders established in this country yet. You can explore the sandbox, but the network provider applies each sender country's own rules and our API may not expose the fields they require, so a send can be refused for a reason you cannot fix. Before you build on it, write to hello@getpeppr.dev so we can tell you where we stand for your country.
  Country      Slovakia (SK)
  Contact      hello@getpeppr.dev
  Docs         https://getpeppr.dev/docs/error-handling/#sender-country-not-served

The invoice is then sent as before, the result is printed on stdout, and the command exits 0. On the same account, 0.15.1 printed the result and nothing else.

  • With a live key, which reads no identity first, the notice of an accepted send is printed under the result. The same goes for an invoice file that names a sender (a sub-tenant, sent with a master key): your identity describes your own legal entity, not the one that sends.
  • getpeppr send --json adds a senderCountryNotice key to the JSON object. The key is absent when there is nothing to say. --quiet does not print the notice.
  • getpeppr whoami prints the notice under your identity, and getpeppr whoami --json carries senderCountryNotice, null when there is nothing to say.

No exit code changes: a notice is not an error. getpeppr validate is unchanged; it runs offline and reads no account.

0.16.0 carries SDK 6.6.0.