QHR Developers

Reject a loan request

PATCH/hr_loans/{id}/reject
Needs a read & write tokenReject loan requests loan/rejectRequires feature loanNot available in Claudehr_loans.reject

Rejects a pending loan request, optionally with a note to the employee. It becomes rejected and can no longer change; the employee may submit a new request.

When to use: to say no to a request.

Prerequisites: the loan id from hr_loans.list (can_reject: true). The token's owner must be an employee: the decision is recorded in their name.

Side effects: the employee is emailed the decision, and a manager who asked for it is told too. Recorded in the audit log. Not offered to Claude, because it decides on an employee's money request.

Not available in Claude yet.

Before you call this

You will need ids that come from these operations:

Parameters

NameInTypeDescriptionExample
idRequiredpathintegerLoan id, from hr_loans.list.418
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Request body

application/json

FieldTypeDescription
loanobjectThe note.
loan.decision_notestringNote shown to the employee.

Response

200 The rejected loan.

FieldTypeDescription
recordobjectEverything HR needs to decide a loan.
record.idintegerLoan id.
record.referencestringLoan reference, e.g. LON-0042.
record.statusstringStatus: pending (waiting for HR), pending_accounting (HR approved, an accountant in Qoyod is deciding), approved (lent, nothing repaid yet), repaying (installments being collected), pending_settlement (a settlement waits for the accountant), settled (paid back), rejected or cancelled.
Allowed values: pending, pending_accounting, approved, repaying, pending_settlement, settled, rejected, cancelled
record.channelstringHow the money moves, chosen by HR at approval: payroll (paid out on a payslip and repaid in monthly installments deducted from pay) or direct (paid out and repaid in one payment outside payroll). Null until approved.
Allowed values: payroll, direct, null
record.installments_countintegerNumber of installments (payroll loans).
record.currencystringThe employee's pay currency, ISO code.
record.amountstringAmount lent. Decimal string.
record.needed_onstring (date)Date the employee needs the money.
record.submitted_atstringWhen it was requested, ISO 8601 UTC.
record.descriptionstringWhy the employee needs it.
record.disbursement_datestring (date)Payout date.
record.installments_start_onstring (date)First installment month.
record.installments_end_onstring (date)Last installment month.
record.repaymentobjectWhere a direct loan's single repayment stands; null for a payroll loan or one not approved.
record.repayment.due_onstring (date)Repayment due date.
record.repayment.repaid_onstring (date)Date it was repaid.
record.repayment.statestringnot_due, due_soon (within 3 days), overdue, paid_early, paid_on_time or paid_late.
record.repayment.daysintegerDays to, past or early/late against the due date, by state.
record.paymentsarray<object>Payments behind a direct loan: the payout (paid) and the repayment (received). Always empty for a payroll loan, whose money moves on the payslip.
record.payments[].idintegerPayment id.
record.payments[].referencestringPayment reference.
record.payments[].kindstringpaid (to the employee) or received (from them).
record.payments[].purposestringdisbursement or repayment.
record.payments[].datestring (date)Payment date.
record.payments[].amountstringAmount. Decimal string.
record.payments[].currencystringThe employee's pay currency, ISO code.
record.decisionobjectHR's decision; null while pending.
record.decision.byintegerEmployee id of who decided.
record.decision.namestringTheir name.
record.decision.atstringWhen, ISO 8601 UTC.
record.decision.notestringNote to the employee.
record.installmentsarray<object>The repayment schedule (payroll loans).
record.installments[].idintegerInstallment id.
record.installments[].sequenceintegerIts number, from 1.
record.installments[].payroll_idintegerThe payroll run collecting it; null until a run claims it.
record.installments[].due_onstring (date)Month it is deducted (first day).
record.installments[].amountstringAmount. Decimal string.
record.installments[].currencystringThe employee's pay currency, ISO code.
record.installments[].statusstringdue or paid.
Allowed values: due, paid
record.accounting_modestringapproval when the company is connected to Qoyod and an accountant approves loans, else legacy (HR's decision is final).
record.accountingobjectWhat Qoyod accounting says about the loan (its settlement while one is in play, else its payout). Every field is null when the company is not connected.
record.accounting.gatestringloan when an accountant must approve this loan, else none.
record.accounting.statestringDelivery state: queued, sending, pending_approval, posted, declined, failed…
record.accounting.event_idstringAccounting event id.
record.accounting.reason_codestringWhy it was declined or held.
record.accounting.reasonstringThe reason in words.
record.accounting.decided_atstringWhen the accountant decided.
record.accounting.decided_bystringThe accountant (email Qoyod sent).
record.accounting.resubmit_allowedbooleanWhether a declined loan may be approved again.
record.accounting.journal_entrystringQoyod journal entry number once posted.
record.existing_commitmentsarray<object>Installments the employee already owes, per month, for the next 2 years.
record.existing_commitments[].monthstringYYYY-MM.
record.existing_commitments[].amountstringTotal due. Decimal string.
record.can_approvebooleanTrue when the token's owner may approve it now.
record.can_rejectbooleanTrue when the token's owner may reject it now.
record.can_settlebooleanTrue when the token's owner may settle it now.
record.employeeobjectThe borrower.
record.employee.idintegerEmployee id.
record.employee.employee_nostringEmployee number.
record.employee.namestringName.
record.employee.emailstringWork email.
record.employee.job_titlestringJob title.
record.employee.departmentstringDepartment.
record.employee.join_datestring (date)Joining date.
record.submitted_byobjectWho asked on the employee's behalf.
record.submitted_by.idintegerEmployee id.
record.submitted_by.full_namestringFull name.
record.salaryobjectThe active salary and monthly gross and net, to judge affordability; null without an active salary.
record.salary.idintegerSalary id.
record.salary.statusstringSalary status.
record.salary.pay_frequencystringPay frequency.
record.salary.currencystringThe employee's pay currency, ISO code.
record.salary.basic_salary_amountstringBasic salary. Decimal string.
record.salary.benefitsarray<object>Allowances.
record.salary.salary_deductionsarray<object>Fixed deductions.
record.salary.monthly_grossstringMonthly gross pay. Decimal string.
record.salary.monthly_netstringMonthly net pay; no month's installments may exceed it. Decimal string.
record.other_loansarray<object>The employee's other loans: reference, status, amounts, schedule and what is outstanding.

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.
403token_read_onlyThis token can only read; the operation makes changes.Use a token created with "Allow changes".
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.
404not_foundThe record does not exist, or you cannot see it.Check the id. List the records first to get a valid one.
422validation_failedThe loan is no longer pending: it was already decided or withdrawn.Read its status with hr_loans.show; nothing more to decide.
422employee_requiredThe token's owner has no employee record, and a decision is stamped with the employee who made it.Use a token created by a person who is an employee here.
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 →