Skip to Content
API ReferenceTax connection

Tax connection

Get the tax connection

GET /i/v1/tax-connection

tax_connection.read. The organization’s connection to the tax authority in the token’s mode — its state, the key, what must happen next — or, with none, what stands between it and connecting. API keys may read it to learn whether a live submission will pass (submissionsAllowed). Where identifier lookup is enabled, einvoicingIdentifier, identifierSource and identifierNextAction say which number the tax authority holds for the organization, when asked with ?identifier=true; ?fresh=true asks the authority again past the gateway’s cache (limited per organization).

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
identifierquerystringNoResolve which number the tax authority holds for the organization (a participant lookup). Without it, or fresh, no lookup is made and the identifier fields are null. Ignored where this lookup is not enabled, or while a live connection exists. One of true | false.
freshquerystringNoThe portal’s “Check again”: ask the tax authority which number it holds, past the gateway’s cache. Implies identifier. Ignored where this lookup is not enabled, or while a live connection exists. One of true | false.

Example request

bash
curl https://gp.useyona.com/i/v1/tax-connection \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The connection.

Errors: 400, 401, 403, 429, 500, 503


Connect to the tax authority

POST /i/v1/tax-connection

tax_connection.connect; users only, with a recent step-up. Requests the grant for the organization’s verified tax id (never a tax id from the body) after the consent is accepted. 201 for a new connection; 200 with the existing live one. A replayed Idempotency-Key answers the first result with Idempotent-Replayed: true.

Who can call it: Signed-in user only: do this in the Yona app.

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -.

Request body

FieldTypeRequiredDescription
taxIdstringNoDeprecated. Refused (400 VAL001): the tax number is the organization’s verified TIN; change it in the organization profile.
authorityIdentifiersobject (AuthorityIdentifiers)No
consentobject (Consent)Yes

authorityIdentifiers

FieldTypeRequiredDescription
businessIdstring (uuid)NoThe authority business id the tenant believes is theirs.
serviceIdstringNo

consent

FieldTypeRequiredDescription
acceptedbooleanYesThe tenant accepts Yona as its transmitting tax partner. One of true.
textVersionstringYes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/tax-connection \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "consent": {
      "accepted": true,
      "textVersion": "2026-09-30"
    }
  }'

Responses

The organization already has a live connection in this mode; this is it. A connection waiting for the tax authority is checked again at once.

A new connection was requested. Where the tax authority lists the business under none of its numbers yet and waiting is switched on, the connection is created in awaiting_authority_listing with no grant: Yona asks the authority again every 6 hours and requests the grant once it lists the business (BIZ223 and BIZ224 are then not answered).

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500, 503


Disconnect from the tax authority

DELETE /i/v1/tax-connection

tax_connection.disconnect; users only, with a recent step-up. SOFT by default: the connection closes here, the grant and its crypto key stay at the access point, and connecting again for the same tax id comes back connected with the same key (no new upload). removeAtAuthority: true also revokes the grant at the access point (the key goes with it) — unless the other mode’s connection shares the grant, which is then kept for it (grantKeptFor). Optional body {reason, removeAtAuthority}.

Who can call it: Signed-in user only: do this in the Yona app.

Request body

FieldTypeRequiredDescription
reasonstringNoAt most 500 characters.
removeAtAuthoritybooleanNoAlso remove Yona’s access at the access point, and the crypto key with it. Default false: a soft disconnect — reconnecting later for the same tax id needs no new key. Default: false.

Example request

bash
curl -X DELETE https://gp.useyona.com/i/v1/tax-connection \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "string",
    "removeAtAuthority": false
  }'

Responses

The connection, revoked.

Errors: 400, 401, 403, 404, 413, 415, 429, 500, 503


List the tax connection state of sub-organizations

GET /i/v1/tax-connection/children

tax_connection.read. For a parent organization: the state of each named sub-organization’s connection to the tax authority in the token’s mode, and whether a submission would pass. Name up to 100 sub-organizations in ids (the ids GET /a/v1/organizations/me/children answers, which needs organization.children.read). An id that is not one of the organization’s sub-organizations is left out of the answer. Only the state is shown: the tax id, the key and the history stay the sub-organization’s own. Available to users and API keys.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idsquerystringYesThe sub-organizations: their ids, comma-separated, at most 100, each once.

Example request

bash
curl "https://gp.useyona.com/i/v1/tax-connection/children?ids=0192f1a0-0000-7000-8000-00000000000a%2C0192f1a0-0000-7000-8000-00000000000b" \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

One item for each named sub-organization, in id order.

Errors: 400, 401, 403, 429, 500, 503


Upload the signing key

PUT /i/v1/tax-connection/crypto-key

tax_connection.install_key; users only, with a recent step-up. The key file downloaded from the tax authority’s portal, encrypted in the browser to the key-upload encryption key. It is opened in memory, relayed to the access point and not stored; only its certificate fingerprint is kept.

Who can call it: Signed-in user only: do this in the Yona app.

Request body

FieldTypeRequiredDescription
envelopestringYesJWE compact serialisation (RSA-OAEP-256 key wrap, AES-256-GCM content) of the key file, encrypted in the browser to the key-upload encryption key (GET /i/v1/tax-connection/transport-key). At most 16384 characters.

Example request

bash
curl -X PUT https://gp.useyona.com/i/v1/tax-connection/crypto-key \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "envelope": "string"
  }'

Responses

The connection with the key installed.

Errors: 400, 401, 403, 409, 413, 415, 422, 429, 500, 503


Re-check the tax connection

POST /i/v1/tax-connection/refresh

tax_connection.read; users only. Asks the tax authority gateway about the grant again and answers the connection as it now stands. Limited per organization.

Who can call it: Signed-in user only: do this in the Yona app.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/tax-connection/refresh \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

The connection after the check.

Errors: 400, 401, 403, 404, 429, 500, 503


Get the key-upload encryption key

GET /i/v1/tax-connection/transport-key

tax_connection.read; users only. This mode’s current public key for encrypting a signing key file in the browser before it is uploaded, and the binding the encrypted envelope must carry.

Who can call it: Signed-in user only: do this in the Yona app.

Example request

bash
curl https://gp.useyona.com/i/v1/tax-connection/transport-key \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"

Responses

The public key and binding.

Errors: 400, 401, 403, 429, 500, 503