Integrate Xchange4Me's exchange engine into your platform
Base URL: https://xchange4me.org/api/partner/v1
Send your API key in every request header:
X-API-Key: xch_your_api_key_here
/rates
Get Exchange Rates
Returns all available currencies with current buy/sell rates.
Response:
{
"success": true,
"currencies": [
{
"id": 1,
"name": "Bank Transfer(Naira)",
"symbol": "NGN",
"available_to_send": true,
"available_to_receive": true,
"sell_rate": 0.00076866,
"buy_rate": 0.00070845
}
]
}
/calculate
Calculate Exchange Quote
Get a quote before placing an order.
Request Body:
{
"send_currency_id": 1,
"receive_currency_id": 2,
"sending_amount": 50000
}
Response:
{
"success": true,
"quote": {
"sending_amount": 50000,
"sending_charge": 0,
"receiving_amount": 210.5,
"receiving_charge": 2.1,
"final_amount": 208.4,
"rate": 0.00421,
"expires_at": "2026-04-03T11:00:00Z"
}
}
/orders
Create Exchange Order
Place a new exchange order.
Request Body:
{
"partner_order_id": "YOUR-ORDER-123",
"send_currency_id": 1,
"receive_currency_id": 2,
"sending_amount": 50000,
"wallet_id": "[email protected]",
"user_data": {
"account_name": "John Doe",
"whatsapp": "+2348012345678"
},
"webhook_url": "https://yoursite.com/webhooks/xchange",
"metadata": {"customer_id": "cust_123"}
}
Response:
{
"success": true,
"order": {
"order_id": "YOUR-ORDER-123",
"status": "pending",
"exchange_id": "PARTXXXXXXXX",
"sending_amount": 50000,
"final_amount": 208.4,
"created_at": "2026-04-03T10:00:00Z"
}
}
/orders/{order_id}
Get Order Status
Check the current status of an order.
Response:
{
"success": true,
"order": {
"order_id": "YOUR-ORDER-123",
"status": "approved",
"exchange_id": "PARTXXXXXXXX",
"sending_amount": 50000,
"final_amount": 208.4,
"updated_at": "2026-04-03T10:30:00Z"
}
}
/orders
List Orders
Get all your orders. Filter by status with ?status=approved
Response:
{
"success": true,
"orders": [...],
"pagination": {
"total": 100,
"per_page": 20,
"current_page": 1,
"last_page": 5
}
}
/orders/{order_id}/cancel
Cancel Order
Cancel a pending order.
Response:
{
"success": true,
"message": "Order cancelled successfully."
}
/account
Account Info
Get your API account info and usage statistics.
Response:
{
"success": true,
"account": {
"name": "Your Business",
"status": "active",
"requests_today": 12,
"daily_limit": 100,
"total_orders": 45
}
}
We send a POST request to your webhook URL when an order status changes. Verify authenticity using HMAC signature:
// PHP verification example
$signature = hash_hmac('sha256', json_encode($payload), $webhookSecret);
if ($signature === $request->header('X-Xchange-Signature')) {
// Webhook is authentic
}
Webhook Events:
| Event | When fired |
|---|---|
order.pending |
Order submitted and received |
order.processing |
Admin marks order as processing |
order.approved |
Admin approves and completes order |
order.cancelled |
Order is cancelled |
order.refunded |
Order is refunded |
Webhook Payload Example:
{
"event": "order.approved",
"order_id": "YOUR-ORDER-123",
"status": "approved",
"exchange_id": "PARTXXXXXXXX",
"send_currency": "NGN",
"receive_currency": "RMB",
"sending_amount": 50000,
"final_amount": 208.4,
"wallet_id": "[email protected]",
"timestamp": "2026-04-03T10:30:00Z"
}