Create cardholder KYC link
POST /v2/api-gateway/cardholders/{id}/kyc-link
Returns { url, status } for the cardholder to complete identity verification. url is null when the cardholder is already in a status that cannot be restarted (APPROVED, IN_, DECLINED); an existing, still-valid link is reused. Returns 200 (not 201).
Request
Authentication: your API key in the x-api-key header.
Path parameters
| Field | Type | Description |
|---|---|---|
id required | string, uuid | The Moon cardholder id (id, a UUID), not your external_. |
Headers
| Field | Type | Description |
|---|---|---|
Idempotency-Key | string | A 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/v2/api-gateway/cardholders/3f5b1c2e-8d4a-4b6f-9e2a-1c7d8e9f0a1b/kyc-link' \
--header 'x-api-key: YOUR_API_KEY'Responses
200 Success
| Field | Type | Description |
|---|---|---|
url required | string, nullable | Hosted verification URL the cardholder opens to complete identity verification. Null when the cardholder is already in a status that cannot be restarted (APPROVED, IN_, DECLINED). |
status required | string | Current KYC status: NOT_, IN_, APPROVED, DECLINED or RETRY. |
JSON
{
"url": "https://verify.paywithmoon.com/kyc?token=eyJhbGciOiJIUzI1NiJ9.xyz789",
"status": "NOT_STARTED"
}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
Cardholder not found or not owned by you.
The body is the standard error object: see Errors.
409 Error
The Idempotency-Key you sent is already in use. IDEMPOTENCY_ — the key was used for a different request; send a new key, or repeat the original request exactly to receive its stored response. IDEMPOTENCY_ — 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_.
The body is the standard error object: see Errors.
Last updated June 5, 2026