Client onboarding
Your website's sign-up form creates the customer in CarFleet and files each KYC scan straight onto their card — and your site never holds a document number.
Server to server only
Call these endpoints from your website’s BACKEND, never from the browser: the key would be readable by anyone who opens the page. The browser only ever sees the one-file uploadUrl your backend hands it.
The key
Settings → API & MCP → Create key, access Client onboarding. It may find, create and update customers, add their drivers, signatories and beneficial owners, upload their documents and read where each document stands. It reads no booking, invoice or payment, and no document number or file. It works with this REST API only — the MCP endpoint refuses it.
What never leaves. No endpoint accepts an Emirates ID, passport or licence number — they reach the card only by reading the uploaded scan — and none returns one, nor a file or a file URL. Answers are ids, types, statuses, check codes and dates. Bank details sent on create or update are stored and never returned.
The flow
Find or create the customer
POST /v1/customers. A person is matched by phone, then e-mail, among individuals; a company by trade licence, then TRN, among companies.
Verify before you match
CarFleet cannot tell whether the person typing a phone number owns it. A match is honoured only when you send identityVerified: true — meaning YOU confirmed the person controls that phone or e-mail (an OTP, or the personal link you sent to that number). Without it a match answers 409 identity_unverified and nothing is touched. Never set the flag for details you have not verified, and use a GET /v1/customers/lookup answer only for an identifier you verified.
On a verified match nothing is renamed or overwritten — only the existing customer’s empty fields are filled — and you get 200 with created: false and, in ignored, the fields not applied. Store the id. An empty string in an optional field means “not given”.
PATCH /v1/customers/{id} applies as sent on a customer this API created. On any other customer it only fills EMPTY fields — what the operator’s staff recorded is never changed from a website — and answers what it skipped in ignored. Bank details (where refunds and cheques are paid) are written only on a customer this API created.
curl https://carfleet.ae/api/v1/customers \
-H "Authorization: Bearer $CARFLEET_KEY" \
-H "Idempotency-Key: 7d0c6f1e-signup-42" \
-H "Content-Type: application/json" \
-d '{
"type": "individual",
"fullName": "Sara Ahmed",
"phone": "+971 50 123 4567",
"email": "[email protected]",
"nationality": "AE",
"residencyStatus": "resident",
"identityVerified": true
}'201 { "id": "0b6c…", "created": true }
200 { "id": "0b6c…", "created": false, "matchedOn": "phone", "ignored": ["email"] }
409 { "error": { "code": "conflict", "reason": "identity_unverified", "message": "…" } } (a match, flag not sent)Add the people on the card
POST /v1/customers/{id}/drivers for additional drivers (relationship spouse, family, friend, employee, hired_driver or other). For a company: …/signatories and …/beneficial-owners (ownershipPercent 0–100, two decimals, at most 100% in total). Each answers the new id.
A signatory is the person who signs for the company, or its general manager — generalManager: true (stored as the title General Manager; a title that names another role is a 422 — a “Managing Director” is another role). The primary signatory is the one who signs: send isPrimary: true for that person (it takes over from the previous primary; the first signatory is primary anyway). Add the owners and the signatories BEFORE you register the company’s papers — each paper is checked against the people on the card when it is registered. See What a company sends.
Upload each scan — two calls and a PUT
Ask for an upload URL naming whose document it is (holder: the customer, or a driver / signatory by id), its type and the file. PUT the raw bytes to the URL. Then register the path: CarFleet checks the bytes, files the scan on the holder’s card, reads it and checks it.
curl https://carfleet.ae/api/v1/customers/0b6c…/documents/uploads \
-H "Authorization: Bearer $CARFLEET_KEY" \
-H "Idempotency-Key: 7d0c6f1e-eid-front" \
-H "Content-Type: application/json" \
-d '{
"holder": { "kind": "customer" },
"type": "emirates_id",
"side": "front",
"filename": "eid-front.jpg",
"contentType": "image/jpeg",
"sizeBytes": 482113
}'
→ 201 { "path": "…/customer-documents/0b6c…/5f1e…-eid-front.jpg",
"uploadUrl": "https://…/object/upload/sign/…?token=…",
"expiresAt": "2026-11-22T12:00:00.000Z" }
# the bytes go straight to storage — no CarFleet auth header on this one
curl -X PUT "$UPLOAD_URL" -H "Content-Type: image/jpeg" --data-binary @eid-front.jpgcurl https://carfleet.ae/api/v1/customers/0b6c…/documents \
-H "Authorization: Bearer $CARFLEET_KEY" \
-H "Idempotency-Key: 7d0c6f1e-eid-front-register" \
-H "Content-Type: application/json" \
--max-time 90 \
-d '{
"holder": { "kind": "customer" },
"path": "…/customer-documents/0b6c…/5f1e…-eid-front.jpg",
"type": "emirates_id",
"side": "front"
}'
→ 201 { "documentId": "9a21…", "status": "verified", "verificationSource": "auto", "reasons": [] }Registering reads the scan before it answers — give it a client timeout of 60 s or more. PUT the file with the SAME Content-Type you declared: a file stored as any other type is refused and deleted. Registering the same path again (also two registrations racing) answers 200 with the same document. An upload never registered is deleted about three hours after it was minted; while 60 of one customer’s uploads wait to be registered, new upload URLs are refused (429 pending_uploads).
Tell the client what to fix
GET /v1/customers/{id}/documents/status lists every scan of the customer, its drivers and its signatories, and what is still missing. Or subscribe to the webhooks below and never poll.
{
"customerId": "0b6c…",
"documents": [
{ "documentId": "9a21…", "holder": { "kind": "customer", "id": "0b6c…" },
"type": "emirates_id", "subtype": null, "side": "front",
"status": "verified", "verificationSource": "auto", "reasons": [], "rejectionReason": null,
"expiryDate": "2028-03-14", "createdAt": "2026-11-22T10:02:11.402Z" },
{ "documentId": "c3f0…", "holder": { "kind": "driver", "id": "77e2…" },
"type": "drivers_license", "subtype": null, "side": "full",
"status": "rejected", "verificationSource": "auto", "reasons": ["expired"], "rejectionReason": null,
"expiryDate": "2026-09-30", "createdAt": "2026-11-22T10:04:40.118Z" }
],
"missing": [
{ "holder": { "kind": "customer", "id": "0b6c…" }, "type": "emirates_id", "code": "missing_back" }
]
}missing names what a holder still owes: a card side (missing_front / missing_back) — and, for a company, its general manager (missing_general_manager, on the company itself, type emirates_id, until a signatory with generalManager: true is on the card) and the Emirates ID of the general manager and of each person who signs (missing_document, on that signatory, until one is on file that is not rejected).
"missing": [
{ "holder": { "kind": "customer", "id": "0b6c…" }, "type": "emirates_id", "code": "missing_general_manager" },
{ "holder": { "kind": "signatory", "id": "5e1d…" }, "type": "emirates_id", "code": "missing_document" }
]What a company sends
| When | Document | holder | Checked against |
|---|---|---|---|
| Always | trade_license | the company | its name and licence number |
| Always | moa_aoa | the company | its name and one of the people on the card — its manager counts |
| Always | shareholder_register — a share certificate or the shareholders register: ONE file listing the shareholders (send it even when the MOA lists them) | the company | its name, that it is a paper of who owns the company, and EVERY beneficial owner you added, each by his whole name |
| Always | the general manager’s emirates_id | his signatory | his name |
| VAT-registered | vat_certificate | the company | its name |
| The signatory is not on the trade licence | power_of_attorney (or a board resolution) | the company | its name and someone on the card who is not its general manager — he grants it, so his name on it proves nothing |
| No longer asked | ubo_declaration | — | still accepted, for papers already on file |
The person who signs. Ask whether he is the general manager. Yes — one signatory with generalManager: true and isPrimary: true, and his Emirates ID: it is the general manager’s too. No — the signer with isPrimary: true and his Emirates ID (he signs), and the general manager with generalManager: true and HIS Emirates ID.
# the person who signs IS the general manager — one record
POST /v1/customers/0b6c…/signatories
{ "fullName": "Omar Saleh", "generalManager": true, "isPrimary": true }
# he is NOT — the signer, then the general manager
POST /v1/customers/0b6c…/signatories
{ "fullName": "Ahmed Khan", "title": "Operations Director", "isPrimary": true }
POST /v1/customers/0b6c…/signatories
{ "fullName": "Omar Saleh", "generalManager": true }
# who owns it, before the shareholders register is registered
POST /v1/customers/0b6c…/beneficial-owners
{ "fullName": "Omar Saleh", "ownershipPercent": 60 }A signatory’s passport and visa are not asked for — unless he drives. Drivers keep the full package: passport, visa (not for a UAE national), Emirates ID and UAE driving licence. A signatory who drives sends it on his own signatory record (the contract prints the primary signatory’s licence as the company’s driver — with no primary, the oldest signatory who signs, never a general manager who is not the primary); anyone else who drives is a driver (POST …/drivers).
A shareholders register that names the company and every owner is verified automatically. Each owner must appear by his whole name in one entry of the paper — any order, at most one more word in it (a “bin”) — never pieced together from two other people’s names or read out of the company’s own name; an owner whose name is one word is always compared by a person. One that leaves an owner out (or spells one so differently it cannot be matched) goes to a person with reason shareholder_mismatch — it is never rejected for a name; with no owner on the card yet, with manual_legal_check. So does a paper that does not read as one of who owns the company — a share certificate, a register of shareholders, members or partners, a certificate of incumbency, the memorandum or articles of association: a trade licence or a power of attorney filed as the register goes to a person (manual_legal_check), whoever it names. Adding an owner, or renaming one, after a register was verified automatically sends that register back to a person (needs_review / shareholder_mismatch, with a status webhook): it named the owners as they were.
What a scan may be
| Rule | Detail |
|---|---|
| Files | image/jpeg, image/png, image/webp, image/heic, image/heif, application/pdf; at most 15 MiB. Checked against the file’s own bytes at registration — a file that is not what it claims is deleted. |
| Types | passport, emirates_id, drivers_license, intl_license, visa, residence_permit, proof_of_address, trade_license, vat_certificate (the TRN certificate), moa_aoa, power_of_attorney (or a board resolution), ubo_declaration (no longer asked for — kept for papers on file), shareholder_register (a share certificate or the shareholders register), other. |
| Sides | front, back or full. Only an Emirates ID or a driving licence has a back. An Emirates ID and a UAE driving licence need both sides — two scans, or one full PDF; the status listing names a missing side. A single-sided foreign licence: send it as full. A full Emirates ID (the UAE PASS PDF holds both faces) counts as both sides when the reading sees both faces — the front with the photo and the back with the machine-readable zone. One face alone sent as full waits with reason missing_back (the front alone) or missing_front (the back alone), and the listing asks for that face; once it is uploaded the full scan is decided on its own checks and a status webhook follows. Unsure which faces it shows: reason low_confidence, a person looks (nothing to ask the client). |
| Proof of address | subtype is required: ejari (a current tenancy contract — expiryDate = contract end, today or later), title_deed (no age limit), dewa or utility_bill (any other utility — issuedDate = bill date, no older than 3 calendar months, Dubai time). A failure is 422 with error.code proof_of_address_missing_subtype, …_missing_date, …_too_old, …_expired or …_invalid_date; nothing is filed and the uploaded file is KEPT — correct the fields and register the same path again. |
{
"holder": { "kind": "customer" },
"path": "…",
"type": "proof_of_address",
"subtype": "dewa",
"issuedDate": "2026-10-28"
}
→ 422 { "error": { "code": "proof_of_address_too_old", "reason": "proof_of_address_too_old",
"message": "A utility bill must be no older than 3 months." } }
(the uploaded file is kept — correct the fields and register the same path again)Statuses and what to tell the client
Checks run automatically after the scan is read: is it the declared document, is it legible, has it expired, is it this person’s (or this company’s), does it match what the card already holds. A person looks only at what the checks could not decide.
verificationSource says who decided. auto is the automatic checker — it compares the scan with the card and with what your form itself sent, so an automatic verified means “the checks found nothing wrong”, not “a person accepted it”. staff is a person at the operator. If your process needs a human’s acceptance, wait for verified with staff.
| status | Meaning |
|---|---|
received | Stored; checks still running (legal papers are read in the background). The final status arrives as a webhook. |
verified | Every check passed (auto), or staff accepted it (staff). |
needs_review | A person will decide — nothing for the client to do yet. A document no automatic rule covers (a residence permit, other) goes here at once, with reason manual_check; so does an identity card (passport, Emirates ID, driving licence, IDP) the card check was not sure about, once its other checks pass — only a confident answer counts. The card check reads photos and PDFs alike: an identity PDF is drawn on our servers to a picture of each page (up to four), and only those pictures are read — what the pages visibly show, never text a viewer would not show. So is every other PDF the checks decide from: a visa, a trade licence, a proof of address, a legal paper — and one of those with more than four pages comes here too (manual_check, or manual_legal_check for a legal paper): only its first four pages were read. A scan the check saw no identity card on at all comes here with wrong_document (a person looks; it is not rejected for that alone), and so does a PDF that holds several documents (a passport and a licence, two people's cards) or has more than four pages — send each card on its own. A PDF that needs a password to open comes here at once with encrypted_pdf — send one without a password; a PDF that only restricts printing or editing is read like any other. A PDF that cannot be drawn (damaged, or too heavy to draw in time) is tried again and then comes here with ocr_unavailable. |
rejected | Ask for a new scan. reasons says why; rejectionReason is a person’s own words, meant for the client. |
| Reason code | Say to the client |
|---|---|
expired | The document has expired — upload a valid one. |
too_old | The bill is older than 3 months — upload a recent one. |
unreadable | We could not read the photo — upload a sharper one. |
low_confidence | Parts were hard to read; a person is checking. |
wrong_document | This is not the document asked for. |
name_mismatch | The name does not match; a person is checking. |
data_mismatch | It differs from what we already have; a person is checking. |
missing_front / missing_back | Upload the other side of the card. |
shareholder_mismatch | The shareholders on the paper are not the owners you entered; a person is checking. |
manual_legal_check | A legal document a person reads. |
manual_check | No automatic check applies to this document (or, for an identity card the card check was unsure of, none could confirm it is that card); a person reads it. |
ocr_unavailable | Automatic reading was unavailable — the scan could not be read after several attempts, or the reading service was down for more than two hours; a person is checking. |
encrypted_pdf | The PDF needs a password to open: send it again without one (a copy without a password). |
Retries, errors and limits
Every POST and PATCH needs an Idempotency-Key unique to that request. Retry with the same key after a timeout or a 5xx — a 5xx is never stored, so the retry runs again. A completed answer (2xx, or a 4xx other than 429) is replayed for 24 h to the same key: after fixing a 4xx (say, a 422 because the file had not finished uploading), send the corrected request with a NEW key.
| Status | When |
|---|---|
| 400 | No Idempotency-Key, or a body that is not JSON. |
| 401 / 403 | The key is wrong, revoked or expired / its role does not allow this, or the workspace is read-only (reason: read_only) or frozen. |
| 404 | No such customer — or that driver / signatory is not this customer's. |
| 409 | The key was used for a different request, or the first one is still running — or (reason: identity_unverified) a customer matches but identityVerified was not sent. |
| 422 | The body breaks a rule. error.reason lists the fields, or names the rule: content_type, too_large, empty, content_mismatch (the file was deleted — upload again), missing_upload, upload_expired, proof_of_address_… (the file was kept — fix and register again). |
| 429 | Too many calls for this key this minute — wait Retry-After seconds; reason names the bucket. Or reason: pending_uploads — register the files already uploaded first. A 429 is never stored: retry with the same key. |
| Bucket | Per key, per minute |
|---|---|
lookup | 60 — GET /v1/customers/lookup |
upload | 30 — POST …/documents/uploads |
write | 120 — every other POST / PATCH |
read | 600 — every other GET |
Webhooks
Register an endpoint in Settings → API & MCP (see Webhooks). Customer events carry ids, types, statuses, codes and field NAMES only — never a name, phone, e-mail, number, file or free text. Read a person’s rejection reason through the status endpoint.
customer.created { customerId, customerType, source }
customer.updated { customerId, fields: ["email", "nationality"] }
customer.document_added { customerId, documentId, holder: { kind, id }, documentType,
subtype, side, status, source, previousDocumentId? }
customer.document_status_changed { customerId, documentId, holder: { kind, id }, documentType,
status, previousStatus, verificationSource, reasons }A document moved to another person on the card arrives as a new document_added with a new documentId; previousDocumentId names the old one.
Reference
Every field of every endpoint, runnable, is in the API reference under Customers and Customer documents. Plain text, for an agent: /docs/onboarding.md.