> ## Documentation Index
> Fetch the complete documentation index at: https://docs.asva-ai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Razorpay Agentic Payments: UCP and ACP Integration

> Connect Razorpay Agentic Payments to your UCP and ACP checkout endpoints — UPI mandate setup, payment execution, India compliance, and test mode.

[Razorpay Agentic Payments](https://razorpay.com/m/agentic-payments/) is India's first AI-powered conversational payment solution. It sits behind your UCP and ACP checkout endpoints as the payment execution layer — customers authorise a spending limit once upfront, and subsequent AI-initiated payments within that limit complete without a PIN or redirect. This makes it the right PSP choice for any Indian merchant implementing agentic commerce.

## How Razorpay fits UCP and ACP

The payment flow is the same whether the session originates from Google AI Mode (UCP) or ChatGPT (ACP) — your backend calls Razorpay after the protocol layer confirms the purchase:

```
AI Agent
  │
  ├─ UCP: POST /ucp/checkout        (creates cart)
  ├─ ACP: POST /acp/checkout/complete  (confirms purchase)
  │             │
  │             └─ Your backend calls Razorpay
  │                  └─ UPI / Razorpay Agentic Payments processes payment
  │
  └─ Order confirmed
```

**For UCP flows (Google AI Mode):** When an agent initiates checkout via your UCP endpoint, your backend calls Razorpay's agentic API using the customer's pre-authorised UPI mandate.

**For ACP flows (ChatGPT):** When the `confirm_purchase` tool fires, your backend triggers a Razorpay Agentic Payment within the customer's authorised limit — no additional PIN required.

***

## End-to-end integration

<Steps>
  <Step title="Sign up for access and check eligibility">
    Razorpay Agentic Payments is currently available to Indian merchants through an early-access programme.

    * Confirm your use case: in-merchant app assistants or conversational commerce (for example, a grocery app with an AI assistant)
    * Sign up at [razorpay.com/m/agentic-payments](https://razorpay.com/m/agentic-payments/)
    * Review Razorpay's API documentation once access is granted
    * Ensure your product feed and checkout endpoints are agent-ready — see [Feed Specs](/guides/feed-specs) and [UCP Getting Started](/ucp/getting-started)
  </Step>

  <Step title="Implement one-time authorisation (UPI mandate)">
    When a customer opts into AI-assisted shopping, prompt them to authorise a spending limit. This creates a UPI mandate that your backend stores and reuses for subsequent AI-initiated payments.

    ```javascript theme={null}
    // Create a UPI mandate / authorisation
    const mandate = await razorpay.recurringPayments.createMandate({
      type: 'upi',
      max_amount: 500000, // ₹5,000 in paise
      description: 'AI Shopping Assistant — authorise up to ₹5,000',
      customer_id: customer.razorpay_id,
      notify: { sms: true }
    })

    // Store mandate.id against the customer for reuse
    await db.customers.update(customer.id, { razorpay_mandate_id: mandate.id })
    ```

    Surface clear consent language to the user at this step:

    * What they are authorising
    * The maximum spend limit
    * How to view and revoke the mandate
  </Step>

  <Step title="Execute payment in your checkout handler">
    When the AI initiates a payment within the authorised scope, look up the customer's mandate and call Razorpay:

    ```javascript theme={null}
    // POST /ucp/checkout/:id/confirm  or  POST /acp/checkout/:id/complete
    async function completeCheckout(checkout, customer) {
      const mandate = await db.customers.getMandateId(customer.id)

      if (!mandate) {
        // Customer hasn't authorised — require a payment method
        return { error: { code: 'no_mandate', message: 'Please authorise AI shopping first.' } }
      }

      // Execute payment via mandate
      const payment = await razorpay.payments.createWithMandate({
        mandate_id: mandate,
        amount: checkout.total_paise,
        currency: 'INR',
        description: `Order ${checkout.id}`,
        notes: { checkout_id: checkout.id }
      })

      return { order_id: checkout.id, payment_id: payment.id, status: 'confirmed' }
    }
    ```

    <Warning>
      Never execute a payment above the customer's authorised limit. Validate `checkout.total_paise <= mandate.remaining_limit` before calling Razorpay.
    </Warning>
  </Step>

  <Step title="Payment token flow">
    The payment token (mandate ID) ties the customer to their authorised spending limit across sessions. Store it securely server-side and never expose it to the client.

    | Token field  | Where it comes from                | How long it lasts             |
    | ------------ | ---------------------------------- | ----------------------------- |
    | `mandate.id` | Razorpay mandate creation response | Until the customer revokes it |
    | `payment.id` | Each individual payment execution  | Per-transaction reference     |

    When a mandate is revoked or expires, clear it from your database and prompt the customer to re-authorise the next time they use AI checkout.
  </Step>

  <Step title="Trust, compliance, and India-specific considerations">
    Razorpay is an RBI-authorised payment aggregator. Your integration must comply with both Razorpay's terms and RBI guidelines for payment aggregators and UPI:

    * Surface clear consent and limit controls to the user at authorisation time
    * Provide a real-time view of spending against the limit
    * Allow instant limit changes and revocation
    * Follow Razorpay's and RBI's guidelines for payment aggregators and UPI

    All amounts must be in **paise** (INR × 100). `₹5,000` = `500000` paise. Do not mix decimal rupee values with the paise field.
  </Step>

  <Step title="Test mode setup">
    Test the full authorisation and payment flow in Razorpay's sandbox before going live:

    ```bash theme={null}
    # Test mandate creation in sandbox
    curl -X POST https://api.razorpay.com/v1/payments/create/upi \
      -u $RAZORPAY_KEY_TEST:$RAZORPAY_SECRET_TEST \
      -H "Content-Type: application/json" \
      -d '{"amount": 10000, "currency": "INR", "method": "upi"}'
    ```

    Use Razorpay's test UPI IDs (`success@razorpay`, `failure@razorpay`) to simulate authorisation and payment outcomes. Run a full Asva Readiness Score after your sandbox integration is complete:

    ```bash theme={null}
    curl -X POST https://asva-ai.com/api/audit \
      -H "Authorization: Bearer $ASVA_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"domain": "yourstore.com"}'
    ```

    Go live per Razorpay's launch process, then monitor these metrics:

    * **Authorisation rate** — percentage of customers who set a mandate
    * **Payment success rate** — percentage of AI-initiated payments that complete
    * **Average time to complete** — target under 3 seconds
  </Step>
</Steps>

***

## Use cases

| Use case             | Example                                                       |
| -------------------- | ------------------------------------------------------------- |
| Grocery ordering     | "Order my usual basket" via a grocery app's AI assistant      |
| Subscription reorder | "Reorder my protein powder" — payment executes within mandate |
| Event ticketing      | "Book 2 tickets for Friday" — single-tap confirmation         |
| Food delivery        | In-app AI assistant completes reorder without PIN             |

<Tip>
  Razorpay Agentic Payments is particularly well-suited to repeat-purchase categories — grocery, subscriptions, and food delivery — where the customer's basket is predictable and the mandate limit covers a typical weekly spend.
</Tip>

***

## Related

* [ACP Getting Started](/acp/getting-started) — ACP endpoints for ChatGPT
* [UCP Checkout and Payments](/ucp/checkout-and-payments) — UCP payment integration
* [Feed Specs](/guides/feed-specs) — product feed requirements
* [Razorpay Agentic Payments (official)](https://razorpay.com/m/agentic-payments/)
