Audience: Admins, Developers, Pilot teams
Prerequisites: One org, one partner link (optional if buyer is external), a user logged in
Outcome: Active contract → order → paid deposit → released milestone
1) Create a contract (blockchain‑ready)
curl -X POST $API_BASE/api/contracts/blockchain -b cookies.txt \ -H 'Content-Type: application/json' \ -d '{ "title":"Design SOW", "description":"Landing page redesign", "amount":150000, "currency":"USD", "buyerEmail":"[email protected]" }'
2) Create an order
curl -X POST $API_BASE/api/orders -b cookies.txt \ -H 'Content-Type: application/json' \ -d '{ "title":"Landing page redesign", "total":150000, "currency":"USD", "milestones":[{"name":"Wireframes","amount":50000},{"name":"Final design","amount":100000}] }'
3) Create a card payment intent
curl -X POST $API_BASE/api/payments/intents -b cookies.txt \ -H 'Content-Type: application/json' \ -d '{"orderId":"ord_123","amount":150000,"currency":"USD"}'
4) Subscribe to live events (browser)
const es = new EventSource('/api/events/stream', { withCredentials: true }); es.addEventListener('order.status.changed', e => console.log('order status', JSON.parse(e.data)));
5) Release a milestone
curl -X POST $API_BASE/api/escrow/release -b cookies.txt \ -H 'Content-Type: application/json' \ -d '{"orderId":"ord_123","milestoneId":"m1","amount":50000}'
Done. You’ve verified contracts, orders, payments, SSE, and escrow in one pass.