Loans
When a ticket match completes, it becomes a loan — the funded agreement between borrower and lender, with a repayment schedule and (usually) a direct-debit mandate backing it.
Reading loans
GET /v1/loans— the caller's loans, paginated.GET /v1/loans/{loan_id}— a single loan with its current status.GET /v1/loans/{loan_id}/schedule— the installment schedule: due dates, amounts and per-installment status.GET /v1/loans/{loan_id}/disbursement— disbursement details for the loan.
Disbursement
The lender funds the loan with:
curl -X POST https://api.getroja.com/v1/loans/$LOAN_ID/disburse \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json"
The borrower chooses where an installment payout lands with
POST /v1/installments/{installment_id}/select-payout-account, picking one of
their linked bank accounts.
A loan that hasn't progressed can be abandoned with
POST /v1/loans/{loan_id}/cancel.
Repayment
Repayments run through the borrower's direct-debit mandate (see Bank linking):
POST /v1/loans/{loan_id}/repay-installment— debit the next due installment.POST /v1/loans/{loan_id}/repay-all— settle the outstanding balance in one debit.
Both are money-moving calls — send an idempotency key and always retry with the same key.
Direct debits are asynchronous at the bank. A 200 from the repay endpoint
means the debit was initiated — reflect final state from the loan and
schedule endpoints, not from the initiation response alone.
When repayment goes wrong
If a borrower falls behind, the loan enters collections. Both parties can see
the state of that process at GET /v1/loans/{loan_id}/collections-case —
including any cure period, promise-to-pay or restructuring in effect.
Insurance
Tickets can carry Roja-backed insurance (an insurance_provider_id chosen at
ticket creation from GET /v1/insurance/... listings). Insured loans protect
the lender's principal per the policy terms shown in the app.