Estonian customers
How to create an Estonian customer with the Legal Entities API: scheme 9931 with the VAT number for a VAT-registered company, scheme 0191 with the registry code otherwise, and which invoices each one can send.
An Estonian company has a registry code, and a VAT number if it is VAT-registered. Which one you register decides how it is verified and which invoices it can send. In production, a legal entity created through the API carries one identifier.
VAT-registered companies: scheme 9931
Use scheme 9931 with the VAT number (KMKR): EE followed by 9 digits, for example 9931:EE990000013. The EE prefix is required when you register a customer, and the check digit is verified. The number is checked against VIES, which returns the registered name; send the name as it is registered. The legal form (OÜ, AS, MTÜ) may be left out of companyName.
{
"externalId": "customer_5120",
"companyName": "Näidis OÜ",
"country": "EE",
"address": { "line1": "Narva mnt 7", "city": "Tallinn", "zip": "10117" },
"identifier": { "scheme": "9931", "value": "EE990000013" }
}EE990000013 shows the format only: it belongs to no company, so VIES refuses it. Use your customer's real VAT number, or scheme 9915 to test (see Testing in the sandbox).
Such a customer invoices with VAT. An invoice whose lines are all outside the scope of VAT (vatCategory: "O") is refused with 422 and the code outside_scope_sender_has_tax_identifier, before anything is sent.
Companies without a VAT number: scheme 0191
Use scheme 0191 with the registry code (registrikood) from the e-Business Register: 8 digits, no prefix, for example 0191:19900002. The check digit is verified. No registry is queried for it yet, so the customer settles at unsupported_scheme and cannot send until our team has checked the company: contact support with its externalId.
Such a customer invoices outside the scope of VAT. An invoice that charges VAT is refused with 422 and the code sender_tax_identifier_missing (see Sender tax identity mismatch).
Receiving
Many Estonian companies are already reachable on Peppol through another provider. A Peppol address can be held by one provider at a time, so the current provider must release it before we can register it: see Switching provider.
Testing in the sandbox
A 9931 number is verified against VIES in the sandbox too, so an invented one is refused. To test without a real company, create the customer on scheme 9915. It has no VAT number, so its test invoices must be outside the scope of VAT. Storecove's Estonian test receiver is EE:CC:10919191.