POST
/
orders
curl --request POST \
  --url https://sandbox.cashfree.com/pg/orders \
  --header 'Content-Type: application/json' \
  --header 'x-api-version: <x-api-version>' \
  --header 'x-client-id: <api-key>' \
  --header 'x-client-secret: <api-key>' \
  --data '{
  "order_currency": "INR",
  "order_amount": 10.34,
  "customer_details": {
    "customer_id": "7112AAA812234",
    "customer_phone": "9898989898"
  }
}'

Authorizations

x-client-id
string
headerrequired

Client app ID. You can find your app id in the Merchant Dashboard.

x-client-secret
string
headerrequired

Client secret key. You can find your secret in the Merchant Dashboard.

Headers

x-api-version
string
default: 2023-08-01required

API version to be used. Format is in YYYY-MM-DD

x-request-id
string

Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree

x-idempotency-key
string

An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions.

Body

application/json

Request body to create an order at cashfree

order_amount
number
required

Bill amount for the order. Provide upto two decimals. 10.15 means Rs 10 and 15 paisa

Required range: x > 1
order_currency
string
required

Currency for the order. INR if left empty. Contact care@cashfree.com to enable new currencies.

customer_details
object
required

The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details.

order_id
string

Order identifier present in your system. Alphanumeric, '_' and '-' only

Required string length: 3 - 45
cart_details
object

The cart details that are necessary like shipping address, billing address and more.

terminal
object

Use this if you are creating an order for cashfree's softPOS

order_meta
object

Optional meta details to control how the customer pays and how payment journey completes

order_expiry_time
string

Time after which the order expires. Customers will not be able to make the payment beyond the time specified here. We store timestamps in IST, but you can provide them in a valid ISO 8601 time format. Example 2021-07-02T10:20:12+05:30 for IST, 2021-07-02T10:20:12Z for UTC

order_note
string

Order note for reference.

Required string length: 3 - 200
order_tags
object

Custom Tags in thr form of {"key":"value"} which can be passed for an order. A maximum of 10 tags can be added

order_splits
object[]

If you have Easy split enabled in your Cashfree account then you can use this option to split the order amount.

Response

200 - application/json

The complete order entity

cf_order_id
string

unique id generated by cashfree for your order

order_id
string

order_id sent during the api request

entity
string

Type of the entity.

order_currency
string

Currency of the order. Example INR

order_amount
number
order_status
string

Possible values are

  • ACTIVE: Order does not have a sucessful transaction yet
  • PAID: Order is PAID with one successful transaction
  • EXPIRED: Order was not PAID and not it has expired. No transaction can be initiated for an EXPIRED order. TERMINATED: Order terminated TERMINATION_REQUESTED: Order termination requested
payment_session_id
string
order_expiry_time
string
order_note
string

Additional note for order

created_at
string

When the order was created at cashfree's server

order_splits
object[]
customer_details
object

The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details.

order_meta
object

Optional meta details to control how the customer pays and how payment journey completes

order_tags
object

Custom Tags in thr form of {"key":"value"} which can be passed for an order. A maximum of 10 tags can be added

cart_details
object

Cart Details in the Order Entity Response

Was this page helpful?