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.
Overview
Custodial corridor remittance is separate from the P2P-stylePOST /api/v1/auth/remittance/off-ramp/orders path. The customer already holds USDT or USDC in a custodial platform wallet. They choose a corridor (for example GB → KE). They enter how much KES the beneficiary should receive. The app resolves pricing and FX. The backend creates a draft with a unique escrow address. On Confirm, the server creates an order with order_subtype = custodial_remittance_offramp, then broadcasts the priced stablecoin (USDT or USDC) from the custodial wallet to that escrow. After confirmations, M-Pesa B2C pays beneficiary_phone.
Prerequisites
- Run database migration
000031_corridors_custodial_remittanceon your environment. - Seed at least one row in
corridorswithvendor_idandoffer_idpointing to your platform pricing anchor (same commercial pattern as other off-ramp listings). - Create offramp
pricing_profilesandfx_rate_quotesfor USDT or USDC (paired with KES) on the sender network (for example tron).
Mobile sequence
GET /api/v1/auth/remittance/custodial/corridors— populate destination and corridor selection.POST /api/v1/auth/pricing/resolveorPOST /api/v1/auth/pricing/fx-quotes(and profiles) as you do today — obtainpricing_profile_idandfx_rate_quote_idforflow_type=offramp.POST /api/v1/auth/remittance/custodial/drafts— body includescorridor_id,custodial_wallet_id,beneficiary_fiat_amount,fiat_currency, beneficiary and sender KYC fields,fee_bearer, and the pricing IDs. The response includesusdt_total_debit(total stablecoin debit for USDT- or USDC-priced flows; field name is historical) andescrow_wallet_addressfor the summary screen.POST /api/v1/auth/remittance/custodial/drafts/{id}/confirm— empty JSON body is fine. The server creates the order and submits the on-chain transfer from the custodial wallet to the draft escrow.
failed while the draft stays draft with a linked order_id. A second confirm retries the transfer for the same order.
Order shape
Confirmed orders useorder_type = OFF_RAMP_SELL, payment_method = custodial_remittance_escrow, and order_subtype = custodial_remittance_offramp. corridor_id is stored on the order when present. Payout orchestration uses beneficiary_phone for M-Pesa, same as remittance_offramp.