Create Order

Create an order from with Cashfree from your backend

To process any payment on Cashfree PG, the merchant needs to create an order in the cashfree system. This order must be created from your backend (as it uses your secret key). On successful creation of the order, you will receive a payment link which can be used to process payments from anywhere.

Curl Request

Following is a sample curl request that can be used.

curl  --request POST \
 --url \
 --header 'Content-Type: application/json' \
 --header 'x-api-version: <<x-api-version>>' \
 --header 'x-client-id: <App ID>' \
 --header 'x-client-secret: <Secret Key>' \
 --data '{
  "order_id": "order_1626945143520",
  "order_amount": 10.12,
  "order_currency": "INR",
  "order_note": "Additional order info"
  "customer_details": {
   "customer_id": "12345",
    "customer_name": "name",
    "customer_email": "[email protected]",
    "customer_phone": "9816512345"
  "cf_order_id": 1539553,
  "created_at": "2021-07-19T16:13:35+05:30",
  "customer_details": {
    "customer_id": "7112AAA812234",
    "customer_name": null,
    "customer_email": "[email protected]",
    "customer_phone": "9908734801"
  "entity": "order",
  "order_amount": 5.01,
  "order_currency": "INR",
  "order_expiry_time": "2021-08-18T16:13:34+05:30",
  "order_id": "order_271vWwzSQOHe01ZVXpEcguVxQSRqr",
  "order_meta": {
    "return_url": "{order_id}&order_token={order_token}",
    "notify_url": "",
    "payment_methods": null
  "order_note": null,
  "order_status": "PAID",
  "order_token": "BtJEHHxOB9bFpNsaHmEL",
  "payment_link": "",
  "payments": {
    "url": ""
  "refunds": {
    "url": ""
  "settlements": {
    "url": ""






string optional (min 3, max 50, alphanumeric with _ and -)

Order identifier for your system.



float required (provide in two decimal places)

Order amount.

101.12 (INR 101.12 implies
rupees 100 and 12 paisa)


string required

Valid order currency. We use the ISO 4217 currency list.



object required

This is a custom object which contains customer_details

See below for details of this object


object optional

This is a custom object which contains information about available payment modes for this order, webhook url and notify url.

See below for details of this object.


string optional

Order related extra detail

There are two objects in the above payload which require some more context - customer_details and order_meta

Customer Details

The customer details are required for risk checks and in providing a seamless experience to repeat customers.





string required (alphanumeric with - and _ allowed)

This is is the identifier for the customer in your system. (Example - customer1234)


string required (Special characters are not allowed)

Name of your customer.


string required Email id of the customer

[email protected]


string required Phone of the customer

Please provide valid 10 digit phone numbers.

Order Meta

The meta object can be used to control the payment behaviour. You can customize the payment options available to the customer for this order and also configure the webhook endpoint.





string optional

This is the return url for redirection based payments. When a customer makes a card payment they are redirected from your website to the bank's OTP page. From there the customer is redirected back to your The return_url must contain two placeholders {order_id} and {order_token}. When redirecting the customer back to the return url from the bank’s OTP page, Cashfree will replace these placeholders with the actual values for that order.

Example - Let's say you provide a return url like{order_id}&cf_token={order_token}
when the customer is getting back to your page from the bank's OTP page. We will hit the following url -

Only https url allowed in production. http is allowed only in sandbox


string optional

The webhook url is required to get successful or failed webhooks after a payment on an order is completed.

Only https url allowed in production. http is allowed only in sandbox


string optional

List of payment modes. Use the following values - cc, dc, ccc, ppc, nb, upi, paypal, emi, app paylater.

For example, if you want to accept only net banking and UPI from customers, you must pass the following value - "nb,upi".


If the order creation is successful you will receive a 200 response and the order entity in response. This order entity contains relevant details for the order and the details provided in the request.

We we recommend that you store the following parameters at your end cf_order_id , order_token, and the order_status. The below table should help you understand the order response.




This is the Identifier for this order in Cashfree's system.


The time when this order was created in Cashfree's system.


Order Id provided by the merchant. If merchant does not provide an order id we auto-generate one.

order_amount , order_currency

Order amount and the currency for this order.


This is the maximum time beyond which Cashfree will not accept payment for this order.


This is the order token which will returned after customer completes the payment. See next steps for a better understanding.


The order status -ACTIVE, PAID, EXPIRED.

An order when created is ACTIVE in the Cashfree Payments system. It will either be paid or get expired after a certain time.


The note passed by the merchant for this order.


These are the customer details passed by the merchant.


Meta details passed for this order. return_url, notify_url and payment_methods.


This is the link that can be used by the customer to pay for this order. This link will be active as long as the order is in an ACTIVE state.


This is a URL that can be used to access all the payment attempts on this Order. See API for more details.


This is a URL which can be used to access all the refunds for this Order. See API for more details.


This is a URL which can be used to access all the settlement amount and settlement related information for this Order. See API for more details.

What’s Next

Once you have created the order, the customer needs to pay for that order. Let's see how that is done!

Did this page help you?