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
Authorization header determines which Solana network is used.
Request Format
All requests must include:| Header | Value | Required |
|---|---|---|
Authorization | Bearer zfi_test_... or Bearer zfi_live_... | Yes (protected routes) |
Content-Type | application/json | Yes (POST/PUT/PATCH) |
Idempotency-Key | UUID or unique string | Optional (recommended for POST) |
Authentication
Protected endpoints require a valid API key as a Bearer token: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.
idempotencyEnabled is true (the default).
Error Format
All errors follow a consistent structure:HTTP Status Codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Resource created |
400 | Bad request — invalid parameters |
401 | Unauthorized — invalid or missing API key |
404 | Resource not found |
409 | Conflict — resource already exists or idempotency conflict |
422 | Unprocessable entity — validation error |
429 | Rate limit exceeded |
500 | Internal server error |
Common Error Codes
| Code | Description |
|---|---|
authentication_failed | Invalid or expired API key |
validation_failed | Request body failed validation |
missing_required_field | A required field is missing |
invalid_parameter | A parameter has an invalid value |
rate_limit_exceeded | Too many requests |
payment_expired | Payment window has elapsed |
insufficient_balance | Wallet balance too low |
Rate Limits
Requests are rate-limited per merchant account:| Category | Limit | Window |
|---|---|---|
| Payment endpoints | 50 requests | 1 hour |
| Dashboard endpoints | 200 requests | 1 hour |
| All other endpoints | 100 requests | 1 hour |
429 with a JSON body indicating when to retry.
Pagination
List endpoints support pagination via query parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Number of items per page (max 100) |
offset | integer | 0 | Number of items to skip |
Correlation IDs
Every API request is assigned a unique correlation ID, available in the response headers:Mode Header
Every response includes a header indicating which mode processed the request:Supported Currencies and Tokens
| Currency | Description |
|---|---|
USD | US Dollar (default) |
EUR | Euro |
GBP | British Pound |
| Token | Network |
|---|---|
USDC | SPL Token (default) |
USDT | SPL Token |
SOL | Native SOL |