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
- A shopping agent sends its intent token with the order, bound to the cart's hash.
- Your checkout checks the token: offline against the published keys, then with the free
POST /v1/verifyfor revocation, or with your key onPOST /v1/authorize/verificationsfor how the person approved. - You accept the order when the token is valid and binds your own record of the cart.
- The agent's ordercart + intent token
- Your checkoutkeys, binding, revocation
- Your decisionaccept, ask, or send to bot rules
Key objects
Each object links to its API reference.
| Object | What it is | Where you get it |
|---|---|---|
| Intent token | An 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 result | The free check: signature, expiry, revocation and the token's free claims | POST / |
| Verification | The paid check: the same, your checkout rules, and how the person approved | POST / |
| Checkout approval | A cart your customer approves with a passkey (guide) | POST / |
| Deal | A signed offer accepted by another company's agent (concept) | POST / |
| Tab | A running balance for pay-per-call usage (guide) | POST / |
Core endpoints
| Endpoint | Use it to |
|---|---|
POST / | Check any token, grant or receipt for free, with no key. |
POST / | Check a token with your checkout rules and read how the person approved. |
POST / | Ask the shopper, or your own customer, to approve a cart. |
POST / | Accept a signed offer from another agent. |
POST / | Open 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\"}"
import { Provenance } from "@provenanceauth/sdk";
const prov = new Provenance({ baseUrl: process.env.PROVENANCE_API });
const result = await prov.verify({ token: intentToken });
console.log(result.valid, result.revoked);
import os
from provenanceauth import Provenance
prov = Provenance(base_url=os.environ["PROVENANCE_API"])
result = prov.verify(token=intent_token)
print(result["valid"], result["revoked"])
{
"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.