Skip to main content

Standardized Structure

All OneClickDz Flexy API v3 endpoints follow a consistent response structure, making it easy to handle responses across your application.

Success Response

When a request is successful, the response follows this structure:

Fields

boolean
required
Always true for successful responses
object
required
Contains the response payload. Structure varies by endpoint.
object
Additional metadata about the response
string
Unique identifier for this request. Use this when contacting support.

Error Response

When a request fails, the response follows this structure:

Fields

boolean
required
Always false for error responses
object
required
Contains error information
string
Unique identifier for this request. Include this when reporting issues.

Response Examples

Account Balance

Mobile Top-Up Send

List Transactions (with Pagination)

Pagination

List endpoints include pagination in the response:

Pagination Fields

integer
Current page number (1-indexed)
integer
Number of items per page
integer
Total number of pages available
integer
Total number of items across all pages

Pagination Query Parameters

Control pagination using these query parameters:
Always check totalPages to know when to stop paginating.

HTTP Status Codes

The API uses conventional HTTP status codes:
Even for non-200 status codes, the response follows the standard error format.

Request ID

Every response includes a unique requestId:

Uses for Request ID

Debugging

Track requests through logs and identify issues

Support

Include in support tickets for faster resolution

Auditing

Correlate requests with transactions

Monitoring

Track request flow across systems
Always log the requestId for every API call you make. It’s invaluable for debugging.

Content Type

All requests and responses use JSON:

Request Headers

Response Headers

Handling Responses

Best Practices

TypeScript Types

If you’re using TypeScript, here are helpful type definitions:

Bill Payment

The Bill Payment API on https://api.oneclickdz.com uses the same envelope described above: success, data, meta and requestId on a success, and success, error and requestId on a failure. Three details are specific to it:
  • Pagination lives in meta. GET /v3/bills/transactions returns data as a plain array, with total, limit and offset in meta alongside timestamp.
  • requestId is always present — in the body of every response, and in the X-Request-Id header of every response. Log it against your own order; it is the only thing support needs.
  • One endpoint returns binary. Download Receipt streams the receipt file itself, so on success there is no JSON envelope and X-Request-Id is the only place the correlation identifier appears. Its failures use the ordinary JSON envelope.

Get Transaction by ID

The transaction object, field by field

Bill Payment Overview

How the whole flow fits together

Next Steps

Error Handling

Learn how to handle errors effectively

Core Endpoints

Explore all available endpoints