Browse the docs

Create whitelabel KYC link for cardholder

POST /v1/api-gateway/cardholder/{end_customer_id}/whitelabel-kyc

Issues a link to the Moon-hosted identity-verification page for an existing cardholder (unlike POST /cardholder/kyc, the cardholder is NOT created if it does not exist). Resets the cardholder's KYC status to NOT_STARTED and issues a new link. The link expires 7 days after creation. Cannot be used once the cardholder is APPROVED.

Request

Authentication: your API key in the x-api-key header.

Path parameters

FieldTypeDescription
end_customer_id requiredstringYour end_customer_id for the cardholder, not the Moon cardholder id.

Headers

FieldTypeDescription
Idempotency-KeystringA unique string you choose, up to 255 characters, that makes this request safe to retry. If a request times out or fails in transit, send it again with the same key: the status code and body of the first attempt are returned and the operation is not performed a second time. Stored replies — including failures — are replayed for 24 hours, after which the same key starts a fresh request. Reusing a key for a different request, or sending it while the first request is still running, returns 409. Omit the header and the request behaves exactly as before. Document upload endpoints do not accept it.

Example request

cURL

curl --request POST \
     --url 'https://api.themooncard.com/v1/api-gateway/cardholder/customer_123/whitelabel-kyc' \
     --header 'x-api-key: YOUR_API_KEY'

Responses

201 Success
FieldTypeDescription
url requiredstringHosted identity-verification page to send the cardholder to. Carries a signed, time-limited token.
expires_at requiredstringISO-8601 timestamp after which the link stops working (7 days from creation).
external_id requiredstringEcho of the cardholder identifier the link was created for.
end_customer_id requiredstringDeprecated alias of external_id, emitted alongside it.

JSON

{
  "url": "https://verify.paywithmoon.com/kyc?token=eyJhbGciOiJIUzI1NiJ9.xyz789",
  "expires_at": "2026-08-23T17:51:01.000Z",
  "external_id": "customer_123",
  "end_customer_id": "customer_123"
}
400 Error

Validation failed (errors[] lists each offending field) or a domain rule rejected the request ({ message, code }).

The body is the standard error object: see Errors.

401 Error

Missing or invalid credentials, e.g. { "message": "Invalid API Key", "code": "UNAUTHORIZED" }.

The body is the standard error object: see Errors.

404 Error

Your organization could not be found (ORGANIZATION_NOT_FOUND), or no cardholder has this end_customer_id (CARDHOLDER_NOT_FOUND).

The body is the standard error object: see Errors.

409 Error

The cardholder has already completed KYC (CARDHOLDER_ALREADY_VERIFIED). The Idempotency-Key you sent is already in use. IDEMPOTENCY_KEY_REUSED — the key was used for a different request; send a new key, or repeat the original request exactly to receive its stored response. IDEMPOTENCY_KEY_IN_PROGRESS — the first request with this key has not finished yet; retry in a few seconds.

The body is the standard error object: see Errors.

500 Error

Unexpected server error. Body is { message: "Internal server error", code: "INTERNAL_SERVER_ERROR" }.

The body is the standard error object: see Errors.

Last updated August 16, 2026