QUICKSTART
Verify signed authority before payment execution.
const result = await fetch(
"https://mandateshield.com/api/v2/verify",
{
method: "POST",
headers: {
"content-type": "application/json",
"authorization": "Bearer ms_live_..."
},
body: JSON.stringify({
envelope: purchaseEnvelope,
evidence: signedAuthority
})
}
).then(response => response.json())
if (
result.assurance.status !== "VERIFIED" ||
result.decision !== "ALLOW"
) {
throw new Error("Payment blocked by MandateShield")
}
await charge()
store(result.signed_receipt.compact)STRICT V2 PROFILE
Verify the proof, not a protocol label.
Send compact JWS, AP2 SD-JWT or a TAP-style HTTP message signature under `evidence`. The signature must be current and bound to the evaluated purchase through AP2 payment claims, TAP authority/path components or the canonical `mandateshield_input_digest`. Missing or mismatched evidence fails closed. The API verifies against the supplied JWK; production callers must pin that key or resolve it through their AP2/TAP issuer trust registry.
{
"envelope": { "...": "the final purchase facts" },
"evidence": {
"format": "jws",
"compact": "eyJhbGciOiJFUzI1NiIs...",
"public_key": { "kty": "EC", "crv": "P-256", "...": "..." },
"expected_audience": "merchant_checkout",
"expected_nonce": "fresh_challenge"
}
}REQUEST
A protocol-neutral purchase envelope.
MandateShield accepts normalized fields from AP2, TAP, UCP, x402, ACP or a custom signed envelope. Never send card numbers, bank credentials, private keys or personal shopping data.
{
"protocol": "AP2",
"mandate_id": "mnd_2048",
"agent_id": "agent_travel_07",
"merchant_id": "merchant_rail",
"amount": { "value": 124.90, "currency": "USD" },
"limits": {
"max_amount": 150,
"currencies": ["USD"],
"merchants": ["merchant_rail"]
},
"created_at": "2026-07-24T18:50:00Z",
"expires_at": "2026-07-24T19:00:00Z",
"idempotency_key": "order_9f22a1",
"intent_hash": "sha256:...",
"user_consent": true,
"credential_binding": "tap:merchant_rail:agent_travel_07"
}RESPONSE
ALLOW, REVIEW or BLOCK.
Every response includes machine-readable findings, a CLEAR to CRITICAL risk level, budget headroom, the value blocked at the boundary, a recommended next action and a SHA-256 receipt hash. Strict v2 responses additionally include cryptographic assurance metadata and an ES256-signed portable receipt. Verify it through `POST /api/v2/receipts/verify` or the public `/.well-known/jwks.json`. `ALLOW` means the supplied facts passed the configured controls; it is not a guarantee that a transaction is legitimate.
AUTHENTICATION
Bearer keys with test and live modes.
Create and revoke keys in the dashboard. A key is shown once, stored only as a SHA-256 hash and can be revoked without changing other integrations.
HIGH-VOLUME BATCH
Evaluate up to 25 purchases in one request.
Send the same envelopes to `POST /api/v1/batch` as a JSON array or under a `purchases` property. Every item keeps its own decision, receipt, replay protection and usage record; the response adds an ALLOW, REVIEW, BLOCK and error summary.
REPLAY PROTECTION
One decision per idempotency key.
Live and test keys persist each decision. Reusing the same idempotency key with a key returns HTTP 409 and `REPLAY_DETECTED`. Generate a new key only for a genuinely new payment attempt.
HTTP STATUS
Errors fail closed.
200Decision completed400Invalid JSON or envelope401Invalid or revoked API key402Production access paused409Replay blocked429Sandbox limit reached