Developer integration
Compile payout policy into a runtime your marketplace can call
Pact Runtime is a self-hosted policy compiler and command service for conditional marketplace payouts. Your backend creates an agreement, sends actor-authenticated business events, and receives deterministic decisions plus evidence linking the approved rule to the ledger postings.
Pact Runtime decides when money may move. It never moves it.
Drop it in beside the payout stack you already run. It owns the decision and the audit trail; your stack keeps the customer and the rails.
Pact Runtime owns
- Actor authorization for every command
- Agreement state and version safety
- Exact deadlines and dispute locks
- Release/refund exclusivity
- Retries and durable ledger delivery
- An audit trail bound to one approved artifact
Your platform keeps
- Checkout and product UI
- Seller onboarding
- Custody and KYC/AML
- Bank and card rails
- Tax and fraud
- Tenant operations and identity
Self-hosted. Runs next to your application and connects its verified ledger effects to your regulated payment infrastructure.
Stop implementing the same payout rule six different ways
- One approved source of truthTransitions, deadlines, fee splits, scripts, and runtime guards compile from a single artifact.
- Concurrency that cannot double-payExpected versions, terminal reservation, durable delivery, and ledger idempotency converge on one settlement.
- Evidence for every outcomeTrace any accepted or rejected command to the exact policy, digest, operation, and postings.
Configure policy once. Execute without AI.
- 01 · Control planeApprove and activate
Review source-linked rules, approve an exact hash, then compile and verify the immutable artifact.
- 02 · Your orderCreate an agreement
Bind your order ID, buyer, seller, platform, deadline, and active artifact.
- 03 · RuntimeSend business events
Use agreement-bound actor tokens, stable event identities, idempotency keys, and the expected version.
- 04 · OperationsRead the proof
Inspect the decision, delivery status, trace, ledger transaction, exact postings, and balances.
HTTP surface
The routes a marketplace backend calls
Operator routes configure and audit a workspace. Actor tokens can submit commands only for one agreement, role, and actor identity.
POST /v1/interpretationsCreate an untrusted, source-linked policy draft.
POST /v1/candidates/{revision_id}/approvalsApprove one immutable revision hash.
POST /v1/approvals/{approval_id}/artifactsGenerate and verify the runtime artifact.
POST /v1/artifacts/{artifact_id}/activationsAllow the verified artifact in this sandbox.
POST /v1/sandbox/agreementsBind an order, actors, artifact, and deadline.
POST /v1/sandbox/agreements/{agreement_id}/actor-tokensMint agreement-scoped buyer, seller, and platform tokens.
POST /v1/agreements/{agreement_id}/eventsApply a strict, versioned, replay-safe command.
GET /v1/agreements/{agreement_id}/evidenceRead decisions, operations, traces, postings, and balances.
AI boundary
Only POST /v1/interpretations calls GPT-5.6
It returns an untrusted source-linked draft and visible blockers. Approval, compilation, verification, activation, runtime commands, retries, Ledger delivery, and evidence reads use deterministic software with no model call.
Sandbox quickstart
Run the complete API without rebuilding
Use a deployment operator key against a separate sandbox. The runner creates a new workspace, so the public showcase remains unchanged.
export PACT_API_URL='https://api.pactruntime.com'
export PACT_OPERATOR_KEY='<sandbox operator key>'
./scripts/sandbox-api-tour.sh1 · Bind an order
Create an agreement
The active artifact supplies amount, asset, split, rules, and effects; the request cannot override them.
curl --fail-with-body \
-X POST "$PACT_API_URL/v1/sandbox/agreements" \
-H "Authorization: Bearer $PACT_OPERATOR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"workspace_id": "ws_marketplace",
"artifact_id": "art_approved_policy",
"agreement_id": "order_8472",
"buyer_id": "buyer_104",
"seller_id": "seller_228",
"platform_id": "marketplace",
"acceptance_deadline": "2026-08-01T18:00:00.000Z"
}'2 · Apply a decision
Accept delivery
ACCEPT_DELIVERY is the command. “Release” is the resulting money effect—not a caller-selected event.
curl --fail-with-body \
-X POST "$PACT_API_URL/v1/agreements/order_8472/events" \
-H "Authorization: Bearer $PACT_BUYER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"event_id": "evt_accept_8472",
"idempotency_key": "order-8472-accept",
"expected_version": 2,
"event_type": "ACCEPT_DELIVERY",
"actor": { "id": "buyer_104", "role": "buyer" },
"payload": {}
}'Supported v1 commands
One explicit marketplace lifecycle
| Command | Authority | Effect |
|---|---|---|
FUND | buyer | Fund the escrow using the approved artifact amount. |
SUBMIT_DELIVERY | seller | Record delivery before the trusted deadline. |
ACCEPT_DELIVERY | buyer | Accept delivery; the runtime derives the release effect. |
OPEN_DISPUTE | buyer or seller | Lock terminal payout while the dispute is open. |
RESOLVE_FOR_SELLER / RESOLVE_FOR_BUYER | platform | Resolve the dispute to the authorized terminal outcome. |
DEADLINE_EXPIRED | internal scheduler | Refund an eligible funded agreement at the exact deadline. |
3 · Audit the result
Read the complete evidence chain
The response binds agreement state and command decisions to the approved artifact, operation delivery, traces, Ledger transaction, postings, and balances.
curl --fail-with-body \
-H "Authorization: Bearer $PACT_OPERATOR_TOKEN" \
"$PACT_API_URL/v1/agreements/order_8472/evidence"Response contract
Five explicit outcomes
accepted, accepted_pending, committed, operation_failed, or rejected. Identical replay returns the stored result; changed identity reuse fails closed.
Deployment boundary
Bring your payment infrastructure
Pact Runtime supplies policy authorization, deterministic ledger effects, and evidence. Your deployment supplies tenant operations, production authentication, custody, and regulated money rails.