Common Patterns
Response formats, required headers, amounts, dates, phone numbers, pagination, and other conventions used across the Elebne API.
Common Patterns
This page covers conventions and formats that apply to every endpoint in the Elebne Developer API.
Response format
All API responses follow a consistent structure.
Success:
{
"success": true,
"data": {
"referenceNumber": "PI-3XXXXXXXXXXXXXX",
"amount": 50000,
"status": "PAID"
}
}Error:
{
"success": false,
"error": {
"message": "Payment intent not found",
"error": "NOT_FOUND"
}
}The success field is always present. On errors, the error object contains a human-readable message and a machine-readable error code.
Required headers
Every request must include:
| Header | Value | Required on |
|---|---|---|
Authorization | Bearer <api_key> | All requests |
Content-Type | application/json | Requests with a body |
X-Idempotency-Key | Unique string (e.g., UUID) | All write requests (POST, PUT, PATCH, DELETE) |
Idempotency
The X-Idempotency-Key header prevents duplicate operations if a request is retried. If you send the same idempotency key twice, the API returns the original response without executing the operation again.
Use UUIDs
A UUID v4 is the recommended format for idempotency keys. Alternatively, use a combination of your order ID and the operation type (e.g., order-1234-create).
Amounts
All monetary amounts are expressed in centimes (1/100 of MRU).
| Centimes | MRU display |
|---|---|
100 | 1.00 MRU |
50000 | 500.00 MRU |
1000000 | 10,000.00 MRU |
99901 | 999.01 MRU (magic: payment failure) |
To convert: display = centimes / 100. Always send and receive integers — never floating-point values.
Dates
All dates are in ISO 8601 format with UTC timezone:
2026-04-04T10:30:00.000ZWhen filtering by date ranges, use query parameters like ?from=2026-04-01T00:00:00.000Z&to=2026-04-04T23:59:59.999Z.
Phone numbers
Phone numbers use E.164 international format:
| Country | Format | Example |
|---|---|---|
| Mauritania | +222XXXXXXXX | +22242345678 |
| International | +<country_code><number> | +33612345678 |
Always include the country code prefix. The API validates phone number format on all endpoints that accept them.
Pagination
List endpoints support pagination with page and limit query parameters:
GET /dev/intents?page=1&limit=20Response:
{
"success": true,
"data": {
"items": [...],
"page": 1,
"limit": 20,
"total": 156,
"hasMore": true
}
}| Parameter | Default | Max | Description |
|---|---|---|---|
page | 1 | — | Page number (1-indexed) |
limit | 20 | 100 | Items per page |
Use hasMore to determine if more pages exist.
CORS
The API supports Cross-Origin Resource Sharing (CORS) for browser-based integrations. Publishable keys (pk_) can be used safely from frontend code. Secret keys (sk_) should never be exposed in the browser — use them only from your server.
Rate limits
The API enforces rate limits per key:
| Key type | Limit |
|---|---|
| Test keys | 100 requests/minute |
| Live keys | 1000 requests/minute |
When rate-limited, the API returns 429 Too Many Requests with a Retry-After header indicating how many seconds to wait.
Next steps
- Authentication — Key types and scopes
- Going Live — Production readiness checklist
- Environments — Sandbox vs production comparison
Was this page helpful?