Alpaca parity
Boursa's API is designed to be familiar to anyone who has integrated Alpaca. We adopt Alpaca's shapes and vocabulary wherever they fit, and document every place EGX market structure or our broker-of-record model requires a difference.
What we adopt
- Orders: order types (
market,limit), time-in-force (day,gtc,ioc,fok), an Alpaca-faithful order object withstatus,client_order_id,time_in_force,order_class,asset_class, and thesubmitted_at/filled_at/canceled_at/expired_attimestamps. - Order status vocabulary:
pending_new,accepted,new,partially_filled,filled,pending_cancel,canceled,expired,rejected— withstatus=open|closedlist filtering. - Clock & calendar:
GET /v1/clockandGET /v1/calendarmirror Alpaca's{timestamp,is_open,next_open,next_close}and[{date,open,close,session_open,session_close,settlement_date}]. - Idempotency:
client_order_id(plus anIdempotency-Keyheader).
Intentional divergences
| Area | Alpaca | Boursa | Why |
|---|---|---|---|
| Money | decimal strings ("82.21") | integer micros (82210000) | no float drift |
| Quantity | fractional / notional | whole shares only | EGX market structure |
| Auth | key-id + secret headers | Bearer + HMAC-signed money endpoints | broker-of-record posture |
| Errors | numeric codes | string codes + request_id | localizable, log-friendly |
| Sessions | extended hours, open/close auctions | single continuous session | EGX structure |
| Model | one self-trading account | tenant → broker → investor | Boursa is infrastructure beneath many brokers |
Mapping table
| Alpaca | Boursa |
|---|---|
GET /v2/account | GET /v1/investors/{id} + /balances |
GET /v2/positions | GET /v1/investors/{id}/portfolio |
GET /v2/orders | GET /v1/orders |
POST /v2/orders | POST /v1/orders |
DELETE /v2/orders/{id} | DELETE /v1/orders/{id} |
GET /v2/account/activities | GET /v1/investors/{id}/activities |
GET /v2/account/portfolio/history | GET /v1/investors/{id}/portfolio/performance |
GET /v2/assets | GET /v1/instruments |
GET /v2/clock | GET /v1/clock |
GET /v2/calendar | GET /v1/calendar |
GET /v2/stocks/bars | GET /v1/markets/{m}/instruments/{s}/ohlcv |
Roadmap
Stop / stop-limit / trailing-stop types, PATCH replace with replaces/replaced_by, cancel-all (207), cursor pagination (page_token/next_page_token), Alpaca-shaped account/position views, and a corporate-actions read API.