Skip to main content
The Strails API uses consistent JSON structures across all endpoints. Every request body must be application/json, every response follows the same envelope shape, and webhook events arrive in one of two documented formats. Use this page as your formatting reference when building or debugging your integration.

Standard Request Format

Include the following header on every request:
A typical request body looks like this:

Standard Response Format

Success Response

Every successful response wraps its payload in the same envelope:

Error Response

Do not branch your code on the status string. Across endpoint families you will see "Success", "success", "Error", "error", and "Failed". Treat response_code (below) together with the HTTP status as the source of truth for control flow, and normalise status to lowercase only for display or logging.

Response Code Table

response_code is always one of these two-digit codes. It never carries the HTTP status code ("400", "429", …).

Pagination Format

All list endpoints return a standard pagination object inside data:
Control pagination with the limit and offset query parameters:
FX trade listings are the one exception: GET /fx/trades uses cursor pagination via startAfter (the last tradeId of the previous page) instead of limit/offset.

Amount Formatting

Strails uses three amount representations, and the correct one depends on the individual endpoint - not on whether the operation “feels” fiat or on-chain. Sending the wrong one is the single most common integration mistake, so check this table before you send any amount.
Two pairs of endpoints look symmetrical but are not:
  • /cngnofframp takes Naira (5000 = ₦5,000); /initiateofframp takes the smallest token unit (5000000 = 5.0 cNGN).
  • /withdrawasset takes human-readable token units (100 = 100 cNGN); /fintechtransfer takes the smallest token unit (5000000 = 5.0 cNGN).
Requests are accepted either way - the amount is simply wrong by a factor of a million.

Token decimals

Used whenever you convert to or from the smallest unit:
The value 5000000000 means 5,000 cNGN (6 decimals -> 5000 x 10^6).

Helper Functions

Use these functions to convert between display amounts and the values the API expects.

Webhook Payload Formats

Strails sends webhook events as HTTP POST requests to the URL you configure via /setwebhook. Your endpoint must respond with HTTP 200 to acknowledge receipt. Two payload formats are in use depending on the event source: Detect the format in your handler by checking which top-level key is present:

Legacy Format

The legacy format uses lowercase event and data keys:

Virtual Account Format

The virtual account format uses notify, notifyType, and a PascalCase Data object:
Always validate the webhook signature before processing the payload. Discard any request that fails signature verification.

Data Types & Validation

String Fields

Numeric Fields

DateTime Fields

All timestamps are ISO 8601 strings in UTC:

HTTP Status Codes