Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.crypto.westminister.tech/llms.txt

Use this file to discover all available pages before exploring further.

1. Register a User

Create a new user and receive default Ethereum + TRON wallets.
curl -X POST https://crypto.westminister.tech/api/v1/users/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "phone_number": "+254712345678",
    "first_name": "John",
    "last_name": "Doe",
    "password": "your-secure-password",
    "role": "customer",
    "kyc_status": "pending"
  }'
Response includes user and wallets with initialized balances.

2. Authenticate

Use login (or login-pin if you set a PIN) to get an access token:
curl -X POST https://crypto.westminister.tech/api/v1/users/login-pin \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "pin": "123456"
  }'
Save the access_token and refresh_token from the response.

3. Call Protected Endpoints

Use the access token for authenticated requests:
curl -X GET "https://crypto.westminister.tech/api/v1/auth/user/email/user@example.com" \
  -H "Authorization: Bearer <your_access_token>"

4. Create an Order (On-Ramp)

Create an order to buy USDT with KES. Production flows require a matching offer and pricing (pricing_profile_id + fx_rate_quote_id) created by an admin — see Pricing and FX.
curl -X POST https://crypto.westminister.tech/api/v1/auth/orders \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "<customer_uuid>",
    "vendor_id": "<vendor_uuid>",
    "offer_id": "<offer_uuid>",
    "usdt_amount": "100.00",
    "fiat_amount": "14100.00",
    "fiat_currency": "KES",
    "wallet_address": "<your_wallet_address>",
    "payment_method": "mpesa",
    "order_type": "ON_RAMP_BUY",
    "expires_at": "2026-12-31T23:59:59Z",
    "pricing_profile_id": "<uuid-from-pricing>",
    "fx_rate_quote_id": "<uuid-from-fx-quotes>"
  }'
For off-ramp (OFF_RAMP_SELL), add payout_phone and use a customer wallet whose address matches the escrow network (TRON T... vs Ethereum 0x...) — see Orders and payments.

5. Initiate Payment

Trigger M-Pesa STK push for the order:
curl -X POST https://crypto.westminister.tech/api/v1/auth/orders/payment \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "order_id": "<order_uuid>",
    "phone_number": "254712345678"
  }'

Next Steps

Authentication

Understand refresh tokens and PIN-based login