ACP v2026-04-17 Spec|Track 01
Payment rail: Razorpay

ACP-Compliant Checkout Rail for Autonomous AI Buyer Agents

Translates raw autonomous AI agent purchasing intents into bounded, gated, and auditable orders on the Razorpay rail. Enforcing server-authoritative catalog pricing, deterministic guardrails, 30-min inventory soft-holds, and zero-hallucination checkouts.

Live DashboardSandbox
Server Catalog Authority
30m TTL Stock Mutex
Deterministic FSM Gating
BRIDGE_KERNEL: ACTIVE
ACP // DETERMINISTIC RAILS
4 NODES CONNECTED/MUTEX LOCKED
PARALLAX ROTATION ENABLED
01 // TEST SUITE
91 / 91
100% Pytest Pass Rate
02 // GUARDRAIL CEILING
Max 50%
Rs 50,000 Order Limit
03 // INVENTORY HOLD
30-Min TTL
Automated Sweeper Release
04 // GATEWAY SECURITY
HMAC-SHA256
Inbound and Outbound Rails
Architectural Rationale

The Vulnerability in Direct Agentic Payments

Giving autonomous buyer agents direct API keys to merchant payment gateways exposes balance sheets to prompt injections, cart hallucinations, and race conditions. AgentPay Bridge installs an immutable verification layer between agent intents and money movement.

Direct Gateway Integration (Unprotected)
AgentPay Bridge Adapter (Protected)
[-] Price Tampering and Hallucinations

Autonomous agents inject arbitrary client prices (e.g. Rs 1 for a Rs 4,999 SKU). Gateways lacking catalog authority blindly charge the requested amount without cross-referencing inventory databases.

Server-Authoritative Catalog Slabs

Client unit prices are strictly discarded. Catalog lookups and Indian GST slabs (12%, 18%, 28%) are calculated deterministically on the server with proportional discount allocation.

[-] Unbounded Financial Exposure

Prompt-injected or looping agents can execute excessive bulk purchases or stack unverified promotions beyond merchant risk tolerances.

Deterministic Rule Engine and Anomaly Scoring

Hard merchant limits (max 50% discount, Rs 50,000 order total, 10 units/SKU) and sliding-window anomaly velocity checks hard-block malicious transactions before session completion.

[-] Inventory Race Conditions and Phantom Locks

Multi-turn agent negotiations double-book scarce stock, or abandon checkout sessions mid-flow leaving merchandise locked indefinitely.

30-Minute TTL Reservations and Sweeper

Sessions soft-hold stock during negotiation. Uncompleted sessions automatically expire after 30 minutes, and a dedicated sweeper safely returns inventory to stock.

[-] Zero Explainable Operator Auditability

Rejected sessions and price corrections vanish into unformatted log streams, preventing human merchants from auditing automated agent behavior.

Immutable Structured Firestore Audit Trail

Every state mutation, agent identity, rejection reason, and before/after cart total is written immutably to Firestore and viewable in real time.

Core Technical Pillars

Engineered for Protocol Precision and Safety

Dual-engineered for AI developers building standardized ACP agent clients and merchants demanding bulletproof balance-sheet protection.

01pricing.py // GST Slabs

Server-Authoritative Pricing and Indian Tax Slabs

Client-submitted unit prices are ignored. The adapter queries the server catalog for authoritative prices and executes Indian GST slab calculations (12%, 18%, 28%) with proportional pre-tax discount allocation, ensuring zero paise drift across multi-item orders.

ALGORITHM: PROPORTIONAL TAX SPREADDETERMINISTIC
02guardrails.py // Non-LLM

Deterministic Guardrails and Anomaly Engine

Hard mathematical ceilings (Max 50% discount, Rs 50,000 order total, 10 units/SKU). A sliding-window anomaly scoring engine tracks agent velocity to prevent abusive flash-buying without relying on unpredictable LLM evaluators.

LATENCY: ZERO LLM HOPS< 2MS EVALUATION
03inventory.py // 30m TTL

Soft-Hold Inventory and Expiry Sweeper

Stock is soft-reserved upon checkout session creation to prevent double-booking. Sessions not completed within 30 minutes expire automatically, triggering the sweeper endpoint to safely release merchandise back to available inventory.

TTL: 1800 SECONDSAUTOMATED RESTOCK
04webhooks.py // DeadLetter

Cryptographic Rails and Reliable Webhooks

Inbound Razorpay webhooks are verified with HMAC-SHA256 constant-time signature comparison. Outbound webhook events dispatch to agent listeners with exponential backoff retries and dead-letter queue logging on delivery failures.

SECURITY: HMAC-SHA256IDEMPOTENT RAILS
Protocol Sandbox Simulator

Simulate Autonomous Buyer Scenarios

Experience live checkout session state transitions, price-tampering defense, discount ceiling enforcement, and TTL sweeper mechanics directly from the adapter's test suite.

ACP

Protocol Sandbox Simulator

Simulate autonomous buyer transactions against the payment rail

