QHR Developers

Get the Qoyod accounting connection

GET/accounting_connection
Read token is enoughView the accounting integration and what was sent to it accounting/viewRequires feature accountingAvailable in Claudeaccounting_connection.show

Returns 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

NameInTypeDescriptionExample
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Response

200 The connection.

FieldTypeDescription
accounting_connectionobjectThe connection.
accounting_connection.statusstringnot_connected, connected, or needs_reauth (linked, but an admin must sign in to Qoyod again).
Allowed values: not_connected, connected, needs_reauth
accounting_connection.providerstringqoyod, or null when not connected.
accounting_connection.provider_availablebooleanFalse when this QHR environment has no Qoyod integration.
accounting_connection.sync_enabledbooleanTrue when payroll and settlements are sent to Qoyod.
accounting_connection.settingsobjectcost_centre_dimension (department or location), payer and replay_history.
accounting_connection.connected_companyobjectQoyod company: id, name, base_currency.
accounting_connection.connected_byobjectWho connected it: id, name, email.
accounting_connection.connected_atstringWhen, UTC ISO 8601.
accounting_connection.capabilitiesobjectWhat the Qoyod company supports.
accounting_connection.sync_notestringNote left when sync was last switched.
accounting_connection.readinessobjectWhether Qoyod has an account for every cost type the recent finalised runs used.
accounting_connection.readiness.readybooleanTrue when nothing would be held. Null when Qoyod did not answer.
accounting_connection.readiness.runs_checkedarray<string>References of the runs checked, newest first.
accounting_connection.readiness.cost_types_usedintegerCost types checked.
accounting_connection.readiness.unmapped_cost_typesarray<object>Cost types with no account in Qoyod yet.
accounting_connection.readiness.unmapped_cost_types[].codestringCost type code, e.g. allowance_housing.
accounting_connection.readiness.unmapped_cost_types[].namestringCost type name.
accounting_connection.readiness.unmapped_cost_types[].last_used_instringLast run that used it.
accounting_connection.readiness.unmapped_cost_types[].amount_last_runstringAmount in the newest run, decimal string.
accounting_connection.readiness.mapping_versionstringQoyod's mapping version.
accounting_connection.readiness.checked_atstring (date-time)When Qoyod was asked, UTC ISO 8601.
accounting_connection.readiness.linksobjectmapping_page: where to add the missing accounts in Qoyod.
accounting_connection.readiness.errorstringprovider_unreachable when Qoyod did not answer (inside accounting_connection.show only).
accounting_connection.readiness.messagestringWhy Qoyod did not answer.
accounting_connection.linksobjectmapping_page in Qoyod.
accounting_connection.available_providersarray<object>Providers that can be connected, when not connected.
accounting_connection.previousobjectThe last connection, when disconnected: company, when, by whom, receipts kept.

Errors

HTTPCodeMeaningHow to fix
401token_missingNo Authorization: Bearer … header, or it is malformed.Send Authorization: Bearer qhr_… with the full token.
401token_invalidThe 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.
401token_expiredThe token is past its expiry date.Create a new token.
401token_revokedThe 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.
401tenant_inactiveThe company account is suspended.Contact QHR support.
403forbiddenThe token owner's role lacks the permission this operation needs.Ask an admin to grant the permission shown on this operation (x-permission).
403employee_inactiveThe token owner's employee record is not active.HR must reactivate the employee record.
403tenant_access_revokedThe 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.
This endpoint can also return the errors that can happen on any endpoint →402 / 412 / 425 entitlement_blocked · 429 rate_limited · 500 internal_error

See the full error catalogue →