QHR Developers

List loans' delivery to Qoyod accounting

GET/hr_loans/accounting_sync
Read token is enoughView all employees' loans loan/view_othersRequires feature loanAvailable in Claudehr_loans.accounting_sync

Returns every decided loan and whether its accounting events — the payout (loan.disbursed) and, for a direct loan, the repayment (loan.repaid) — reached Qoyod: one roll-up sync_state per loan (problem, syncing, awaiting_accounting, synced) with the per-event detail, and a summary of the counts. A company not connected to Qoyod gets an empty list and connection_status: not_connected.

When to use: for "did all our loans reach the books?" or to find loans to re-send with hr_loans.resync (can_sync: true).

Prerequisites: none. Re-sending needs "Connect, configure and send to the accounting integration".

Side effects: none. Up to 50 per page.

Parameters

NameInTypeDescriptionExample
sync_statequerystringOnly loans in this roll-up state (or an event state such as failed, posted). all by default.
Allowed values: all, problem, syncing, awaiting_accounting, synced
problem
statusquerystringOnly loans in this status.
Allowed values: all, pending_accounting, pending_settlement, approved, repaying, settled
approved
periodquerystringMonth of the latest event, YYYY-MM.2026-11
sortquerystringSort field; event_at (latest event) by default.
Allowed values: event_at, decided_at, amount
event_at
directionquerystringSort direction; desc by default.
Allowed values: asc, desc
desc
pagequeryintegerPage number, starting at 1.
min 1
1
per_pagequeryintegerRecords per page. Each list states its maximum.
min 1
20
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Response

200 The sync list.

FieldTypeDescription
connection_statusstringconnected, needs_reauth, disconnected or not_connected.
sync_enabledbooleanTrue when sending to Qoyod is switched on.
summaryobjectCounts: total, synced, syncing, awaiting_accounting, problem.
recordsRequiredarray<object>One row per loan.
records[].loan_idintegerLoan id.
records[].referencestringLoan reference.
records[].employee_idintegerBorrower.
records[].statusstringLoan status.
records[].channelstringpayroll or direct.
records[].employee_nostringEmployee number.
records[].employee_namestringBorrower's name.
records[].currencystringCurrency.
records[].amountstringAmount, decimal string.
records[].disbursement_datestringPayout date.
records[].decided_atstringWhen HR decided.
records[].sync_statestringproblem, syncing, awaiting_accounting or synced.
records[].can_syncbooleanTrue when hr_loans.resync would send something.
records[].eventsarray<object>Per event: event_type, state, sync_reason, reason, journal_entry, attempts, can_sync…
paginationRequiredobject
pagination.current_pageRequiredintegerThis page's number.
pagination.per_pageRequiredintegerRecords per page.
pagination.total_entriesRequiredintegerRecords across all pages.
pagination.pagesRequiredintegerNumber of pages.

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 →