Skip to Content
المطورونعقود الإيجار والصيانة وخطوط البيع

Leases, maintenance and pipelines

هذه الصفحة بالإنجليزية عمدًا: أسماء الحقول والأوامر يجب أن تُقرأ تمامًا كما يعرضها المنتج وواجهة البرمجة.

The other lines of business follow the same pattern as the CRM sync: server keys with the line’s scopes, references for records, external ids for idempotent writes, webhooks with caused_by, and warnings instead of refusals for the company’s own business rules. People are references; their details come from GET /api/v1/contacts/{reference} with read:contacts.

Leases

Scopes read:leases and write:leases.

OperationScopeWhat it does
GET /api/v1/leasesread:leasesLeases: home, renter, term, rent, landlord, deposit, registration, notice, renewal, status
POST /api/v1/leaseswrite:leasesAdd a draft lease with its schedule (by number of payments, or the rows given)
GET /api/v1/leases/{reference}read:leasesOne lease
PATCH /api/v1/leases/{reference}write:leasesA draft’s terms; registration, fee, handler, notes and your id at any time
POST /api/v1/leases/{reference}/activatewrite:leasesDraft to active (refused only over another active lease of the home)
POST /api/v1/leases/{reference}/noticewrite:leasesRecord a notice: when, by whom, what it says
POST /api/v1/leases/{reference}/renewwrite:leasesThe one renewal draft (sent again: the same one)
POST /api/v1/leases/{reference}/endwrite:leasesEnd an active lease, with the deposit’s outcome
GET /api/v1/rent-paymentsread:leasesEvery payment, with the day it counted for the owner and its fee
POST /api/v1/rent-paymentswrite:leasesA replacement for a bounced payment
GET /api/v1/rent-payments/{payment_id}read:leasesOne payment
PATCH /api/v1/rent-payments/{payment_id}write:leasesReceived, bounced, cancelled, or a change to a payment still due

Warnings, not refusals. The company’s lease rules (notice periods, the rent increase cap, deposit percentages) come back as warnings codes on writes: schedule_total_differs, rent_above_cap, deposit_above_default, notice_late, vacate_notice_short. Show them to whoever decides; nothing is refused for them.

Cheques. A lease paid in post-dated cheques has one payment per cheque, with its number and bank. When a cheque clears, PATCH the payment with "status": "received"; when it bounces, "status": "bounced", then POST /api/v1/rent-payments with replaces for the new cheque. A bounced payment never changes again.

Accounting. A received payment carries booked_on (the day it counted for the owner’s statement) and fee_amount (the company’s fee then); a bounce after a receipt carries bounced_on, the day the reversal counted. These never change, so an export by booked_on month always gives the same totals. Subscribe to rent_payment.received, rent_payment.bounced and rent_payment.overdue, and to lease.created, lease.activated, lease.notice_given, lease.ended and lease.updated for the leases themselves.

Maintenance

Scopes read:maintenance and write:maintenance. Photos stay in the company’s own storage; the API gives their counts.

OperationScopeWhat it does
GET /api/v1/jobsread:maintenanceJobs: home, lease, category, priority, who does it, day, estimate, payer, owner’s approval, status
POST /api/v1/jobswrite:maintenanceAdd a job on a home (on its active lease when it has one)
GET /api/v1/jobs/{reference}read:maintenanceOne job
PATCH /api/v1/jobs/{reference}write:maintenanceWhat is wrong, category, priority, payer, estimate, who does it, what was done, your id
POST /api/v1/jobs/{reference}/schedulewrite:maintenanceThe day, the window, who does it; optionally block a holiday home’s calendar
POST /api/v1/jobs/{reference}/completewrite:maintenanceThe work is done
POST /api/v1/jobs/{reference}/cancelwrite:maintenanceThe job will not happen
POST /api/v1/jobs/{reference}/approvalwrite:maintenanceAsk the owner, record their answer, or go ahead without one
GET /api/v1/job-chargesread:maintenanceWhat jobs cost, who pays, the day each counted for the owner
POST /api/v1/job-chargeswrite:maintenanceRecord a charge on a job
GET /api/v1/job-charges/{charge_id}read:maintenanceOne charge
PATCH /api/v1/job-charges/{charge_id}write:maintenanceCancel a charge (a mistake), or mark a renter’s charge paid
GET /api/v1/contractorsread:maintenanceThe firms the company gives work to
POST /api/v1/contractorswrite:maintenanceAdd a contractor
GET /api/v1/contractors/{contractor_id}read:maintenanceOne contractor
PATCH /api/v1/contractors/{contractor_id}write:maintenanceChange a contractor, or stop giving them work
GET /api/v1/inspectionsread:maintenanceMove-in, move-out and routine inspections with their areas
POST /api/v1/inspectionswrite:maintenancePlan an inspection (a lease’s move-in or move-out once)
GET /api/v1/inspections/{reference}read:maintenanceOne inspection

Warnings, not refusals. The owner’s approval never locks a job: approval_needed (the estimate is above the owner’s limit), not_approved (asked or declined, and the work goes on), calendar_taken (a stay covers the day, so the calendar was not blocked).

Helpdesk intake. POST /api/v1/jobs with external set to your ticket’s id: sent again, the same job comes back. Subscribe to job.scheduled, job.done and job.cancelled to update the ticket, and to job.approval_requested and job.approval_answered for the owner’s answer.

Accounting. A charge carries booked_on (the day it counted for the owner’s statement) and booked_owner; a cancellation carries cancelled_on. A charge never changes otherwise: a mistake is cancelled and recorded again. Subscribe to job_charge.booked and job_charge.cancelled.

Pipelines

Scopes read:pipelines and write:pipelines. The company manages its pipelines and stages on its screens; the API reads them and names stages by key.

OperationScopeWhat it does
GET /api/v1/pipelinesread:pipelinesThe pipelines in their order, each with its stages: key, name, kind (open, won, lost), probability
GET /api/v1/dealsread:pipelinesDeals: pipeline, stage, status, person, enquiry, home, handler, value, expected close, outcome
POST /api/v1/dealswrite:pipelinesAdd a deal: from an enquiry’s reference, a person’s reference or their details
GET /api/v1/deals/{reference}read:pipelinesOne deal
PATCH /api/v1/deals/{reference}write:pipelinesTitle, home, owner, handler, department, money, probability, expected close, your id
POST /api/v1/deals/{reference}/movewrite:pipelinesTo another stage by key, in any direction; a won or lost stage closes the deal
GET /api/v1/viewingsread:pipelinesViewings: deal, home, time, who shows it, how it went
POST /api/v1/viewingswrite:pipelinesPlan a viewing on a deal
GET /api/v1/viewings/{reference}read:pipelinesOne viewing
PATCH /api/v1/viewings/{reference}write:pipelinesChange its time, home or who shows it, or record how it went

Warnings, not refusals. A move never refuses for the company’s own rules: no_value, no_lease (a leasing deal won without its lease), no_lost_reason, reopened (a closed deal moved back to an open stage).

CRM sync. POST /api/v1/deals with external set to your deal’s id: sent again, the same deal comes back. Subscribe to deal.stage_changed (with deal.won and deal.lost for outcomes) and ignore the echo of your own writes by caused_by; moves made in the CRM come back with POST .../move and the stage’s key.

Website viewings. POST /api/v1/viewings with external set to your booking’s id. Subscribe to viewing.planned, viewing.updated, viewing.done, viewing.cancelled and viewing.missed; feedback never leaves the company in an event.