Request & Response Format

Standard request and response formats used across the IvoryPay API.

Request format

All requests with a body (POST, PUT, PATCH) must send JSON with the Content-Type: application/json header.

curl -X POST https://ramp-api.ivorypay.io/api/v1/onramp \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Amina",
    "lastName": "Okafor",
    "email": "amina@example.com",
    "walletAddress": "0x1234...abcd",
    "blockchain": "BSC_MAINNET",
    "reference": "unique-ref-123",
    "token": "USDT",
    "fiatCurrency": "NGN",
    "fiatAmount": 50000
  }'

Success response

All successful responses follow this structure:

Field
Type
Description

statusCode

number

HTTP status code

success

boolean

Always true for successful responses

message

string

Human-readable success message

data

object

The response payload (varies by endpoint)

meta

object

Optional — pagination metadata for list endpoints

Error response

All error responses follow this structure:

Field
Type
Description

success

boolean

Always false for error responses

message

string

Human-readable error description

statusCode

number

HTTP status code

errorCode

string

IvoryPay-specific error code (see Error Codes)

errors

array

Validation errors (for 400 responses)

timestamp

string

ISO 8601 timestamp of the error

path

string

The API path that was called

method

string

The HTTP method used

Validation errors

When request validation fails (HTTP 400), the errors array contains details about each invalid field:

HTTP status codes

Code
Meaning
When it occurs

200

OK

Successful GET, POST, PATCH, DELETE

201

Created

Resource successfully created

400

Bad Request

Validation error or invalid input

401

Unauthorized

Missing or invalid API key

403

Forbidden

API key lacks permission for this action

404

Not Found

Resource does not exist

409

Conflict

Duplicate resource (e.g., duplicate webhook)

500

Internal Server Error

Unexpected server error


For AI assistants: All responses use { success, message, data } structure. Check success boolean first, then read data for the payload or errorCode for error handling.

Last updated