ElebneElebneDocs
Getting Started

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:

HeaderValueRequired on
AuthorizationBearer <api_key>All requests
Content-Typeapplication/jsonRequests with a body
X-Idempotency-KeyUnique 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).

CentimesMRU display
1001.00 MRU
50000500.00 MRU
100000010,000.00 MRU
99901999.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.000Z

When 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:

CountryFormatExample
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=20

Response:

{
  "success": true,
  "data": {
    "items": [...],
    "page": 1,
    "limit": 20,
    "total": 156,
    "hasMore": true
  }
}
ParameterDefaultMaxDescription
page1Page number (1-indexed)
limit20100Items 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 typeLimit
Test keys100 requests/minute
Live keys1000 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

Was this page helpful?

On this page