canonical: https://jentic.com/apis/juspay.in/juspay

# Juspay In Juspay Payment Gateway API

The Juspay Payment Gateway API runs session-based payment flows, orders, transactions, and refunds for the Juspay payment orchestration platform. A checkout starts by creating a payment session and an order, initiating a transaction, and then reading the order status to confirm the result. Refunds are created against an order, and saved payment methods for a customer are listed or deleted so returning shoppers can reuse a stored instrument.

## For AI agents

Create Juspay payment sessions and orders, initiate transactions, read order status, issue refunds, and manage a customer's saved payment methods through the Juspay payment orchestration API.

## Scope

Does not handle accounting, payroll, or fraud scoring. Use for Juspay payment sessions, orders, transactions, and refunds only.

## Capabilities

- Create a payment session to start a checkout
- Create an order and read its payment status
- Initiate a transaction against an order
- Create a refund on an order
- List and delete a customer's saved payment methods
- Retrieve the payment methods available for a checkout

## Use cases

### Agent-Driven Checkout

An AI agent connected through Jentic runs a checkout by creating a payment session, creating the order, initiating the transaction, and polling the order status until it settles. Because the session, order, and transaction operations chain in sequence, the agent completes a payment flow without a human stepping through the gateway.

Example prompt: Create a payment session and order, initiate the transaction, then poll the order status until it is paid

### Refund Processing

Support teams handling returns issue refunds against an order. The Juspay refunds operation creates a refund on an order id, so an agent processes a return and then reads the order status to confirm the refund was applied.

Example prompt: Create a refund on an order and read the order status to confirm the refund was applied

### Saved Payment Method Management

Returning shoppers reuse stored instruments. Juspay lists a customer's saved payment methods and deletes one by id, so an agent presents the saved instruments at checkout and removes an expired card on request.

Example prompt: List a customer's saved payment methods and delete a specific one by its payment method id

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/session` | Create a payment session |
| POST | `/orders` | Create an order |
| GET | `/orders/{order_id}` | Get order status |
| POST | `/txns` | Initiate a transaction |
| POST | `/orders/{order_id}/refunds` | Create a refund on an order |
| GET | `/payment_methods` | Get available payment methods |
| GET | `/customers/{customer_id}/payment_methods` | List a customer's saved payment methods |

## Key resources

- **Sessions** — Create a payment session to start a checkout
- **Orders** — Create an order and read its payment status
- **Transactions** — Initiate a transaction against an order
- **Refunds** — Create a refund on an order
- **Payment methods** — List and delete a customer's saved payment methods and list available methods

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 40 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 100 / 100
  - Developer Experience & Jentic Compatibility: 63 / 100
  - AI-Readiness & Agent Experience: 48 / 100
  - Agent Usability: 94 / 100
  - Security: 10 / 100
  - AI Discoverability: 88 / 100
- **View full report:** https://jentic.com/apis/juspay.in/juspay/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Juspay by hand means Base64-encoding your API key for basic auth, choosing the production or sandbox host, and chaining the session, order, and transaction calls yourself. Through Jentic you install once, import the Juspay Payment Gateway API from the API Directory, store the key once, and your agent calls the checkout and refund operations.
- **Permission scoping:** Juspay carries session, order, and transaction operations alongside refunds and saved-payment-method deletion. You choose the operations your agent may call, so a rule can keep it to creating orders and reading their status and leave refunds or payment-method deletion out unless you add them.
- **Credential handling:** Your Juspay API key is held by your own Jentic One instance, encrypted, and injected into the basic-auth header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a payment order' or 'issue a refund', and Jentic returns the matching Juspay operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Cashfree Payment Gateway API** — Cashfree is an Indian payment gateway, a direct alternative to Juspay for orders, payments, and refunds.
- **Checkout.com Payment Platform API** — Checkout.com is a global payment platform, an alternative to Juspay for merchants outside India.
- **FreeCurrencyAPI** — FreeCurrencyAPI converts amounts between currencies to price an order before Juspay charges it.

## FAQ

### What authentication does the Juspay Payment Gateway API use?

The API uses HTTP basic authentication: your Juspay API key is Base64-encoded as the username with an empty password, per its OpenAPI spec. Through Jentic the key is held by your own Jentic One instance and attached to each request at execution time, so it never appears in your agent's prompt or logs.

### Can I create orders and process refunds with the Juspay Payment Gateway API?

Yes. You create a payment session and an order, initiate a transaction, and read the order status, and you create a refund against an order id. Your agent runs the full checkout and refund flow through these operations.

### What are the rate limits for the Juspay Payment Gateway API?

The OpenAPI spec does not specify rate limits. Check the Juspay documentation at https://juspay.io/in/docs for current limits before running high-volume checkout traffic.

### Is there a Juspay MCP server?

You do not need an MCP server to give your agent the Juspay Payment Gateway API. Jentic connects it directly from the API Directory: import it, store your key once, and your agent calls the session, order, and refund operations on demand without loading an extra server's tool definitions into its context.

### Can I limit what my agent is allowed to do with the Juspay Payment Gateway API?

Yes. Write a rule that allows only the order-create and order-status operations, so the agent can create orders and check their status and cannot issue refunds or delete saved payment methods. You choose which operations it may call, and every call it makes is logged.

### How do I create a payment order through Jentic?

Install the Jentic One command line with `curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | sh`, then add the Juspay Payment Gateway API from the Jentic directory and search by intent such as 'create a payment order'. Jentic returns the matching operation with its input schema so your agent builds a valid request. To run it on your own infrastructure, install Jentic One from its GitHub repo.
