Skip to main content

API Overview

The ZendFi API is a REST API that accepts JSON request bodies and returns JSON responses. All endpoints are versioned under /api/v1/.

Base URL

https://api.zendfi.tech/api/v1
Both test and live modes share the same base URL. The API key in your Authorization header determines which Solana network is used.

Request Format

All requests must include:
HeaderValueRequired
AuthorizationBearer zfi_test_... or Bearer zfi_live_...Yes (protected routes)
Content-Typeapplication/jsonYes (POST/PUT/PATCH)
Idempotency-KeyUUID or unique stringOptional (recommended for POST)

Authentication

Protected endpoints require a valid API key as a Bearer token:
curl https://api.zendfi.tech/api/v1/payments \
  -H "Authorization: Bearer zfi_test_your_key"
See Authentication for details on key formats and management.

Idempotency

For write operations (POST, PUT, PATCH), you can include an Idempotency-Key header to ensure the request is processed exactly once. If a request with the same idempotency key is received again, the API returns the original response without re-processing.
curl -X POST https://api.zendfi.tech/api/v1/payments \
  -H "Authorization: Bearer zfi_test_your_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order_12345_payment" \
  -d '{"amount": 50, "currency": "USD"}'
The SDK generates idempotency keys automatically when idempotencyEnabled is true (the default).

Error Format

All errors follow a consistent structure:
{
  "error": "Human-readable error message",
  "code": "machine_readable_error_code",
  "details": {}
}

HTTP Status Codes

CodeMeaning
200Success
201Resource created
400Bad request — invalid parameters
401Unauthorized — invalid or missing API key
404Resource not found
409Conflict — resource already exists or idempotency conflict
422Unprocessable entity — validation error
429Rate limit exceeded
500Internal server error

Common Error Codes

CodeDescription
authentication_failedInvalid or expired API key
validation_failedRequest body failed validation
missing_required_fieldA required field is missing
invalid_parameterA parameter has an invalid value
rate_limit_exceededToo many requests
payment_expiredPayment window has elapsed
insufficient_balanceWallet balance too low

Rate Limits

Requests are rate-limited per merchant account:
CategoryLimitWindow
Payment endpoints50 requests1 hour
Dashboard endpoints200 requests1 hour
All other endpoints100 requests1 hour
Rate limit information is included in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1709312400
When the limit is exceeded, the API returns 429 with a JSON body indicating when to retry.

Pagination

List endpoints support pagination via query parameters:
ParameterTypeDefaultDescription
limitinteger20Number of items per page (max 100)
offsetinteger0Number of items to skip
curl "https://api.zendfi.tech/api/v1/payments?limit=10&offset=20" \
  -H "Authorization: Bearer zfi_test_your_key"

Correlation IDs

Every API request is assigned a unique correlation ID, available in the response headers:
X-Correlation-Id: 550e8400-e29b-41d4-a716-446655440000
Include this ID when contacting support to help trace issues quickly.

Mode Header

Every response includes a header indicating which mode processed the request:
X-ZendFi-Mode: test
This helps verify that your application is hitting the expected network (devnet or mainnet).

Supported Currencies and Tokens

CurrencyDescription
USDUS Dollar (default)
EUREuro
GBPBritish Pound
TokenNetwork
USDCSPL Token (default)
USDTSPL Token
SOLNative SOL