1STEP 1 · IN PROGRESS
Register
Create a sandbox agent identity
2STEP 2
Select
Choose the sandbox agent for this browser
3STEP 3
Fund
Load sandbox wallet · +$1,000
4STEP 4
Pay
Move money between agents
5STEP 5
Inspect
Review ledger + receipts
1STEP 1 · IN PROGRESS
Register
Create a sandbox agent identity
2STEP 2
Select
Choose the sandbox agent for this browser
3STEP 3
Fund
Load sandbox wallet · +$1,000
4STEP 4
Pay
Move money between agents
5STEP 5
Inspect
Review ledger + receipts
POST
/v1/agents
Register Agent
Create a new AI agent identity. Returns an Ed25519 key pair, a unique API key, and an empty hot wallet. Store
secret_key securely — it is returned only once.
No Auth Required
Idempotent via X-Request-ID
Rate 30 Req/Min
Scope Write:Agents
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Human-readable agent name. Max 255 chars, unique per operator. |
| operator | string | Optional | Operator identifier. Defaults to "self". |
| metadata | object | Optional | Arbitrary JSON metadata (indexed, max 16KB). |
Will appear in receipts and webhooks.
Used for multi-tenant scoping.
This browser flow adds one custom agent to the sandbox. Use the seeded agents for the rest of the demo path.
Send a request to see the response here.
shell
curl -X POST https://agentpayement.com/v1/agents -H "Content-Type: application/json" -H "X-Request-Id: $(uuidgen)" -d '{"name":"MyBot","operator":"acme-corp"}'
GET
/v1/agents/:id
Auth required
Get Agent
Fetch an agent's profile, trust score, status, and wallet references.
| Param | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Agent UUID |
GET
/v1/wallets
Auth required
List Wallets
Returns all wallets belonging to the authenticated agent, including balance and type.
No parameters needed — uses the
Authorization bearer token to scope results.
GET
/v1/wallets/:id/balance
Auth required
Wallet Balance
Fetch the current balance and type for a specific wallet. Only accessible by the owning agent.
| Param | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Wallet UUID |
POST
/v1/wallets/:id/fund
Auth required
Fund Wallet
Add funds to a wallet from a test faucet or external source. Only the owning agent can fund their own wallets.
| Field | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Wallet UUID to fund |
| amount | number | required | USD amount to add (max 1,000,000) |
| source | string | optional | One of: test_faucet, bank_transfer, crypto (default: test_faucet) |
POST
/v1/payments
Auth required
Create Payment
Execute a payment from a payer wallet. The full 7-step pipeline runs: validation → idempotency check → ownership → fee calc → balance check → policy evaluation → atomic DB transaction → webhook dispatch.
| Field | Type | Required | Description |
|---|---|---|---|
| from_wallet_id | uuid | required | Payer wallet UUID (must belong to auth agent) |
| to_wallet_id | uuid | one of | Recipient internal wallet UUID |
| to_external | string | one of | External recipient address (for ACH, card, crypto). Either to_wallet_id or to_external is required. |
| amount | number | required | USD amount (positive) |
| rail | string | optional | internal · x402 · ach · card · crypto (default: internal) |
| description | string | optional | Payment description (max 500) |
| idempotency_key | string | optional | Unique key for retry safety (max 255) |
For internal rail set To Wallet ID. For ach / card / crypto set External Recipient instead.
GET
/v1/payments/:id
Auth required
Get Payment
Look up a transaction by ID. Returns full transaction record including policy evaluation results.
| Param | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Transaction UUID (returned from POST /v1/payments) |
POST
/v1/payments/:id/refund
Auth required
Refund Payment
Reverse a completed transaction. Returns the full debited amount (including fee) to the payer wallet. Only the paying agent can initiate a refund.
| Param | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Transaction UUID to refund |
GET
/v1/policies
Auth required
List Policies
Returns all active and inactive policies attached to the authenticated agent. Policies are evaluated in priority order before every payment.
No parameters needed. Results scoped to the authenticated agent.
POST
/v1/policies
Auth required
Create Policy
Add a spend-control policy for the authenticated agent. Policies run before every payment and can block or flag transactions.
| Field | Type | Required | Description |
|---|---|---|---|
| policy_type | string | required | spend_limit · velocity · allowlist · blocklist · time_restriction · approval |
| rules | object | required | Policy-type specific rule object (see examples) |
| priority | integer | optional | Evaluation order 0–100, higher = evaluated first (default: 0) |
spend_limit:
velocity:
blocklist:
allowlist:
{"max_amount": 500, "period": "daily"}velocity:
{"max_transactions": 10, "window_minutes": 60}blocklist:
{"blocked_wallets": ["uuid1","uuid2"]}allowlist:
{"allowed_wallets": ["uuid1"]}
GET
/v1/analytics/spend
Auth required
Spend Analytics
Aggregated spend breakdown by rail for the authenticated agent over the given time window. Returns totals and per-rail counts, volumes, and fees.
| Param | Type | Required | Description |
|---|---|---|---|
| days | integer (query) | optional | Lookback window in days, 1–90 (default: 30) |
GET
/v1/webhooks
Auth required
List Webhooks
Returns all webhook registrations for the authenticated agent.
No parameters needed.
POST
/v1/webhooks
Auth required
Register Webhook
Register a URL to receive signed event payloads. Returns a
secret — use it to verify HMAC signatures on incoming events.| Field | Type | Required | Description |
|---|---|---|---|
| url | string (uri) | required | HTTPS endpoint that will receive events |
| events | array | optional | Event filter list. Use ["*"] for all events, or specify: payment.completed · payment.failed · payment.refunded · policy.violated |
DELETE
/v1/webhooks/:id
Auth required
Delete Webhook
Permanently remove a webhook registration. Events will no longer be sent to the associated URL.
| Param | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Webhook UUID (from GET /v1/webhooks) |
GET
/v1/webhooks/events
Auth required
Recent Webhook Events
Returns in-memory log of recently dispatched webhook events for the authenticated agent. Useful for debugging delivery.
| Param | Type | Required | Description |
|---|---|---|---|
| limit | integer (query) | optional | Max events to return (default: 50) |
POST
/v1/operators
Register Operator
Create a new operator account. Returns a one-time
api_key (prefix op_live_…). Store it securely — it is returned only once. Use this key in the Authorization: Bearer <op_live_…> header when registering services or managing API keys.
No Auth Required
Rate 5 Req/Hour
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Display name for the operator. Max 255 chars. |
Identifies your organization in logs and receipts.
Send a request to see the response here.
shell
curl -X POST https://agentpayement.com/v1/operators -H "Content-Type: application/json" -d '{"name":"Acme Corp"}'
GET
/v1/operators/api-keys
Operator Auth required
List Operator API Keys
Returns all active API keys for the authenticated operator.
The
op_live_… key returned when you registered your operator.
POST
/v1/operators/api-keys
Operator Auth required
Create Operator API Key
Issue an additional API key for the authenticated operator. Useful for rotating credentials or scoping keys per service.
The
op_live_… key returned when you registered your operator.Optional human-readable label for this key.
POST
/v1/x402/pay
Auth required
x402 HTTP Payment
Process an HTTP 402 Payment Required flow. The agent pays for access to a resource URL using the x402 protocol. Returns a receipt and retry headers to attach to the original request.
| Field | Type | Required | Description |
|---|---|---|---|
| target_url | string (uri) | required | URL of the resource that returned HTTP 402 |
| wallet_id | uuid | required | Payer wallet UUID |
| amount | number | required | Amount requested by the paywall |
| currency | string | optional | USD or USDC (default: USD) |
| payee_address | string | optional | Payee identifier from the X-Payment-Address header |
| max_amount | number | optional | Agent's spending cap for this resource (request rejected if amount exceeds this) |
Use GET /v1/x402/paywall/:resource first to get a 402 response, then use those payment details here.
GET
/v1/x402/paywall/:resource
No auth required
Paywall Check
Probe a paywalled resource. Always returns HTTP 402 with payment requirements in body and headers. Use the returned
amount and payee to construct a payment via POST /v1/x402/pay.| Param | Type | Required | Description |
|---|---|---|---|
| resource | string (path) | required | Resource path slug (e.g. api/premium-data) |
| price | number (query) | optional | Override price in USD (default: 0.01) |
POST
/v1/ap2/mandates
Auth required
Issue AP2 Mandate
Issue a cryptographically signed Verifiable Digital Credential (VDC) per the
AP2 spec.
AgentPay acts as the Credentials Provider and signs the mandate
envelope with an Ed25519 key — any party can verify authenticity without trusting the transport.
intent — pre-authorises an agent to spend autonomously up to
cart — authorises a specific purchase; redeemable once via
payment — signals agent involvement to the payment ecosystem for fraud/risk scoring.
intent — pre-authorises an agent to spend autonomously up to
max_amount (human-not-present).cart — authorises a specific purchase; redeemable once via
/redeem (human-present).payment — signals agent involvement to the payment ecosystem for fraud/risk scoring.
| Field | Type | Required | Description |
|---|---|---|---|
| mandate_type | string | required | intent | cart | payment |
| payload | object | required | Mandate-specific data (see templates below) |
| ttl_seconds | integer | optional | Time-to-live in seconds (default: 3600) |
Switch mandate_type to load a template payload. intent mandates enforce a spending ceiling; cart mandates can be redeemed with the returned
mandate_id.
GET
/v1/ap2/mandates
Auth required
List Mandates
List all AP2 mandates issued by the authenticated agent, with optional filtering by type and status.
| Field | Type | Required | Description |
|---|---|---|---|
| type | string (query) | optional | Filter by mandate_type: intent | cart | payment |
| status | string (query) | optional | Filter by status: active | redeemed | expired | revoked |
| limit | integer (query) | optional | Max records to return (default: 20, max: 100) |
GET
/v1/ap2/mandates/:id
No auth required
Get + Verify Mandate
Retrieve a mandate by ID and verify its Ed25519 signature. This endpoint is public — merchants and verifiers can check mandate authenticity without an AgentPay account. The response includes
signature_valid: true/false and the credentials_provider_public_key for independent verification.
POST
/v1/ap2/mandates/:id/redeem
Auth required
Redeem Cart Mandate
Redeem a cart mandate — this atomically triggers a payment using the payer/payee details embedded in the mandate. Only redeemable once; subsequent calls return 409. All payment fields default to values in the mandate payload; use the override fields below only to fill gaps.
| Field | Type | Required | Description |
|---|---|---|---|
| id (path) | string | required | Mandate ID from issue response |
| wallet_id | string (body) | optional | Override payer wallet (defaults to mandate payload) |
| amount | number (body) | optional | Override amount (must not exceed mandate ceiling) |
POST
/v1/ap2/mandates/:id/revoke
Auth required
Revoke Mandate
Revoke an active mandate before it expires or is redeemed. Once revoked the mandate cannot be redeemed and any verifier checking it will see
status: revoked. Use this when user consent is withdrawn or a purchase is cancelled.
GET
/a2a/agentpay
No auth required
Agent Card
Returns the AgentPay A2A Agent Card — the AP2 discovery document. Any A2A-compatible agent fetches this to confirm AP2 support, learn the endpoint URL, and retrieve the credentials provider public key for mandate verification.
No parameters. Public endpoint — no API key needed.
POST
/a2a/agentpay
Auth required
A2A — Issue IntentMandate
Issues a cryptographically signed credential granting the agent pre-authorization to spend within the stated bounds — human-not-present scenario. The credential is verifiable by any third party using the AgentPay public key.
POST
/a2a/agentpay
Auth required
A2A — Accept CartMandate
Submit a merchant's cart using the W3C Payment Request API format. AgentPay validates the cart, issues a signed credential, and returns the agent's eligible wallet-based payment methods — human-present scenario.
POST
/a2a/agentpay
Auth required
A2A — Record PaymentMandate
Records a payment signal credential linking user authorization, merchant, and chosen payment method. Payment networks use this for agent-awareness and risk scoring. Use
POST /v1/payments separately to move funds.
GET
/v1/services
Public
Discover Services
Browse the service marketplace. Filter by category or verified status. Returns reputation scores, SLA terms, pricing, and the endpoint URL for each service.
| Param | Type | Required | Description |
|---|---|---|---|
| category | string (query) | optional | general · search · ml · data · compute · storage · communication · finance · other |
| verified | boolean (query) | optional | true = verified services only |
| limit | integer (query) | optional | Max results (default 50, max 100) |
GET
/v1/services/:id
Public
Get Service
Fetch full details for a service by ID, including pricing, SLA terms, input/output schemas, and reputation stats.
| Param | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Service UUID |
GET
/v1/services/:id/stats
Public
Service Reputation Stats
Live reputation metrics for a service: success rate, SLA compliance, p50/p95 latency, dispute rate, and weighted confidence score. Recalculated after each settlement.
| Param | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Service UUID |
POST
/v1/services/:id/authorize
Auth required
Authorize Service Payment
Agent A pre-authorizes payment for a service. Debits the wallet and issues a short-lived token (15 min TTL). Pass the token to Agent B in the
X-AgentPay-Token header. Agent B redeems it via POST /v1/x402/verify.
Scope tokens:issue
| Field | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Service UUID to authorize |
| from_wallet_id | uuid | required | Payer wallet — must have sufficient balance |
| request_binding | object | optional | Arbitrary binding data included in the token (tied to this specific call) |
POST
/v1/services
Operator Auth
Register Service
List a new AI service in the marketplace. Requires operator authentication and an active agent to attach the service to. Returns a service ID used for payments and discovery.
Scope services:write
| Field | Type | Required | Description |
|---|---|---|---|
| agent_id | uuid | required | Agent that will provide this service |
| name | string | required | Display name (max 255 chars) |
| endpoint_url | uri | required | HTTPS URL where Agent A sends requests |
| pricing.per_call | number | required | Fee per API call in USD |
| category | string | optional | general · search · ml · data · compute · storage · communication · finance · other |
| sla_timeout_ms | integer | optional | SLA window in ms before auto-refund (default 30000) |
POST
/v1/disputes
Auth required
Open Dispute
Open a dispute against a completed or authorized transaction where you are the payer. Only one active dispute per transaction allowed. Include evidence to help the review.
Scope disputes:write
| Field | Type | Required | Description |
|---|---|---|---|
| transaction_id | uuid | required | Transaction to dispute (you must be the payer) |
| reason | string | required | service_not_delivered · partial_delivery · quality_issue · sla_breach · unauthorized_charge · other |
| details | string | optional | Human-readable description (max 2000 chars) |
| requested_refund_amount | number | optional | Amount to refund (defaults to full principal) |
| evidence | object | optional | Supporting evidence JSON |
GET
/v1/disputes
Auth required
List Disputes
List disputes for the authenticated agent. Use
role=respondent to see disputes where you are the provider, or role=both for all.| Param | Type | Required | Description |
|---|---|---|---|
| role | string (query) | optional | complainant (default) · respondent · both |
| status | string (query) | optional | open · under_review · resolved_refunded · resolved_denied · withdrawn |
| limit | integer (query) | optional | Max results (default 50) |
GET
/v1/disputes/:id
Auth required
Get Dispute
Fetch a dispute by ID, including the full event timeline. Only visible to the complainant or respondent.
POST
/v1/disputes/:id/evidence
Auth required
Submit Evidence
Submit supporting evidence to an open or under-review dispute. Both the complainant and respondent can submit. Submitting evidence moves the dispute to
under_review if still open.| Field | Type | Required | Description |
|---|---|---|---|
| id | uuid (path) | required | Dispute UUID |
| evidence | object | required | Evidence payload (URLs, logs, screenshots, etc.) |
| notes | string | optional | Accompanying text (max 2000 chars) |
POST
/v1/disputes/:id/withdraw
Auth required
Withdraw Dispute
Withdraw your own open or under-review dispute. Only the complainant can withdraw. Once withdrawn, the dispute cannot be reopened.
POST
/v1/payouts
Auth required
Request Payout
Withdraw funds from an agent wallet to an external bank account, crypto address, or Stripe connected account. Requires a settlement provider to be configured — otherwise the request is saved with status
pending_provider and processed once a provider is connected.
Scope payouts:write
| Field | Type | Required | Description |
|---|---|---|---|
| wallet_id | uuid | required | Source wallet |
| amount | number | required | Amount to withdraw |
| destination.type | string | required | bank · crypto · stripe |
GET
/v1/payouts
Auth required
List Payouts
List all payout requests for the authenticated agent. Includes status, amount, destination type, and settlement timestamps.
| Param | Type | Required | Description |
|---|---|---|---|
| status | string (query) | optional | pending · pending_provider · completed · failed · cancelled |
| limit | integer (query) | optional | Max results (default 50) |
DELETE
/v1/payouts/:id
Auth required
Cancel Payout
Cancel a payout that is still in
pending or pending_provider status. Funds are returned to the wallet.
POST
/v1/x402/verify
Auth required
Verify & Settle Token
Agent B redeems a payment token received from Agent A via the
X-AgentPay-Token header. Settles the pre-authorized payment atomically — credits Agent B's wallet. Idempotent: reuse the same token to check status without re-settling.
Scope tokens:redeem
| Field | Type | Required | Description |
|---|---|---|---|
| token | string | required | Token string from the X-AgentPay-Token header |
| request_binding | object | optional | Must match binding supplied by Agent A during authorize |
POST
/v1/x402/tokens/:id/call-started
Auth required
Mark Call Started (SLA Clock)
Agent A calls this immediately after dispatching a request to Agent B. Starts the SLA clock. If Agent B does not redeem the token within the service's
sla_timeout_ms, AgentPay automatically refunds Agent A in full (principal + fee).
Scope tokens:manage
POST
/v1/x402/tokens/:id/accepted
Auth required
Mark Provider Accepted
Agent B signals that it received and accepted Agent A's request. Records
provider_accepted_at and ensures the SLA deadline is set.
Scope tokens:redeem
POST
/v1/x402/tokens/:id/completed
Auth required
Mark Provider Completed
Agent B signals it has fulfilled the service request. Optionally submits a completion proof object (e.g. hash of output, signed receipt). Records
provider_completed_at.
Scope tokens:redeem
| Field | Type | Required | Description |
|---|---|---|---|
| proof | object (body) | optional | Completion proof — any JSON object (hash, signature, output reference) |
DELETE
/v1/x402/tokens/:id/cancel
Auth required
Cancel Token
Agent A cancels an unused issued token before it is redeemed or expires. Refunds the pre-authorized amount back to the payer wallet.
Scope tokens:manage
GET
/v1/x402/requirements/:serviceId
Public
x402 Payment Requirements
Protocol-native 402 discovery for any HTTP client. Returns the full payment flow instructions, pricing, and SLA terms for a service. Returns HTTP 402 with
WWW-Authenticate and X-Payment-Required headers — any client can self-serve the payment flow.
Session ending soon
{"activeInvitesCount":0,"registerAgentLocked":false,"registerAgentDefaultNote":"This browser flow adds one custom agent to the sandbox. Use the seeded agents for the rest of the demo path.","registerAgentLockedNote":"This sandbox already has a custom agent. Reuse it from the auth picker or start a fresh sandbox to register another.","sessionAgents":[],"bootstrapState":{"state":"pending","ready":false,"in_progress":true,"seeded_agents":0,"error":""},"sessionExpiresAt":"2026-06-05T20:59:02.864Z"}
Your sandbox expires in 10s. Finish the current step or refresh once it ends to start a new session.