Documentation Index
Fetch the complete documentation index at: https://devs.elementpay.net/llms.txt
Use this file to discover all available pages before exploring further.
Get up and running with Element Pay in minutes!
1. Get Your API Key
Contact elementpay.info@gmail.com / sign up on the ElementPay console to get an API key for staging or production.
Try the API in Postman
2. Make Your First Onramp Order
POST $BASE_URL/orders/create
x-api-key: YOUR_API_KEY_HERE
Content-Type: application/json
{
"user_address": "0x40C2f2e0326bD1f647fbeB8732529e08B4DB309f",
"token": "0x05D032ac25d322df992303dCa074EE7392C117b9",
"order_type": 0,
"fiat_payload": {
"amount_fiat": 10,
"cashout_type": "PHONE",
"phone_number": "+254712531490",
"currency": "KES",
"narrative": "Top up for order #1007",
"client_ref": "INV-1024",
"metadata": {
"device_id": "device_12345",
"batch_id": "batch_2024_01"
}
}
}
- User receives an MPESA STK push.
- On payment, crypto is sent to
user_address.
- Webhook receives order status.
3. Make Your First Offramp Order
- Approve the Token (ERC-20):
const contract = new ethers.Contract(tokenAddress, erc20ABI, signer);
await contract.approve("0xELEMENT_CONTRACT", "6900000"); // e.g. 6.9 USDC (6 decimals)
- Create the Offramp Order:
POST $BASE_URL/orders/create
x-api-key: YOUR_API_KEY_HERE
Content-Type: application/json
{
"user_address": "0xabc123...",
"token": "0x06efdbff2a14a7c8e15944d1f4a48f9f95f663a4",
"order_type": 1,
"fiat_payload": {
"amount_fiat": 1000,
"phone_number": "254712345678",
"cashout_type": "PHONE"
}
}
- Tokens are withdrawn from the wallet and paid out to the MPESA number.
4. Check Order Status
curl "$BASE_URL/orders/tx/0xabc123..." -H "X-API-Key: $API_KEY"
5. Receive webhooks (recommended)
Configure Webhook URL + Secret on your API key. You’ll receive events like order.settled or order.failed.
Next: Verify webhook signatures