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

Mint an ACS voucher (hold)

Creates a microcredit hold for the offer and returns a signed ES256 voucher JWT bound to the offer and hold id (jti). maxUc limits the hold amount.

POST/v1/vouchers
Authorization
AuthorizationBearer token (JWT) · headerrequired

Verified AgentID agent JWT (iss https://auth.agentid.com) or an AgentSub OAuth access token (typ at+jwt, iss https://api.agentsub.dev, scope agentsub:agent). The agent's human owner must exist in Clerk with the same verified email.

Header parameters
Idempotency-Keystringrequired

Reuse for the same operation and payload; payload changes conflict

min length 1 · max length 255
Request body
requiredapplication/json
offerIdstringrequired
maxUcMicrocredits

Integer microcredits as a decimal string. 1 credit = 1,000,000 microcredits = $0.01 USD.

matches ^[0-9]+$
maxAmountMicrocredits

Integer microcredits as a decimal string. 1 credit = 1,000,000 microcredits = $0.01 USD.

matches ^[0-9]+$
Any of:
any
any
any
any
Responses
200

Voucher minted

voucherstringrequired
redemptionHoldrequired
Show properties
idstring
agentIdstring
acceptorIdstring
offerIdstring
categorystring
amountUcMicrocredits

Integer microcredits as a decimal string. 1 credit = 1,000,000 microcredits = $0.01 USD.

matches ^[0-9]+$
statestring
Allowed:heldcapturedreleasedexpired
expiresAtinteger
createdAtinteger
capturedUcMicrocredits

Integer microcredits as a decimal string. 1 credit = 1,000,000 microcredits = $0.01 USD.

matches ^[0-9]+$
allocationsobject[]
Show properties
Array of object
lotIdstring
amountUcMicrocredits

Integer microcredits as a decimal string. 1 credit = 1,000,000 microcredits = $0.01 USD.

matches ^[0-9]+$
400

invalid_input problem

typestringrequired
titlestringrequired
statusintegerrequired
codestringrequired
401

unauthorized problem; live 401s advertise WWW-Authenticate: Bearer resource_metadata=...

typestringrequired
titlestringrequired
statusintegerrequired
codestringrequired
402

INSUFFICIENT_CREDITS or CAP_EXCEEDED problem

typestringrequired
titlestringrequired
statusintegerrequired
codestringrequired
403

Identity, ownership, scope or policy denied (human_required, owner_claim_required, scope_required, FROZEN, CAP_EXCEEDED, SCOPE_FORBIDDEN)

typestringrequired
titlestringrequired
statusintegerrequired
codestringrequired
503

Runtime or provider configuration unavailable (runtime_configuration_required, signing_configuration_required, runtime_unavailable, workspace_unavailable, provider_configuration_required)

typestringrequired
titlestringrequired
statusintegerrequired
codestringrequired
Request
curl -X POST 'https://api.agentsub.dev/v1/vouchers' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Idempotency-Key: string' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "offerId": "string",
  "maxUc": "string",
  "maxAmount": "string"
}'
Response
{
  "voucher": "string",
  "redemption": {
    "id": "string",
    "agentId": "string",
    "acceptorId": "string",
    "offerId": "string",
    "category": "string",
    "amountUc": "string",
    "state": "held",
    "expiresAt": 0,
    "createdAt": 0,
    "capturedUc": "string",
    "allocations": [
      {
        "lotId": "string",
        "amountUc": "string"
      }
    ]
  }
}