POST
/
orders
/
sessions
curl --request POST \
--url https://sandbox.cashfree.com/pg/orders/sessions \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '{
"payment_session_id": "session__someidwhichislongandhasnumbers1232132andcharacterscn",
"payment_method": {
"upi": {
"channel": "link"
}
}
}'
{
"action": "link",
"cf_payment_id": "4105073870",
"channel": "link",
"payment_amount": 1.75,
"payment_method": "card",
"data": {
"url": "https://api.cashfree.com/pg/view/gateway/session_FEeYTISZ-xOJcuR7YeOZOm1MhVIrjHa2l1G79Pg_ZktVJxPSdu7oAKf9RTFZQlR19lkBU7VGIh8dARedu9otO8VstZVT3-HpjLpIn75v-hKCNOxYuEOV_wJ975ed89f2-ad57-4094-8728-7cff9f1928f2",
"payload": null,
"content_type": null,
"method": null
}
}

Headers

x-api-version
string
default:2025-01-01
required

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<UUID>

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 a transaction at cashfree using payment_session_id.

payment_session_id
string
required

Unique identifier for the payment session, returned in the response of the Create Order API.

Example:

"session__CvcEmNKDkmERQrxnx39ibhJ3Ii034pjc8ZVxf3qcgEXCWlgDDlHRgz2XYZCqpajDQSXMMtCusPgOIxYP2LZx0-05p39gC2Vgmq1RAj--gcn"

payment_method
object
required

Payload for different payment methods is given below.

save_instrument
boolean

Send as true if the customer has given consent to save or tokenise the card; otherwise, send as false.

offer_id
string

This is required if any offers needs to be applied to the order.

Example:

"faa6cc05-d1e2-401c-b0cf-0c9db3ff0f0b"

Response

Order Pay response once you create a transaction for that order.

payment_amount
number

Total amount payable.

cf_payment_id
string<int64>

Payment identifier created by Cashfree

payment_method
enum<string>

One of ["upi", "netbanking", "card", "app", "cardless_emi", "paylater", "banktransfer"].

Available options:
netbanking,
card,
upi,
app,
cardless_emi,
paylater,
banktransfer
channel
enum<string>

The channel that was requested. One of ["link", "post", "collect", "qrcode", "podQrCode"].

Available options:
link,
post,
collect,
qrcode,
podQrCode
action
enum<string>

One of ["link", "post", "custom", "form"]. For Card payments, "link" means you need to redirect the user to data.url page and "post" means you need to render Native OTP UI on your end to collect the OTP and then submit OTP to data.url.

Available options:
link,
post,
custom,
form
data
object

The data object of Order Pay API.