curl --request GET \
--url https://sandbox.cashfree.com/pg/orders/{order_id}/payments \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>'import requests
url = "https://sandbox.cashfree.com/pg/orders/{order_id}/payments"
headers = {
"x-api-version": "<x-api-version>",
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-api-version': '<x-api-version>',
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>'
}
};
fetch('https://sandbox.cashfree.com/pg/orders/{order_id}/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cashfree.com/pg/orders/{order_id}/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-version: <x-api-version>",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/pg/orders/{order_id}/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-version", "<x-api-version>")
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.cashfree.com/pg/orders/{order_id}/payments")
.header("x-api-version", "<x-api-version>")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/pg/orders/{order_id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-version"] = '<x-api-version>'
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"cf_payment_id": "12376123",
"order_id": "order_8123",
"entity": "payment",
"payment_currency": "INR",
"error_details": null,
"order_amount": 10.01,
"order_currency": "INR",
"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",
"upi_payer_ifsc": "AXL1234",
"upi_payer_account_number": "XXXXXXX6024"
}
},
"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_surcharge": {
"payment_surcharge_service_charge": 0,
"payment_surcharge_service_tax": 0
},
"payment_message": "Transaction successful",
"bank_reference": "P78112898712",
"auth_id": "A898101",
"international_payment": {
"international": false
},
"payment_gateway_details": {
"gateway_name": "CASHFREE",
"gateway_order_id": "1234421ABD",
"gateway_payment_id": "XABDJ2213",
"gateway_order_reference_id": "BDIWO233",
"gateway_settlement": "cashfree",
"gateway_reference_name": ""
}
},
{
"cf_payment_id": "12376124",
"order_id": "order_8123",
"entity": "payment",
"payment_currency": "INR",
"error_details": {
"error_code": "TRANSACTION_DECLINED",
"error_description": "issuer bank or payment service provider declined the transaction",
"error_reason": "auth_declined",
"error_source": "customer"
},
"order_amount": 10.01,
"order_currency": "INR",
"is_captured": true,
"payment_group": "credit_card",
"authorization": null,
"payment_method": {
"card": {
"channel": "link",
"card_number": "xxxxxx1111"
}
},
"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": "FAILED",
"payment_surcharge": {
"payment_surcharge_service_charge": 0,
"payment_surcharge_service_tax": 0
},
"payment_message": "Transaction failed",
"bank_reference": "P78112898712",
"auth_id": "A898101",
"international_payment": {
"international": false
},
"payment_gateway_details": {
"gateway_name": "CASHFREE",
"gateway_order_id": "1234421ABD",
"gateway_payment_id": "XABDJ2213",
"gateway_order_reference_id": "BDIWO233",
"gateway_settlement": "cashfree",
"gateway_reference_name": ""
}
},
{
"cf_payment_id": "12376152",
"order_id": "order_8125",
"entity": "payment",
"payment_currency": "USD",
"error_details": {
"error_code": "TRANSACTION_DECLINED",
"error_description": "issuer bank or payment service provider declined the transaction",
"error_reason": "auth_declined",
"error_source": "customer"
},
"order_amount": 100,
"order_currency": "INR",
"is_captured": true,
"payment_group": "credit_card",
"authorization": null,
"payment_method": {
"card": {
"channel": "link",
"card_number": "xxxxxx1111"
}
},
"payment_amount": 1.25,
"payment_time": "2021-07-23T12:15:06+05:30",
"payment_completion_time": "2021-07-23T12:18:59+05:30",
"payment_status": "FAILED",
"payment_surcharge": {
"payment_surcharge_service_charge": 0,
"payment_surcharge_service_tax": 0
},
"payment_message": "Transaction failed",
"bank_reference": "P78112812312",
"auth_id": "A851201",
"international_payment": {
"international": true
},
"payment_gateway_details": {
"gateway_name": "CASHFREE",
"gateway_order_id": "3462421ABD",
"gateway_payment_id": "XAUIH2213",
"gateway_order_reference_id": "ZD5WO253",
"gateway_settlement": "cashfree",
"gateway_reference_name": ""
}
}
]Get Payments for an Order
Use this API to view all payment details for an order.
curl --request GET \
--url https://sandbox.cashfree.com/pg/orders/{order_id}/payments \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>'import requests
url = "https://sandbox.cashfree.com/pg/orders/{order_id}/payments"
headers = {
"x-api-version": "<x-api-version>",
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-api-version': '<x-api-version>',
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>'
}
};
fetch('https://sandbox.cashfree.com/pg/orders/{order_id}/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cashfree.com/pg/orders/{order_id}/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-version: <x-api-version>",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/pg/orders/{order_id}/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-version", "<x-api-version>")
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.cashfree.com/pg/orders/{order_id}/payments")
.header("x-api-version", "<x-api-version>")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/pg/orders/{order_id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-version"] = '<x-api-version>'
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"cf_payment_id": "12376123",
"order_id": "order_8123",
"entity": "payment",
"payment_currency": "INR",
"error_details": null,
"order_amount": 10.01,
"order_currency": "INR",
"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",
"upi_payer_ifsc": "AXL1234",
"upi_payer_account_number": "XXXXXXX6024"
}
},
"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_surcharge": {
"payment_surcharge_service_charge": 0,
"payment_surcharge_service_tax": 0
},
"payment_message": "Transaction successful",
"bank_reference": "P78112898712",
"auth_id": "A898101",
"international_payment": {
"international": false
},
"payment_gateway_details": {
"gateway_name": "CASHFREE",
"gateway_order_id": "1234421ABD",
"gateway_payment_id": "XABDJ2213",
"gateway_order_reference_id": "BDIWO233",
"gateway_settlement": "cashfree",
"gateway_reference_name": ""
}
},
{
"cf_payment_id": "12376124",
"order_id": "order_8123",
"entity": "payment",
"payment_currency": "INR",
"error_details": {
"error_code": "TRANSACTION_DECLINED",
"error_description": "issuer bank or payment service provider declined the transaction",
"error_reason": "auth_declined",
"error_source": "customer"
},
"order_amount": 10.01,
"order_currency": "INR",
"is_captured": true,
"payment_group": "credit_card",
"authorization": null,
"payment_method": {
"card": {
"channel": "link",
"card_number": "xxxxxx1111"
}
},
"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": "FAILED",
"payment_surcharge": {
"payment_surcharge_service_charge": 0,
"payment_surcharge_service_tax": 0
},
"payment_message": "Transaction failed",
"bank_reference": "P78112898712",
"auth_id": "A898101",
"international_payment": {
"international": false
},
"payment_gateway_details": {
"gateway_name": "CASHFREE",
"gateway_order_id": "1234421ABD",
"gateway_payment_id": "XABDJ2213",
"gateway_order_reference_id": "BDIWO233",
"gateway_settlement": "cashfree",
"gateway_reference_name": ""
}
},
{
"cf_payment_id": "12376152",
"order_id": "order_8125",
"entity": "payment",
"payment_currency": "USD",
"error_details": {
"error_code": "TRANSACTION_DECLINED",
"error_description": "issuer bank or payment service provider declined the transaction",
"error_reason": "auth_declined",
"error_source": "customer"
},
"order_amount": 100,
"order_currency": "INR",
"is_captured": true,
"payment_group": "credit_card",
"authorization": null,
"payment_method": {
"card": {
"channel": "link",
"card_number": "xxxxxx1111"
}
},
"payment_amount": 1.25,
"payment_time": "2021-07-23T12:15:06+05:30",
"payment_completion_time": "2021-07-23T12:18:59+05:30",
"payment_status": "FAILED",
"payment_surcharge": {
"payment_surcharge_service_charge": 0,
"payment_surcharge_service_tax": 0
},
"payment_message": "Transaction failed",
"bank_reference": "P78112812312",
"auth_id": "A851201",
"international_payment": {
"international": true
},
"payment_gateway_details": {
"gateway_name": "CASHFREE",
"gateway_order_id": "3462421ABD",
"gateway_payment_id": "XAUIH2213",
"gateway_order_reference_id": "ZD5WO253",
"gateway_settlement": "cashfree",
"gateway_reference_name": ""
}
}
]Authorizations
Client app ID. You can find your app id in the Merchant Dashboard.
Client secret key. You can find your secret key in the Merchant Dashboard.
Headers
API version to be used.
Request ID for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to Cashfree.
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.
Path Parameters
The ID which uniquely identifies your order.
Response
Success response for fetching payments for an order.
Payment entity full object.
The error details are present only for failed payments.
Show child attributes
Show child attributes
{
"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": ""
}
Order amount can be different from payment amount if you collect service fee from the customer.
Type of payment group. One of ['prepaid_card', 'upi_ppi_offline', 'cash', 'upi_credit_card', 'paypal', 'net_banking', 'cardless_emi', 'credit_card', 'bank_transfer', 'pay_later', 'debit_card_emi', 'debit_card', 'wallet', 'upi_ppi', 'upi', 'credit_card_emi'].
This is the time when the payment was initiated.
This is the time when the payment reaches its terminal state.
The transaction status can be one of ["SUCCESS", "NOT_ATTEMPTED", "FAILED", "USER_DROPPED", "VOID", "CANCELLED", "PENDING"].
SUCCESS, NOT_ATTEMPTED, FAILED, USER_DROPPED, VOID, CANCELLED, PENDING Issuing bankās transaction reference number.
Authorisation ID provided by the issuing bank.
If preauth enabled for account you will get this body.
Show child attributes
Show child attributes
{
"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"
}
The following code samples show the payment method object payload for different payment methods.
- Card
- Net banking
- UPI
- App
- Cardless EMI
- Pay later
- Card EMI
- Bank transfer
Show child attributes
Show child attributes
International payment details.
Show child attributes
Show child attributes
payment gateway details present in the webhook response.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?