Skip to main content

Production Base URL

All paths below are rooted at:
Authenticated routes use header Authorization: Bearer <access_token> unless noted as public (Safaricom callbacks). Run migration 000044_otc_desk_controls before using desk reports, C2B tables, or deposit pricing snapshot columns.

Mobile Money C2B — Register with Safaricom (Public)

Register these ConfirmationURL and ValidationURL values in the Daraja portal for your pay bill/till: BillRefNumber must match an active row in merchant_c2b_accounts (create via admin API below).

Validation Callback (Safaricom → You)

POST https://crypto.westminister.tech/api/v1/mpesa/c2b/validation
Auth: none
Request body (example):
Response (accepted):
Response (unknown account reference):

Confirmation Callback (Safaricom → You)

POST https://crypto.westminister.tech/api/v1/mpesa/c2b/confirmation
Auth: none
Same request body shape as validation. On success the platform stores c2b_payments and, when BillRefNumber matches a merchant account, records merchant settlement (webhook c2b.payment.settled if OTC_EVENTS_WEBHOOK_URL is set). Response:

C2B Admin Configuration

Create Merchant Account Reference

POST https://crypto.westminister.tech/api/v1/auth/otc/c2b/accounts
Roles: admin or treasury

List C2B Payments

GET https://crypto.westminister.tech/api/v1/auth/otc/c2b/payments?merchant_id=<uuid>&from=2026-06-01T00:00:00Z&to=2026-06-02T00:00:00Z

OTC Deposit Credit — Quote Enforcement

POST https://crypto.westminister.tech/api/v1/auth/otc/deposits/{id}/credit
Roles: admin, otc_officer, or treasury (with limits below)
crypto_amount must match requested_crypto_amount within OTC_CREDIT_QUOTE_TOLERANCE_BPS (default 10). Otherwise 422 with requires_second_approval: true. admin or treasury may pass override_reason to credit a different amount.
422 example (quote mismatch):

Maker-Checker Limits (Env)

admin and treasury have no USD cap. treasury may confirm fiat and initiate credit.

Revenue Reports

GET https://crypto.westminister.tech/api/v1/auth/otc/reports/deposits?status=credited&limit=50&offset=0&from=2026-06-01T00:00:00Z&to=2026-06-30T23:59:59Z GET https://crypto.westminister.tech/api/v1/auth/otc/reports/deposits/rollup?from=2026-06-01T00:00:00Z&to=2026-06-30T23:59:59Z Response (rollup example):

Treasury Desk Liquidity

GET https://crypto.westminister.tech/api/v1/auth/treasury/desk-liquidity?network=tron&refresh=true

Hedge Notes (Manual Register)

POST https://crypto.westminister.tech/api/v1/auth/otc/hedge-notes

Bank Withdrawal Payout Tracking

POST https://crypto.westminister.tech/api/v1/auth/otc/withdrawals/{id}/record-bank-payout