⚡ Quickstart

Get up and running with Element Pay in minutes!

1. Get Your API Key

Contact elementpay.info@gmail.com to request an API key for staging or production.

2. Make Your First Onramp Order

POST https://staging.elementpay.net/api/v1/orders/create
x-api-key: YOUR_API_KEY_HERE
Content-Type: application/json

{
  "user_address": "0x40C2f2e0326bD1f647fbeB8732529e08B4DB309f",
  "token": "0x05D032ac25d322df992303dCa074EE7392C117b9",
  "order_type": 0,
  "webhook_url": "https://yourdomain.com/webhook",
  "fiat_payload": {
    "amount_fiat": 10,
    "cashout_type": "PHONE",
    "phone_number": "254712531490"
  }
}
  • User receives an MPESA STK push.
  • On payment, crypto is sent to user_address.
  • Webhook receives order status.

3. Make Your First Offramp Order

  1. 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)
  1. Create the Offramp Order:
POST https://staging.elementpay.net/api/v1/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

GET https://staging.elementpay.net/api/v1/orders/tx/{tx_hash}
x-api-key: YOUR_API_KEY_HERE

5. Next Steps