### Zoho Payroll — four datacenters, per-edition fields, and loans

#### Where it runs

Payroll is regional: it exists only on the **com (US), in (India), ae (UAE) and sa (KSA)** datacenters; login elsewhere is refused up front. Fields differ by edition — India carries statutory/TDS fields, the GCC editions (UAE, KSA, Qatar, Kuwait, Bahrain, Oman) carry gratuity and Arabic-name fields.

```bash
zone payroll org list                                 # organization_id source
zone ctx payroll organization_id=<id>                 # injected as a query param on every call
```

Responses use the `{code: 0, message, …}` envelope; `code` other than 0 is an error even on HTTP 200.

#### Loans (0.8.3)

```bash
zone payroll loan-type list
zone payroll loan-type create --data '{"loan_name":"Housing"}'
zone payroll loan list --filter-by Status.Open --employee-id <id>
zone payroll loan create --data '{"employee_id":"…","loan_name":"Housing","reason":"…","amount":100000,"installment_amount":10000,"payment_date":"2026-10-01","repayment_start_date":"2026-11-01"}'
zone payroll loan repay <loanId> --data '{"amount":5000,"payment_mode":"banktransfer"}'
```

- **Needs the `ZohoPayroll.loan.*` scope**, added in 0.8.3 — run `zone login payroll` again once to pick it up; until then loan calls answer `OAUTH_SCOPE_MISMATCH`.
- `loan update` is a **full replace**: send `reason`, `amount`, `employee_id`, `payment_date` and `repayment_start_date` every time.
- `loan_name` on a loan is the **loan type's** name.
- A loan already being repaid before the move to Zoho Payroll: send `opening_balance_amount` = what is still owed (principal 100,000 with 10,000 repaid → 90,000).
- `repay` records a repayment made **outside** the payroll deduction schedule; `payment_mode` is `check | cash | banktransfer | direct_deposit | creditcard | others`.
- Edition keys: GCC loan types take `is_cap_rule_enabled` + `cap_rule` (a limit tied to eligible gratuity) and `loan_name_sec_lang`; India takes `perquisite_interest_rate` and `disable_perquisite_calculation`.

These rows come from Zoho's OpenAPI bundle and are not yet exercised against a live Payroll organization.
