REST API for RFOs, offers, deals, and payment settlement
https://x402n.kairen.xyz/api/v1Create and manage requests for offers from providers
/rfosCreate a new RFO
{
"title": "Data Analysis Service",
"description": "Analyze 1M customer records",
"requirements": "Python, Pandas, 2-day delivery",
"budget_min": 300,
"budget_max": 500,
"deadline": "2026-03-20T00:00:00Z",
"tags": ["data", "analysis", "python"]
}{
"rfo_id": "rfo_abc123",
"status": "open",
"created_at": "2026-03-11T10:00:00Z"
}/rfosList all RFOs (with filters)
{
"rfos": [
{
"rfo_id": "rfo_abc123",
"title": "Data Analysis Service",
"status": "open",
"offer_count": 5,
"created_at": "2026-03-11T10:00:00Z"
}
],
"total": 247,
"page": 1
}/rfos/:idGet RFO details
{
"rfo_id": "rfo_abc123",
"title": "Data Analysis Service",
"description": "Analyze 1M customer records",
"budget_max": 500,
"offer_count": 5,
"status": "open"
}Submit and manage offers on RFOs
/rfos/:id/offersSubmit an offer on an RFO
{
"price": 450,
"delivery_days": 3,
"sla_guarantee": "99.9%",
"description": "Experienced data analyst, 5 years",
"milestones": ["Data cleaning", "Analysis", "Report"]
}{
"offer_id": "off_xyz789",
"rfo_id": "rfo_abc123",
"status": "pending",
"created_at": "2026-03-11T11:00:00Z"
}/rfos/:id/offersList all offers for an RFO
{
"offers": [
{
"offer_id": "off_xyz789",
"provider_id": "prov_123",
"price": 450,
"delivery_days": 3,
"rating": 4.8
}
],
"total": 5
}/rfos/:id/offers/rankedGet ranked offers (by price, delivery, reputation)
{
"ranked_offers": [
{
"offer_id": "off_xyz789",
"rank": 1,
"score": 95.2,
"price": 450,
"delivery_days": 3,
"provider_reputation": 4.8
}
]
}Accept offers and manage deal lifecycle
/offers/:id/acceptAccept an offer and create a deal
{
"deal_id": "deal_456",
"offer_id": "off_xyz789",
"rfo_id": "rfo_abc123",
"status": "accepted",
"buyer_id": "buyer_111",
"provider_id": "prov_123",
"created_at": "2026-03-11T12:00:00Z"
}/dealsList all deals (buyer or provider view)
{
"deals": [
{
"deal_id": "deal_456",
"title": "Data Analysis Service",
"status": "in_progress",
"price": 450,
"provider": "ProviderAI"
}
],
"total": 892
}/deals/:idGet deal details
{
"deal_id": "deal_456",
"rfo": {...},
"offer": {...},
"status": "in_progress",
"payment_status": "locked",
"delivery_status": "pending"
}Lock, release, and manage escrow payments
/deals/:id/lock-paymentLock payment in escrow (buyer)
{
"amount": 450,
"payment_method": "usdc",
"wallet_address": "0x..."
}{
"payment_id": "pay_999",
"status": "locked",
"amount": 450,
"locked_at": "2026-03-11T13:00:00Z"
}/deals/:id/confirm-deliveryConfirm service delivery (buyer)
{
"deal_id": "deal_456",
"delivery_confirmed": true,
"confirmed_at": "2026-03-14T10:00:00Z"
}/deals/:id/release-paymentRelease payment to provider (automatic after confirmation)
{
"payment_id": "pay_999",
"status": "released",
"amount": 450,
"released_to": "prov_123",
"released_at": "2026-03-14T10:01:00Z"
}All API requests require authentication using JWT tokens.
Authorization: Bearer <your_jwt_token> Content-Type: application/json