Skip to main content

MPP Endpoints

MPP is the machine-facing commercial layer on top of Remlo. Each endpoint either charges a one-off HTTP 402 payment or opens a session that uses cumulative vouchers. The handlers are built with mppx.

Full endpoint table

#MethodRouteChargeTypePayerBacking system
1GET/api/mpp/treasury/yield-rates$0.01Single chargeAI agentYieldRouter
2POST/api/mpp/payroll/execute$1.00Single chargeAI agentPayrollBatcher, Supabase
3POST/api/mpp/employee/advance$0.50Single chargeEmployeeStreamVesting
4POST/api/mpp/compliance/check$0.05Single chargeEmployer, auditor, or agentTIP-403, compliance_events
5GET/api/mpp/employee/balance/stream$0.001/tickSession SSEEmployee or agentStreamVesting
6GET/api/mpp/payslips/[runId]/[employeeId]$0.02Single chargeEmployee or employerpayment_items, payroll_runs
7POST/api/mpp/memo/decode$0.01Single chargeAuditor or employerdecodeMemo()
8GET/api/mpp/employee/[id]/history$0.05Single chargeEmployee or agentpayment_items
9POST/api/mpp/bridge/offramp$0.25Single chargeEmployeeBridge transfer API
10POST/api/mpp/treasury/optimize$0.10SessionEmployer agentPayrollTreasury, YieldRouter
11GET/api/mpp/marketplace/compliance-list/[employerId]$0.50Single chargeEmployer or auditorcompliance_events
12POST/api/mpp/agent/session/treasury$0.02SessionAI agentTreasury, yield, registry contracts

Session endpoints

Only three endpoints use session mechanics in the current design:
RouteSession unit
/api/mpp/employee/balance/streamsecond
/api/mpp/treasury/optimizesession
/api/mpp/agent/session/treasurysession
These routes are designed for repeated reads or multi-step agent work where a one-off on-chain payment per request would be too expensive or too slow.

Multi-rail endpoints

Two MPP write routes currently use a composed payment path with Tempo and Stripe fallback:
  • /api/mpp/payroll/execute
  • /api/mpp/bridge/offramp
They call Mppx.compose() with:
  • a Tempo PathUSD charge
  • a Stripe charge with currency: "usd" and decimals: 2

Request shapes

POST /api/mpp/payroll/execute

{
  "payrollRunId": "run_123"
}
Returns the transaction hash, payroll run id, and recipient count after executeBatchPayroll() is submitted.

POST /api/mpp/employee/advance

{
  "employeeAddress": "0x..."
}
Claims accrued streamed wages through StreamVesting.claimAccrued().

POST /api/mpp/compliance/check

{
  "walletAddress": "0x...",
  "policyId": 1,
  "employerId": "employer_123"
}
Writes a compliance event ledger entry even when the result is blocked.

GET /api/mpp/employee/balance/stream?employeeId=emp_123

Returns an SSE stream with one event per second. The payload includes:
  • tick
  • employeeId
  • balance
  • balanceUsd
  • salary_per_second_usd
  • timestamp
Legacy address query support is still accepted for compatibility, but employeeId is now the canonical request shape.

POST /api/mpp/bridge/offramp

{
  "employeeId": "emp_123",
  "amount": "250.00",
  "destinationType": "ach",
  "bankAccountId": "bank_123"
}

POST /api/mpp/treasury/optimize

{
  "employerId": "employer_123",
  "question": "Should I keep more idle liquidity in treasury this week?"
}
Returns a richer optimization payload with summary, suggestion, recommendations, current vs recommended allocation, and projected annual yield.

GET /api/mpp/marketplace/compliance-list/[employerId]

Returns the marketplace allowlist contract:
{
  "providerId": "employer_123",
  "clearedWallets": 24,
  "list": [
    {
      "walletAddress": "0x1234...",
      "checkedAt": "2026-03-23T08:00:00.000Z",
      "employeeId": "emp_123",
      "eventType": "mpp_check"
    }
  ],
  "lastUpdated": "2026-03-23T08:00:00.000Z"
}

POST /api/mpp/agent/session/treasury

{
  "action": "balance",
  "employerId": "employer_123"
}
Supported action values:
  • balance
  • yield
  • rebalance
  • headcount
The rebalance action accepts either:
  • allocation
  • params.targetAllocation
All successful responses now return the canonical envelope:
{
  "action": "balance",
  "result": {
    "employerId": "employer_123",
    "availableUsd": "12000.000000"
  },
  "timestamp": 1763892000000
}