Developer Reference
API and contract interfaces used by PolicyPay services. Keep this page open during integration and demo prep.
HTTP API
| Method | Endpoint | Purpose |
|---|---|---|
GET | /health | Service health and chain context |
GET | /config | Runtime config and signer info |
GET | /policies/:policyId | Read policy limits and status |
GET | /jobs/:jobId | Read onchain job state |
POST | /jobs/open | Open escrowed job |
POST | /jobs/:jobId/accept | Accept open job |
POST | /jobs/:jobId/submit | Submit result hash |
POST | /receipts/anchor | Anchor receipt hash |
POST | /jobs/:jobId/release | Release escrow to worker |
POST | /jobs/:jobId/refund | Refund escrow to payer |
Contract Methods (PolicyPayCore)
| Method | Description |
|---|---|
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