Get the Qoyod accounting connection
GET
/accounting_connectionRead token is enoughView the accounting integration and what was sent to it
accounting/viewRequires feature accountingAvailable in Claudeaccounting_connection.showReturns whether the company is connected to Qoyod accounting, to which Qoyod company, who connected it and when, whether sync is on, the settings (cost-centre dimension, payer), and — when connected — whether Qoyod has an account for every cost the recent payroll runs used. When not connected, the previous connection is described if there was one.
When to use: "are we connected to Qoyod?", "is sync on?", or before reading the other accounting operations.
Prerequisites: none.
Side effects: none. When connected QHR asks Qoyod for the readiness; if Qoyod does not answer the page still loads, with readiness.error: provider_unreachable.
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 The connection.
| Field | Type | Description |
|---|---|---|
accounting_connection | object | The connection. |
accounting_connection.status | string | not_connected, connected, or needs_reauth (linked, but an admin must sign in to Qoyod again).Allowed values: not_connected, connected, needs_reauth |
accounting_connection.provider | string | qoyod, or null when not connected. |
accounting_connection.provider_available | boolean | False when this QHR environment has no Qoyod integration. |
accounting_connection.sync_enabled | boolean | True when payroll and settlements are sent to Qoyod. |
accounting_connection.settings | object | cost_centre_dimension (department or location), payer and replay_history. |
accounting_connection.connected_company | object | Qoyod company: id, name, base_currency. |
accounting_connection.connected_by | object | Who connected it: id, name, email. |
accounting_connection.connected_at | string | When, UTC ISO 8601. |
accounting_connection.capabilities | object | What the Qoyod company supports. |
accounting_connection.sync_note | string | Note left when sync was last switched. |
accounting_connection.readiness | object | Whether Qoyod has an account for every cost type the recent finalised runs used. |
accounting_connection.readiness.ready | boolean | True when nothing would be held. Null when Qoyod did not answer. |
accounting_connection.readiness.runs_checked | array<string> | References of the runs checked, newest first. |
accounting_connection.readiness.cost_types_used | integer | Cost types checked. |
accounting_connection.readiness.unmapped_cost_types | array<object> | Cost types with no account in Qoyod yet. |
accounting_connection.readiness.unmapped_cost_types[].code | string | Cost type code, e.g. allowance_housing. |
accounting_connection.readiness.unmapped_cost_types[].name | string | Cost type name. |
accounting_connection.readiness.unmapped_cost_types[].last_used_in | string | Last run that used it. |
accounting_connection.readiness.unmapped_cost_types[].amount_last_run | string | Amount in the newest run, decimal string. |
accounting_connection.readiness.mapping_version | string | Qoyod's mapping version. |
accounting_connection.readiness.checked_at | string (date-time) | When Qoyod was asked, UTC ISO 8601. |
accounting_connection.readiness.links | object | mapping_page: where to add the missing accounts in Qoyod. |
accounting_connection.readiness.error | string | provider_unreachable when Qoyod did not answer (inside accounting_connection.show only). |
accounting_connection.readiness.message | string | Why Qoyod did not answer. |
accounting_connection.links | object | mapping_page in Qoyod. |
accounting_connection.available_providers | array<object> | Providers that can be connected, when not connected. |
accounting_connection.previous | object | The last connection, when disconnected: company, when, by whom, receipts kept. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 401 | token_missing | No Authorization: Bearer … header, or it is malformed. | Send Authorization: Bearer qhr_… with the full token. |
| 401 | token_invalid | The token is unknown or wrong, or its owner's account is locked. | Check the token was copied in full, or create a new one in QHR › Settings › API & Integrations. |
| 401 | token_expired | The token is past its expiry date. | Create a new token. |
| 401 | token_revoked | The token was revoked by its owner or an admin, or the owner was removed from the company (which revokes all their tokens). | Create a new token, or ask your admin. If the owner was removed, they must be re-invited to the company first. |
| 401 | tenant_inactive | The company account is suspended. | Contact QHR support. |
| 403 | forbidden | The token owner's role lacks the permission this operation needs. | Ask an admin to grant the permission shown on this operation (x-permission). |
| 403 | employee_inactive | The token owner's employee record is not active. | HR must reactivate the employee record. |
| 403 | tenant_access_revoked | The token's owner is no longer an active member of this company. Rare: removing a member normally revokes their tokens, which answers 401 token_revoked instead. | The owner must be re-invited to the company, then create a new token. If the owner is still a member, contact QHR support. |
entitlement_blocked · 429 rate_limited · 500 internal_error