Skip to main content

Element Pay API

Element Pay lets you on-ramp (fiat → crypto) and off-ramp (crypto → fiat) with a simple API.

How it works (at a glance)

  • On-ramp (order_type = 0): customer pays via M-Pesa → tokens sent to user_address.
  • Off-ramp (order_type = 1): customer spends tokens → fiat paid to PHONE / TILL / PAYBILL.
  • You get webhooks for status updates (order.submitted, order.settled, order.failed, order.refunded).

Environments & base URLs

Auth header

Tokens & rates (at a glance)

  • Fetch supported tokens/networks from GET /meta/tokens (use the correct environment).
  • Amounts in responses (amount_sent) are human units (e.g., 12.34 USDC).
  • Off-ramp needs ERC-20 allowance first; otherwise you’ll get 400 insufficient_allowance.
  • rate_used is locked at order creation (see the guide below for fees/markups & examples).
Read more: Tokens, Networks, Rates & Approvals

First call (on-ramp)

Success response
Track it
  • Poll: GET /orders/tx/{tx_hash}
  • Prefer: webhooks (set URL + secret on your API key)

Errors (shape)

Common:
  • 401 Missing/invalid API key
  • 400 insufficient_allowance / insufficient_balance
  • 422 Validation errors (data.errors[])

Try in Postman

Run in Postman

Need help?