Getting started
Boursa lets your application open EGX brokerage accounts, fund them, and trade equities and money-market funds through one REST API. This page takes you from zero to a first order in the sandbox.
1. Get sandbox credentials
The sandbox runs on simulated money against a production-grade backend. It is reachable at:
- API:
https://sandbox.boursa.sh - Console:
https://console.boursa.sh
Your tenant credentials are an api_key (Bearer auth) and a signing_secret (HMAC signature on money endpoints). In local development the seeded demo tenant prints them once in the boot log; on the hosted sandbox they're provisioned for you.
2. The shape of an integration
A complete user journey is five steps. Each maps to a guide:
- Onboarding — create a KYC application, upload the national-ID photos, submit. The brokerage reviews and opens the account, returning an
investor_id. - Suitability — record the investor's suitability answers and risk acknowledgment (a regulatory gate before trading).
- Funding — deposit cash; it settles into the investor's balance.
- Trading — place equity orders and fund subscriptions.
- Portfolio — read balances, positions, performance, and statements.
Until the brokerage approves the account, there is no investor_id and no money can move — your users can browse market data, but funding and trading are gated. This mirrors how the platform enforces it server-side.
3. Read something (no signature needed)
Read endpoints need only the Bearer key:
curl https://sandbox.boursa.sh/v1/instruments \
-H "Authorization: Bearer $BOURSA_API_KEY"curl https://sandbox.boursa.sh/v1/clock \
-H "Authorization: Bearer $BOURSA_API_KEY"
# {"timestamp":"2026-06-14T11:00:00+03:00","is_open":true,
# "next_open":"2026-06-15T10:00:00+03:00","next_close":"2026-06-14T14:30:00+03:00"}4. Place an order (signed)
Money endpoints (POST /v1/orders, /v1/fund-orders, /v1/transfers, DELETE /v1/orders/{id}) carry an HMAC signature and an idempotency key. See Authentication for how to compute the signature.
curl -X POST https://sandbox.boursa.sh/v1/orders \
-H "Authorization: Bearer $BOURSA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "X-Boursa-Timestamp: $TS" \
-H "X-Boursa-Signature: $SIG" \
-H "Content-Type: application/json" \
-d '{
"investor_id": "inv_…",
"symbol": "COMI",
"side": "buy",
"type": "market",
"qty": 10,
"time_in_force": "day"
}'The response is an order object with both the internal state and the Alpaca-aligned status.
5. Fast-forward the sandbox clock
EGX trades Sun–Thu, 10:00–14:30 Africa/Cairo. The sandbox runs on a simulated clock you can advance so you don't have to wait for market hours:
curl -X POST https://sandbox.boursa.sh/admin/sandbox/clock-advance \
-H "X-Admin-Key: $BOURSA_ADMIN_KEY" \
-d '{"hours": 2}'When the session is open, market orders fill immediately and marketable limit orders fill at the live price; a limit away from the market rests until the price reaches it (or, for gtc, across sessions). See Order lifecycle.
Next
- Authentication — Bearer keys and the HMAC signature.
- Conventions — micros, idempotency, pagination, time.
- Placing orders — order types and time-in-force in depth.