Skip to main content
POST

Import Merchants

Bulk-onboard sub-merchants: for each entry, creates a new Khaime account if the email doesn’t exist yet, or links the existing account if it does. Combines what Create Merchant and Link Merchant do individually, per row.
This endpoint always returns 201, even if every single entry fails. There is no top-level error status for partial or total per-entry failure — you must inspect data.summary.failed / data.results.failed to know what actually happened. Don’t treat a 201 as “all merchants imported successfully.”

Request Body

array
required
Non-empty array, maximum 100 entries per request.

Response

temporary_password is returned in plaintext for every newly created account. This is the account’s real login password — treat the response as sensitive, don’t log it in plaintext analytics or client-visible logs, and prompt the merchant to change it on first login.

linked entries: action is "linked" or "reactivated"

An entry lands in results.linked in two different situations, distinguished by action:
  • "linked" — an existing Khaime account with no prior relationship to your marketplace was linked for the first time.
  • "reactivated" — the account had a previously suspended relationship with your marketplace, now reactivated.
An entry with an existing active relationship is not re-linked at all — it goes to results.skipped instead (see below), not results.linked.

skipped entries

An entry lands here only for one reason today: reason: "Already linked and active" — the email already has an active relationship in your marketplace, so nothing changed.

Per-entry failure reasons

Each item in results.failed has a reason string, one of:
  • "business_email is required" — missing or non-string email
  • "commission_rate must be a decimal between 0 and 1"
  • "Cannot link your own account as a sub-merchant" — entry’s email matches your own operator account
  • "business_name is required when creating a new account (no existing Khaime account found)"
  • any other caught exception message (generic, not enumerable)

Error Codes