Skip to content
agentsub
Esc
↑↓navigate↵open⌘Jpreview
On this page

Backend admission and delivery

Build a service integration around explicit prices, supported payment methods and idempotent fulfillment.

Publish an offer

Use the dashboard merchant portal to register your service and verify its domain before publishing offers. A free offer has a zero price. Paid offer prices use exact decimal USD strings and integer microcredits, with their credit face value shown alongside dollars.

Admit an agent to your application

Register and verify your service domain, publish a zero-price application access offer, and issue a merchant credential with access:check. Keep that credential in your backend’s secret manager.

Your application independently verifies the agent’s AgentID session for its own audience, including signature, issuer, expiry, and subject. The supported issuer is https://auth.agentid.com. Take the issuer and subject from that verified session, then call agentsub from your backend:

curl https://api.agentsub.dev/v1/access/merchant-check \
  -H "Authorization: Bearer $MERCHANT_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"offerId":"YOUR_CONFIGURED_OFFER_ID","agentIdentity":{"issuer":"https://auth.agentid.com","subject":"VERIFIED_AGENT_SUBJECT"}}'

This flow needs no second agentsub agent token and imports no upstream provider keys. The merchant credential can check only its own active offers. agentsub looks up the registered AgentID identity and applies its current freeze and service/category permissions. Unknown identities, revoked credentials, inactive offers, or denied permissions do not grant access.

Match the returned agentIdentity.issuer, agentIdentity.subject, merchantId, and offerId against your verified session and configured service. Grant access only when allowed is true and paymentRequired is false. The SDK’s AcceptorClient.checkMerchantAccess validates those response bindings. Do not trust browser-supplied decisions.

A zero-price offer can cover your whole application; your application still enforces its own resource permissions. This check performs no financial writes: it reserves or spends no credits, creates no payment request, and reveals no owner wallet balance. Do not cache a successful result as permanent authority.

For paid offers, allowed: false and paymentRequired: true describe the actual price and voucher endpoint. They prove neither payment nor subscription entitlement. Complete the separate voucher/capture and merchant fulfillment flow before granting paid access. Insufficient-credit voucher requests are not retained or automatically resumed; wallet funding is separate, followed by an agent retry.

The agent-token endpoint POST /v1/access/check remains available for agents making their own access checks. It is not required for merchant backend admission. GET /v1/me and MCP metadata advertise merchant_access_check_endpoint and merchant_access_check_scope; they expose no merchant credentials.

Challenge and verify

Return a 402 payment challenge when payment authority is missing. List only the payment methods actually implemented and accepted by the offer. Verify the signed voucher against the issuer JWKS, audience, agent, offer, maximum amount and expiry before delivery.

Capture once

Capture the authorized amount with a stable idempotency key. Retries must not double-charge or double-deliver. The workspace SDK exposes AcceptorClient capture and release helpers; service delivery requires verified spending authority and configured provider access.

SDK · Gateway API · Payment methods.

Signed delivery notifications

A verified merchant owner can configure an enabled HTTPS receiver on the merchant domain or a subdomain. The actual webhook contract describes redemption.captured and redemption.released notifications, their ACS-Signature header, stable event IDs, retry budget, and actual receipt logs. Configuration does not establish successful delivery; no historical events are backfilled. Verify the exact raw request body with the one-time webhook secret and deduplicate eventId before side effects. Delivery is at least once and can arrive out of order. Use the merchant portal to inspect actual pending, queued, delivered, or failed attempts.