Error codes

Reference for all error codes returned by ZYKAY APIs.

Exchange API Errors

CodeHTTPDescriptionSolution
MISSING_HEADERS401One or more required headers are missingInclude all headers: X-Partner-ID, X-Partner-Timestamp, X-Partner-Nonce, X-Partner-Signature
INVALID_PARTNER403Partner ID not recognizedCheck your Partner ID
TIMESTAMP_SKEW401Timestamp shifted by more than 5 minutesUse current Unix timestamp in seconds, synchronize server clock
INVALID_SIGNATURE401HMAC signature verification failedCheck the signature calculation. IMPORTANT: The partner secret is base64 and must be decoded before use
REPLAY_DETECTED401The nonce has already been usedUse a unique UUID v4 for each request
INVALID_REQUEST400Invalid request body or missing grant_codeCheck the JSON format and the presence of grant_code
INVALID_GRANT400Invalid grant formatThe grant_code must start with g_
GRANT_INVALID401Grant code nonexistent or expiredGrants expire in 5 minutes and are single use
INTERNAL_ERROR500Server side errorTry again with exponential backoff

Introspection API errors

CodeHTTPDescriptionSolution
INVALID_REQUEST400pass_token missing or invalidCheck that the body contains {"pass_token": "p_..."}
INTERNAL_ERROR500Server side errorTry again with exponential backoff

HMAC signature errors (MISSING_HEADERS, INVALID_SIGNATURE, etc.) are the same as the Exchange API above.

An expired or invalid token returns a status 200 with {"active": false} (not an HTTP error), according to RFC 7662.

Billing Session Errors (ADULT_BLIND)

These errors are returned by POST /api/billing/session only.

CodeHTTPDescriptionFix
FORBIDDEN_RAIL403Organization is not on the ADULT_BLIND railContact tech@zykay.com to enable the rail
MISSING_BLIND_APP_ID400blindAppId not configured for the organizationContact ZYKAY support
MISSING_ORIGIN400origin field missing from bodyInclude "origin": "https://yoursite.com" in the body
INVALID_SCOPES400Scopes not supported for your tierCheck available scopes for your level
INVALID_JSON400Malformed JSON bodyCheck the body format

HMAC errors (MISSING_HEADERS, INVALID_PARTNER, INVALID_SIGNATURE, etc.) are the same as the Exchange API.

Loader v4 errors (frontend)

The v4 loader does not use an error postMessage. Errors go through the onError callback:

CodeDescriptionAction
INIT_FAILEDFailed to create verify-requestCheck data-partner-id, connectivity and CORS
SERVER_VERIFY_TIMEOUTserver-verify mode timeoutCheck your endpoint data-server-verify-endpoint

HTTP Status Codes

StatusMeaning
200Success
400Bad request - Check request body
401Unauthorized - Check credentials/signature
404Not found - Check endpoint URL
429Too many requests - Rate limit reached (see published policy)
500Internal Server Error - Try Again Later

Policy 429 (summary)

  • GET /api/w/verify-status/:requestId?pt=...: 30 req / 60s, returns Retry-After: 60
  • POST /api/partner/verify-request: 60 req / 60s
  • GET /api/partner/verify-status/:requestId: 60 req / 60s
  • POST /api/billing/session (pre-auth IP): 30 req / 60s
  • POST /api/billing/session (post-auth partner): 100 req / 60s

Full reference: Rate-Limit Policy

Error handling (recommended integration)

async function callWithRetry(makeCall) {
  const delaysMs = [1000, 2000, 4000];
 
  for (let i = 0; i < delaysMs.length; i++) {
    const res = await makeCall();
    if (res.status !== 429) return res;
 
    const retryAfter = Number(res.headers.get('Retry-After') || '0');
    const waitMs = retryAfter > 0 ? retryAfter * 1000 : delaysMs[i];
    await new Promise((r) => setTimeout(r, waitMs));
  }
 
  throw new Error('Rate limit exceeded after retries');
}