Skip to Content
SDKs

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.

LanguagePackageRequires
JavaScript and TypeScript@useyona/einvoice-js on npmNode.js 18+
Pythonuseyona-einvoice on PyPIPython 3.10+
PHPuseyona/einvoice-php on PackagistPHP 8.1+ and a PSR-18 HTTP client
Gogithub.com/elyonar/einvoice-goGo 1.22+
Javacom.useyona:einvoice-java on Maven CentralJava 17+

Install

bash
npm install @useyona/einvoice-js

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 an sk_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.webhooks and the rest carry the same method names in every language, cased the way the language expects: issueCreditNote in JavaScript, PHP and Java, issue_credit_note in Python, IssueCreditNote in 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, the requestId to quote to support, the per-field errors and retryAfter. Branch on the code, never on the message.
  • Safe retries. GET, PUT and DELETE, and writes that carry an Idempotency-Key, are retried on network errors, timeouts, 408, 429 and 5xx with backoff, honouring Retry-After. Where the API accepts an Idempotency-Key the SDK generates one per call, so a retry is never applied or charged twice.
  • Webhook verification. One function checks the Yona-Signature header 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.

bash
claude mcp add yona \
--env YONA_API_KEY=sk_test_your_key_here \
-- npx -y @useyona/einvoice-mcp

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.