> ## 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.

# Quickstart

> Get Started with the EmaalCoin API in Under 5 Minutes

## 1. Register a User

Create a new user and receive default Ethereum + TRON wallets. Each wallet is provisioned with zero balances for **native** (ETH/TRX), **USDT**, and **USDC** on that network.

```bash theme={null}
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 (**USDT**, **USDC**, and native token per wallet).

## 2. Authenticate

Use login (or login-pin if you set a PIN) to get an access token:

```bash theme={null}
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:

```bash theme={null}
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](/guides/pricing-and-fx).

```bash theme={null}
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](/guides/orders-and-payments).

## 5. Initiate Payment

Trigger mobile money STK push for the order:

```bash theme={null}
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"
  }'
```

## Additional Wallet Provisioning

Use **`POST /api/v1/auth/wallets/for-owner`** with a Bearer token to add a custodial or treasury-multisig wallet tied to a **`users`** row (`owner_type`: **customer**, **vendor**, **merchant**, **sub\_merchant**, or **treasury**). Each new wallet gets zero balances for **native**, **USDT**, and **USDC** on the chosen network.

* **Retail (`customer`)**: non-admin callers must set **`user_id`** to their own id and have role **customer** or **user**. A **master vendor** may also use **`customer`** with their **own** **`user_id`** for an extra wallet.
* **`vendor`**: same as a **master merchant** — send **`user_id`** equal to the vendor’s user id (alternative to **`merchant`** + **`merchant_id`**).
* **Admin**: may use **`owner_type` `customer`** with **any** **`user_id`**. Use **`merchant`**/**`sub_merchant`** when the id field should be explicit.

See the **API Reference** tab for request fields and examples.

## Next Steps

<Card title="Authentication" icon="key" href="/authentication">
  Understand refresh tokens and PIN-based login
</Card>
