SDKs
Yona has an official SDK for five languages. Each one covers everything an API key may call: invoices and submissions, buyers, items, reference data, received invoices, billing and webhooks. Pick your language, install the package and create your first invoice in a few lines.
| Language | Package | Requires |
|---|---|---|
| JavaScript and TypeScript | @useyona/einvoice-js on npm | Node.js 18+ |
| Python | useyona-einvoice on PyPI | Python 3.10+ |
| PHP | useyona/einvoice-php on Packagist | PHP 8.1+ and a PSR-18 HTTP client |
| Go | github.com/elyonar/einvoice-go | Go 1.22+ |
| Java | com.useyona:einvoice-java on Maven Central | Java 17+ |
Install
What every SDK does the same way
- The key is the whole configuration. Create an API key in the Yona app and give it to the client. An
sk_test_key talks to the sandbox and ansk_live_key to the live service, on the same host. Going live means deploying a live key; nothing else changes. See Sandbox vs Production. - The same modules and methods.
client.invoices,client.submissions,client.buyers,client.items,client.webhooksand the rest carry the same method names in every language, cased the way the language expects:issueCreditNotein JavaScript, PHP and Java,issue_credit_notein Python,IssueCreditNotein Go. A recipe written for one SDK reads the same in another. - The API’s own field names. Requests and responses use the fields of the API Reference, so the reference describes exactly what you send and receive, whichever language you use.
- Errors chosen by status. A refused request becomes a typed error for its status (validation, authentication, insufficient credits, permission, not found, conflict, rate limit, server) carrying the API’s
errorCode, therequestIdto quote to support, the per-fielderrorsandretryAfter. Branch on the code, never on the message. - Safe retries.
GET,PUTandDELETE, and writes that carry anIdempotency-Key, are retried on network errors, timeouts, 408, 429 and 5xx with backoff, honouringRetry-After. Where the API accepts anIdempotency-Keythe SDK generates one per call, so a retry is never applied or charged twice. - Webhook verification. One function checks the
Yona-Signatureheader over the raw body, including both signatures during a secret rotation, and returns the event. See Webhooks.
What the SDKs leave to the Yona app
The SDKs cover what an API key may call. Users, roles and invitations, API keys themselves, the organization profile and live access, buying credits and changing plans, and creating or editing webhook endpoints are done in the Yona app. The seller is your organization: it is read-only through the API.
MCP server
@useyona/einvoice-mcp connects the Yona API to tools that speak the Model Context Protocol, such as Claude Desktop, Claude Code, Cursor and VS Code. From there you can add buyers, create and validate invoices, report them to the NRS and follow their status. It runs on your own machine, needs Node.js 20 or later, and uses the same API key as an integration.
Start with a sandbox key. The server refuses an sk_live_ key unless you also set YONA_ALLOW_LIVE=true, so a live key is never used by accident. What each tool may do is decided by the key’s capabilities, as for any integration.
Prefer the REST API?
Every page of the API Reference has a curl example, the Quickstart walks the whole flow that way, and the API’s OpenAPI document is published at /openapi.json for any generator.