Protocol Docs

Developer Reference

API and contract interfaces used by PolicyPay services. Keep this page open during integration and demo prep.

HTTP API

MethodEndpointPurpose
GET/healthService health and chain context
GET/configRuntime config and signer info
GET/policies/:policyIdRead policy limits and status
GET/jobs/:jobIdRead onchain job state
POST/jobs/openOpen escrowed job
POST/jobs/:jobId/acceptAccept open job
POST/jobs/:jobId/submitSubmit result hash
POST/receipts/anchorAnchor receipt hash
POST/jobs/:jobId/releaseRelease escrow to worker
POST/jobs/:jobId/refundRefund escrow to payer

Contract Methods (PolicyPayCore)

MethodDescription
upsertPolicy(bytes32,uint256,uint256,bool)Create/update policy constraints
openJob(bytes32,bytes32,bytes32)Create escrow-backed job
acceptJob(bytes32)Assign worker and lock execution path
submitResult(bytes32,bytes32)Attach result hash to job
anchorReceipt(bytes32,bytes32)Record immutable execution receipt
release(bytes32)Release escrow to worker after submission
refund(bytes32)Return escrow to payer before completion
slashToTreasury(bytes32,address)Owner slashing path for failed jobs
policies(bytes32)Read policy state
jobs(bytes32)Read job state machine record

Important Constants

  • Chain: Base Sepolia
  • Contract: 0x051cAD2fcf7D1ff415c35a8090f0507D454bd608
  • Default policy ID: policy/base-sepolia/default
PolicyPay docs — concise interfaces for integration and review.