Skip to main content
POST
/
orders
/
{order_id}
/
authorization
Preauthorization
curl --request POST \
  --url https://sandbox.cashfree.com/pg/orders/{order_id}/authorization \
  --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 '{
  "action": "CAPTURE",
  "amount": 100
}'
{
  "cf_payment_id": 12376123,
  "order_id": "order_8123",
  "entity": "payment",
  "payment_currency": "INR",
  "error_details": null,
  "order_amount": 10.01,
  "is_captured": true,
  "payment_group": "upi",
  "authorization": {
    "action": "CAPTURE",
    "status": "PENDING",
    "captured_amount": 100,
    "start_time": "2022-02-09T18:04:34+05:30",
    "end_time": "2022-02-19T18:04:34+05:30",
    "approve_by": "2022-02-09T18:04:34+05:30",
    "action_reference": "6595231908096894505959",
    "action_time": "2022-08-03T16:09:51"
  },
  "payment_method": {
    "upi": {
      "channel": "collect",
      "upi_id": "rohit@xcxcx"
    }
  },
  "payment_amount": 10.01,
  "payment_time": "2021-07-23T12:15:06+05:30",
  "payment_completion_time": "2021-07-23T12:18:59+05:30",
  "payment_status": "SUCCESS",
  "payment_message": "Transaction successful",
  "bank_reference": "P78112898712",
  "auth_id": "A898101"
}

Authorizations

x-client-id
string
header
required

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

x-client-secret
string
header
required

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

Headers

x-api-version
string
default:2022-09-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>

Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors.

Currently supported on all POST calls that uses x-client-id & x-client-secret. To use enable, pass x-idempotency-key in the request header. The value of this header must be unique to each operation you are trying to do. One example can be to use the same order_id that you pass while creating orders

Path Parameters

order_id
string
required

The id which uniquely identifies your order

Body

application/json

Request to Capture or Void Transactions

Request to capture or void transaction

action
enum<string>

Type of authorization to run. Can be one of 'CAPTURE' , 'VOID'

Available options:
CAPTURE,
VOID
amount
number

The amount if you are running a 'CAPTURE'

Response

OK

payment entity full object

cf_payment_id
integer
order_id
string
entity
string
error_details
object

The error details are present only for failed payments

Example:
{
"error_code": "TRANSACTION_DECLINED",
"error_description": "issuer bank or payment service provider declined the transaction",
"error_reason": "auth_declined",
"error_source": "customer",
"error_code_raw": "ZM",
"error_description_raw": "INVALID / INCORRECT MPIN",
"error_subcode_raw": ""
}
is_captured
boolean
order_amount
number

Order amount can be different from payment amount if you collect service fee from the customer

payment_group
string

Type of payment group. One of ['upi', 'card', 'app', 'netbanking', 'paylater', 'cardless_emi']

payment_currency
string
payment_amount
number
payment_time
string

This is the time when the payment was initiated

payment_completion_time
string

This is the time when the payment reaches its terminal state

payment_status
enum<string>

The transaction status can be one of ["SUCCESS", "NOT_ATTEMPTED", "FAILED", "USER_DROPPED", "VOID", "CANCELLED", "PENDING"]

Available options:
SUCCESS,
NOT_ATTEMPTED,
FAILED,
USER_DROPPED,
VOID,
CANCELLED,
PENDING
payment_message
string
bank_reference
string
auth_id
string
authorization
object | null

If preauth enabled for account you will get this body

Example:
{
"action": "CAPTURE",
"status": "PENDING",
"captured_amount": 100,
"start_time": "2022-02-09T18:04:34+05:30",
"end_time": "2022-02-19T18:04:34+05:30",
"approve_by": "2022-02-09T18:04:34+05:30",
"action_reference": "6595231908096894505959",
"action_time": "2022-08-03T16:09:51"
}
payment_method
object

payment methods all

Example:
{
"$ref": "#/components/schemas/PaymentMethodCardInPaymentsEntity/example"
}