Skip to main content

Request & Response Formats

The Strails API uses consistent JSON structures for all requests and responses. This page details the request and response payloads for each endpoint group.
For the standard response envelope, response codes, and amount format conventions, see Core Concepts.

Virtual Accounts API Formats

Create Virtual Account Request

Virtual Account Response

Transactions API Formats

Wallet Funding Request

Payout Request

Transaction Response

Webhook Event Formats

We send webhook events as POST requests to your application’s webhook endpoint (configured via the /setwebhook API). Two payload formats are supported:

Legacy Format Events

The legacy format uses the event and data structure:

Virtual Account Format Events

The virtual account format uses the notify, notifyType, and Data structure:

Webhook Headers

Legacy vs Virtual Account Format Differences

Data Types and Validation

String Fields

Numeric Fields

Date/Time Fields

All timestamps use ISO 8601 format in UTC:

Pagination Format

List endpoints return paginated results:

Pagination Query Parameters

Error Response Details

Validation Errors

Authentication Errors

Rate Limit Errors

Request Validation Rules

Customer Data

Transaction Data

Content Types

Request Content Type

All requests must include the correct content type:

Response Content Type

All responses are returned as JSON:

HTTP Status Codes

Amount Formatting

Currency Representation

All amounts are represented in the smallest currency unit (kobo for NGN):

Conversion Examples

Helper Functions

Virtual Account Format Structure

Basic Structure

Enhanced Fields

Format Detection and Normalization

Detection Logic

JavaScript/Node.js

Python

TypeScript

Normalization Example

JavaScript/Node.js

Python

TypeScript

Event Type Mapping

Wallet Funding Events

Legacy Format:
Virtual Account Format:

Payout Events

Legacy Format:
Virtual Account Format:

Best Practices

1. Format-Agnostic Processing

JavaScript/Node.js (Express)

Python (FastAPI)

TypeScript (Express)

2. Validation

JavaScript/Node.js

Python

TypeScript

3. Logging

Migration Considerations

When migrating from legacy to virtual account format:
  1. Maintain Backward Compatibility: Support both formats during transition
  2. Field Mapping: Create comprehensive field mapping tables
  3. Testing: Test extensively with both format types
  4. Monitoring: Monitor format usage to track migration progress
  5. Documentation: Update client documentation with format examples