View as Markdown

Authorize · Overview

Authorize

Authorize is for merchants and card issuers. It checks the signed approval an AI agent brings with an order, so you know a person approved that exact cart.

Merchants also use it to ask their own customer to approve a cart, and to trade with other agents under signed terms. Issuers read the same approval when it arrives on an agent payment, and set their own rules for agent purchases with issuer agent controls.

When to use it

  • Accept an order from a shopping agent only when a person approved that exact cart.
  • Ask your own customer to approve an agent's cart with a passkey before you ship it.
  • Check, as a card issuer, that a person approved an agent's purchase before you authorize the payment.
  • Sell to other companies' agents under a signed offer, or charge per call with a tab.

How it works

  1. A shopping agent sends its intent token with the order, bound to the cart's hash.
  2. Your checkout checks the token: offline against the published keys, then with the free POST /v1/verify for revocation, or with your key on POST /v1/authorize/verifications for how the person approved.
  3. You accept the order when the token is valid and binds your own record of the cart.
  1. The agent's order
    cart + intent token
  2. Your checkout
    keys, binding, revocation
  3. Your decision
    accept, ask, or send to bot rules

Key objects

Each object links to its API reference.

ObjectWhat it isWhere you get it
Intent tokenAn ES256 JWT bound to the hash of the exact action a person approved (how to verify one)The agent sends it with the order
Verification resultThe free check: signature, expiry, revocation and the token's free claimsPOST /v1/verify
VerificationThe paid check: the same, your checkout rules, and how the person approvedPOST /v1/authorize/verifications
Checkout approvalA cart your customer approves with a passkey (guide)POST /v1/authorize/checkout_approvals
DealA signed offer accepted by another company's agent (concept)POST /v1/authorize/deals
TabA running balance for pay-per-call usage (guide)POST /v1/authorize/tabs

Core endpoints

EndpointUse it to
POST /v1/verifyCheck any token, grant or receipt for free, with no key.
POST /v1/authorize/verificationsCheck a token with your checkout rules and read how the person approved.
POST /v1/authorize/checkout_approvalsAsk the shopper, or your own customer, to approve a cart.
POST /v1/authorize/dealsAccept a signed offer from another agent.
POST /v1/authorize/tabsOpen a tab for pay-per-call usage.

Your first call

Check a token with the free verify. It needs no key. In the sandbox, mint a test token first.

export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe

INTENT_TOKEN=$(curl -s $PROVENANCE_API/v1/mandate/intents \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action_description":"Buy order ord_1042 at harborbean.example","action_payload":{"order_id":"ord_1042","total":2400,"currency":"usd"},"agent_session_id":"sess_overview_2","device_id":"dev_00000000000000000000000000000001"}' \
  | jq -r .intent_token)

curl -s -X POST $PROVENANCE_API/v1/verify \
  -H "Content-Type: application/json" \
  -d "{\"token\":\"$INTENT_TOKEN\"}"
{
  "object": "verification_result",
  "valid": true,
  "reason": null,
  "kind": "intent",
  "binding": "not_checked",
  "revoked": false
}

The checkout guide checks the binding against your own record of the order.

Next steps