API Reference

All endpoints, fields, and error codes.

Base URL: https://api.cloakd.ai/v1 · All requests require X-API-Key header.

GET/v1/status

Check if the API is operational and verify your API key. Authentication is optional.

Response fields

FieldTypeDescription
statusstring"ok", "degraded", or "maintenance"
versionstringCurrent API version
timestampstringServer time (ISO 8601)
authenticatedbooleanWhether the API key is valid
merchant_idstringYour merchant ID (only when authenticated)
POST/v1/payment60 req/min

Create a new payment. Returns a hosted checkout URL to redirect the customer to.

Request body

FieldReq?Description
pay_amountYesAmount in your settlement currency (string)
order_idYesYour order/invoice ID (max 255 chars)
order_descriptionNoDescription shown on checkout (max 1000 chars)
callback_urlNoWebhook URL for this payment (overrides default)
success_urlNoRedirect after successful payment
cancel_urlNoRedirect if customer cancels
expiration_minutesNoExpiration in minutes (5–1440, default 60)
customer_emailNoCustomer email for receipts

Response fields (201)

FieldTypeDescription
idstringUnique payment ID — store this alongside your order
token_idstringPublic checkout token (used in checkout_url)
order_idstringYour order ID (echoed back)
checkout_urlstringHosted payment page — redirect the customer here
statusstringInitial status: WAITING
pay_amountstringAmount the customer needs to pay
pay_currencystringYour settlement coin (USDT, USDC, etc.)
pay_networkstringYour settlement network (ethereum, polygon, etc.)
actually_paidstring|nullActual amount paid (null until completed)
actually_paid_currencystring|nullCoin the customer paid with (null until completed)
created_atstringISO 8601 creation timestamp
expires_atstringISO 8601 expiration timestamp
settled_atstring|nullISO 8601 settlement timestamp (null until settled)
GET/v1/payment/:id120 req/min

Retrieve the current state of a payment. Returns the same fields as POST /v1/payment with updated status values.

GET/v1/payments60 req/min

Paginated list of all payments for your merchant account.

Query parameters

ParamDefaultDescription
page1Page number (1-indexed)
limit20Results per page (1–100)
status-Filter by status (WAITING, SETTLED, etc.)
order_id-Filter by your order ID
from_date-Filter from date (ISO 8601)
to_date-Filter to date (ISO 8601)

Error codes

CodeMeaning
200Request successful
201Payment created
400Validation error — check your request fields
401Invalid or missing API key
403API key lacks required permissions
404Payment not found or does not belong to your account
409Idempotency key conflict — request already processed
429Rate limit exceeded — check X-RateLimit-Reset header
500Internal server error — contact support
503API temporarily unavailable

Error response format

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "pay_amount is required",
  "details": {
    "field": "pay_amount",
    "constraint": "isNotEmpty"
  },
  "timestamp": "2026-01-03T10:30:00.000Z",
  "path": "/v1/payment",
  "request_id": "req_abc123def456"
}

Rate limit headers

Every API response includes:

X-RateLimit-LimitMaximum requests per window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the limit resets