canonical: https://jentic.com/apis/cashfree.com/cashfree

# Cashfree Payment Gateway API

Jentic publishes the only available OpenAPI specification for Cashfree Payment Gateway API, keeping it validated and agent-ready. Cashfree is an India-focused payment platform that handles UPI, card, net banking, and wallet payments through a single order-and-session model. The API lets merchants create orders, generate payment sessions for checkout, issue refunds, send shareable payment links, and pull settlement reports. It targets Indian e-commerce, SaaS billing, and marketplace flows where domestic payment methods and INR settlement are required.

## For AI agents

Create payment orders, generate checkout sessions, issue refunds, send payment links, and pull settlements for Indian merchants on Cashfree.

## Scope

Does not handle payouts to bank accounts, KYC onboarding, or cross-border remittance - use for Indian payment gateway order creation, refunds, links, and settlements only.

## Capabilities

- Create a Cashfree order with amount, currency, and customer details before checkout
- Generate a payment session that hands off to UPI, card, or wallet checkout flows
- Look up an order's payment status and gateway response after checkout
- Issue full or partial refunds against a completed Cashfree order
- Send a shareable payment link to a customer for ad-hoc collection
- Retrieve settlement records to reconcile payouts into the merchant bank account

## Use cases

### Indian e-commerce checkout

Indian online stores create a Cashfree order with the cart total in INR, then pass the resulting payment session ID to the Cashfree drop-in checkout. Customers pay using UPI, cards, net banking, or popular wallets, and the merchant polls GET /orders/{order_id} for the final payment status before fulfilling the order.

Example prompt: POST /orders with order_amount=1499.00, order_currency=INR, and customer_details, then POST /orders/sessions to obtain a payment session id and return it to the storefront.

### Refund handling for marketplaces

Marketplaces and D2C brands can issue full or partial refunds against an existing Cashfree order using POST /orders/{order_id}/refunds. Combined with GET /orders/{order_id} for the original payment record, this supports a full refund workflow without leaving the API, useful for return centres and CX automations.

Example prompt: POST /orders/{order_id}/refunds with refund_amount=500.00 and refund_note set to the return RMA id.

### Payment link collection

For invoice or service-business collection, sales and finance teams can use POST /links to create a payment link with a fixed amount and customer reference, then send it via SMS, email, or WhatsApp. Customers complete payment in their preferred method and the link state can be tracked back to the originating record.

Example prompt: POST /links with link_amount=2500, link_currency=INR, link_purpose='Invoice INV-204', and customer phone, then return the link_url to the user.

### Settlement reconciliation

Finance teams pull settlement batches via POST /settlements to reconcile credits hitting the merchant bank account against the orders that funded them. This closes the loop between gross payments captured and net amounts received after Cashfree's deductions.

Example prompt: POST /settlements with a date filter for last week and write each settlement record into the finance ledger keyed by settlement id.

### AI agent payments via Jentic

AI checkout or sales agents can search Jentic for 'create a payment order' and Jentic returns the Cashfree create-order operation along with the input schema. The Cashfree client id and client secret stay in your Jentic One instance, so the agent triggers a real charge without ever holding the credentials.

Example prompt: Search Jentic for 'create a Cashfree payment order', load POST /orders, and execute it with the user's cart total and contact details.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /orders | Create a payment order |
| GET | /orders/{order_id} | Fetch order status and payment details |
| POST | /orders/sessions | Create a checkout session for an order |
| POST | /orders/{order_id}/refunds | Issue a refund against an order |
| POST | /links | Create a shareable payment link |
| POST | /settlements | Retrieve settlement records |

## Key resources

- **Orders** — Create and read payment orders representing intent to collect from a customer.
- **Sessions** — Generate payment sessions that drive the actual UPI, card, or wallet checkout.
- **Refunds** — Issue full or partial refunds against completed orders.
- **Links** — Create shareable payment links for invoice or one-off collection.
- **Settlements** — Retrieve settlement batches for reconciliation against merchant bank credits.

## Why Jentic

- **Setup:** Wiring the Cashfree Payment Gateway API by hand means sending the x-client-id and x-client-secret header pair on every call and choosing the live api.cashfree.com host over the sandbox yourself. Through Jentic you install once, import the Cashfree Payment Gateway API from the API Directory, store the credential pair once, and your agent calls it.
- **Permission scoping:** Cashfree puts the order id in the URL path (/orders/{order_id}, /orders/{order_id}/refunds), so a rule can pin your agent to one order for reads and refunds. You choose the operations it may call, so order creation, payment links, and settlements are not included unless you add them.
- **Credential handling:** Your Cashfree x-client-id and x-client-secret are stored once, encrypted, by your own Jentic One instance and injected into their headers at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a payment order' or 'refund a payment', and Jentic returns the matching Cashfree operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Stripe API** — Stripe is the global alternative when Indian-domestic UPI and INR settlement are not required.
- **PayPal Orders API v2** — PayPal Orders is a cross-border alternative for order creation and capture without native UPI support.
- **Xero Accounting API** — Push Cashfree settlement records into Xero to keep accounting books aligned with payouts.

## FAQ

### Why is there no official OpenAPI spec for Cashfree Payment Gateway API?

Cashfree publishes documentation but no machine-readable OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Cashfree Payment Gateway API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

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

The Cashfree Payment Gateway API uses API key headers. Every request must include x-client-id and x-client-secret obtained from the Cashfree merchant dashboard. Through Jentic these credentials are stored encrypted in your Jentic One instance and injected at execution time, never appearing in agent prompts.

### Can I issue partial refunds with the Cashfree API?

Yes. POST /orders/{order_id}/refunds accepts a refund_amount that can be less than the original order_amount, allowing partial refunds against a captured order. You can call the endpoint multiple times until the cumulative refund equals the order amount.

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

Cashfree does not publish explicit rate limits in this OpenAPI spec; production limits depend on your merchant tier. Use the sandbox base URL https://sandbox.cashfree.com/pg for testing and contact Cashfree support for production throughput needs.

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

Run pip install jentic, search Jentic with the query 'create a Cashfree payment order', load the POST /orders schema, and execute it with order_amount, order_currency=INR, and customer_details. Jentic injects x-client-id and x-client-secret from the vault automatically.

### Does the Cashfree API support currencies other than INR?

The order endpoints accept an order_currency field, but Cashfree's primary domestic gateway is geared toward INR settlement for Indian merchants. For cross-border collection, Cashfree offers separate products outside the scope of this Payment Gateway API.

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

Yes. Jentic One is self-hosted by you, so your own rules decide which Cashfree operations the agent may call and which credentials it may use. Because the order id sits in the URL path for GET /orders/{order_id} and POST /orders/{order_id}/refunds, you can pin the agent to a single order for reads and refunds while withholding order creation, payment links via POST /links, and settlement pulls via POST /settlements unless you explicitly grant them. Your x-client-id and x-client-secret stay in your instance and are injected only for the operations you have allowed.