STAGE 2 // FULL COMPLETIONPOST /checkout_sessions/cs_e44bcc71/complete

Standard Autonomous Checkout Flow

Autonomous buyer agent negotiates 2 items, applies valid promotional discount, attaches tokenized payment method (pm_tok_*), and bridges to Razorpay Orders API.

HTTP_RESPONSESTATUS 200 OK
{
  "id": "cs_e44bcc7178a943f8",
  "status": "completed",
  "line_items": [
    {
      "product_id": "prod_bolt_001",
      "quantity": 2,
      "unit_price": 499,
      "tax_rate": 0.18
    },
    {
      "product_id": "prod_bolt_004",
      "quantity": 1,
      "unit_price": 2499,
      "tax_rate": 0.18
    }
  ],
  "totals": {
    "subtotal": 3497,
    "discount": 100,
    "tax": 611.46,
    "total": 4008.46,
    "currency": "INR",
    "tax_breakdown": [
      {
        "rate": 0.18,
        "subtotal": 3397,
        "tax": 611.46
      }
    ]
  },
  "payment_provider": {
    "provider": "razorpay",
    "razorpay_order_id": "order_TXqxPXnQFo5pt2"
  },
  "is_anomalous": false,
  "anomaly_score": 0
}
Session Lifecycle Architecture

Deterministic Finite State Machine (FSM)

Checkout sessions transition strictly through deterministic states. Completed, rejected, refunded, and cancelled states are terminal and cryptographically locked against further mutations.

Linear Happy Path:01 ▶ 02 ▶ 03 ▶ 04
STATE 01created

Cart Initialized

Authoritative totals calculated. 30-min TTL timestamp assigned. Soft-hold inventory reserved.

✦ Stock soft-locked
STATE 02updated

Negotiation & Patching

Agent modifies item quantities or applies coupon codes. Guardrail bounds re-evaluated on each turn.

✦ Bounds re-checked
STATE 03ready_for_payment

Delegated Token Attached

Full shipping address provided. Agent attaches delegated token (pm_tok_*).

✦ Address locked
STATE 04completed

Razorpay Order Settled

Inventory committed. Razorpay order created (order_*). Immutable audit entry written.

✓ Settled on Razorpay
TERMINAL: rejected

Triggered on guardrail breach (discount > 50%, total > Rs 50k, qty > 10). Session locked and unpayable.

TERMINAL: cancelled

Triggered by explicit agent cancellation or 30-min TTL expiry sweep. Soft-held stock returned to available catalog.

TERMINAL: refunded

Post-payment reversal calling Razorpay Refund API. Locks session into audited refunded state.

Architecture & Protocol Design

Engineered for Absolute Determinism

Autonomous agents require mathematically predictable boundaries. Explore the full three-zone runtime topology and the seven-state deterministic checkout FSM.

THREE-ZONE RUNTIME

System Topology & Component Interactions

System Topology & Component Interactions
Click to view 100% resolution
Overview

End-to-end data flow bridging autonomous AI buyer agents through the AgentPay Bridge internal engine matrix into Razorpay settlement rails and Google Cloud Firestore.

Architectural Guarantees
  • >Discovery & Catalog: GET /.well-known/agent.json and GET /products
  • >Authoritative pricing invariant to client prompt injection
  • >Deterministic guardrails: 50% discount ceiling, Rs 50k order cap, 10 units/SKU
  • >30-minute stock soft-hold mutex with automated TTL sweeper
  • >Cryptographic Razorpay webhook verification and append-only audit stream
Developer Quickstart

Integrate with Any Autonomous Buyer Agent

Standardized HTTP endpoints matching Agentic Commerce Protocol v2026-04-17. Compatible with LangChain, AutoGen, CrewAI, or standalone custom buyer scripts.

# 1. Register Autonomous Buyer Agent
curl -X POST https://razorpay-acp-adapter-922729192321.asia-south1.run.app/agents/register \
  -H "Content-Type: application/json" \
  -d '{"name": "Aura Autonomous Buyer Agent #42"}'

# 2. Discover ACP Capability Manifest and Search Catalog
curl https://razorpay-acp-adapter-922729192321.asia-south1.run.app/.well-known/agent.json
curl "https://razorpay-acp-adapter-922729192321.asia-south1.run.app/products?category=general&in_stock_only=true"

# 3. Create Checkout Session with Authoritative Pricing
curl -X POST https://razorpay-acp-adapter-922729192321.asia-south1.run.app/checkout_sessions \
  -H "X-API-Key: acp_agent_8f0a394bc..." \
  -H "Idempotency-Key: idemp_9428591a" \
  -H "Content-Type: application/json" \
  -d '{
    "line_items": [{"product_id": "prod_bolt_001", "quantity": 2}],
    "buyer": {"name": "Aura Agent", "email": "aura@buyer.internal"}
  }'

Inspect Live Autonomous Transactions

Open the live audit dashboard to observe autonomous buyer agents negotiate carts, trigger deterministic guardrails, and bridge transactions into Razorpay orders.