Skip to content
Partner API Docs

Going Live

Switch from sandbox to production — the request/response shapes are identical, only the base URL and key prefix change. Includes the sandbox↔production differences, onboarding steps, and a pre-launch checklist across security, reliability, correctness, and observability.

Once your integration is tested, switch to the production endpoints. The request and response shapes are identical — only the base URL and key format change.

SandboxProduction
Base URLhttps://mystocks.africa/api/sandbox/v1https://mystocks.africa/api/v1/partner
API key prefixsk_sandbox_pk_live_
Trade settlementInstant (no queue)PENDING → reviewed → COMPLETED / REJECTED
Stock pricesLive (production read-through)Live market prices
Wallet fundingAuto $100k on registerAdmin deposits real funds
Reset endpointAvailableNot available

Onboarding steps

Register at mystocks.africa/partners/register and submit your application.
MyStocks reviews your application within 1–2 business days.
Upon approval, you receive your pk_live_ API key and access to the partner dashboard.
Swap the base URL and key prefix — no other code changes needed.
Submit trades via POST /api/v1/partner/trade → orders enter the live market fill flow.
Live market orders submitted during exchange hours target fill within 5 minutes. Monitor via GET /orders/{orderId} or the order.filled / order.rejected webhooks. Settlement cycles: GET /market/settlement.

Pre-launch checklist

Security

  • API key stored in environment variables — never committed to source control.
  • Webhook endpoint validates the HMAC-SHA256 signature using timingSafeEqual before processing events.
  • Sub-account IDs treated as internal identifiers — never exposed directly to end-users.

Reliability

  • Idempotency-Key set on all deposit, withdraw, and trade requests.
  • Exponential backoff implemented for 429 and 500 responses.
  • Webhook endpoint returns 2xx within 8 seconds; heavy processing deferred to a background queue.
  • Webhook delivery failures reconciled from the deliveries endpoint or partner dashboard.

Integration correctness

  • All sandbox scenarios passed: BUY, SELL, insufficient funds, KYC rejection.
  • Order status polling (or webhook) handles PENDING, FILLED, REJECTED, and CANCELLED.
  • FX rate recorded on each deposit and withdrawal for your own audit trail.
  • Sub-account KYC tier verified before allowing trades above tier-1 limits.
  • Error codes 401, 403, 422, and 429 handled gracefully in your UI.

Observability

  • Audit log (GET /audit) integrated into your compliance reporting.
  • Usage analytics (GET /usage) monitored to stay within your rate-limit tier.
  • Alert configured when X-RateLimit-Remaining drops below 20% of your tier ceiling.

On this page