curl --request GET \
--url https://sandbox.cashfree.com/pg/links/{link_id}/orders \
--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/links/{link_id}/orders"
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/links/{link_id}/orders', 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/links/{link_id}/orders",
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/links/{link_id}/orders"
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/links/{link_id}/orders")
.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/links/{link_id}/orders")
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_order_id": "2149460581",
"created_at": "2023-08-11T18:02:46+05:30",
"customer_details": {
"customer_id": "409128494",
"customer_name": "Johmn Doe",
"customer_email": "pmlpayme@ntsas.com",
"customer_phone": "9876543210",
"customer_uid": "54deabb4-ba45-4a60-9e6a-9c016fe7ab10"
},
"entity": "order",
"order_amount": 22,
"payment_session_id": "session_a1VXIPJo8kh7IBigVXX8LgTMupQW_cu25FS8KwLwQLOmiHqbBxq5UhEilrhbDSKKHA6UAuOj9506aaHNlFAHEqYrHSEl9AVtYQN9LIIc4vkH",
"order_currency": "INR",
"order_expiry_time": "2023-09-09T18:02:46+05:30",
"order_id": "order_3242Tq4Edj9CC5RDcMeobmJOWOBJij",
"order_meta": {
"return_url": "https://www.cashfree.com/devstudio/thankyou",
"payment_methods": "cc",
"notify_url": "https://example.com/cf_notify",
"payment_methods_filters": {
"methods": {
"action": "ALLOW",
"values": [
"debit_card",
"credit_card",
"credit_card_emi",
"debit_card_emi"
]
},
"filters": {
"card_bins": {
"action": "ALLOW",
"values": [
441144,
554455
]
},
"card_schemes": {
"action": "ALLOW",
"values": [
"VISA",
"MASTERCARD"
]
},
"card_suffix": {
"action": "ALLOW",
"values": [
4433,
8910
]
},
"card_emi_bins": {
"action": "ALLOW",
"values": [
441144,
554455
]
},
"card_emi_schemes": {
"action": "ALLOW",
"values": [
"VISA",
"MASTERCARD"
]
},
"card_emi_suffix": {
"action": "ALLOW",
"values": [
4433,
8910
]
}
}
}
},
"order_note": "some order note LIST",
"order_splits": [],
"order_status": "ACTIVE",
"order_tags": {
"name": "John",
"age": "19"
},
"terminal_data": null,
"cart_details": {
"cart_id": "1"
}
}
]{
"message": "bad URL, please check API documentation",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "request_failed",
"type": "invalid_request_error"
}{
"message": "authentication Failed",
"code": "request_failed",
"type": "authentication_error"
}{
"message": "something is not found",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "something_not_found",
"type": "invalid_request_error"
}{
"message": "order with same id is already present",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "order_already_exists",
"type": "invalid_request_error"
}{
"message": "something is not found",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "request_invalid",
"type": "idempotency_error"
}{
"message": "Too many requests from IP. Check headers",
"code": "request_failed",
"type": "rate_limit_error"
}{
"message": "internal Server Error",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "internal_error",
"type": "api_error"
}Get Orders for a Payment Link
Use this API to view all order details for a payment link.
curl --request GET \
--url https://sandbox.cashfree.com/pg/links/{link_id}/orders \
--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/links/{link_id}/orders"
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/links/{link_id}/orders', 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/links/{link_id}/orders",
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/links/{link_id}/orders"
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/links/{link_id}/orders")
.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/links/{link_id}/orders")
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_order_id": "2149460581",
"created_at": "2023-08-11T18:02:46+05:30",
"customer_details": {
"customer_id": "409128494",
"customer_name": "Johmn Doe",
"customer_email": "pmlpayme@ntsas.com",
"customer_phone": "9876543210",
"customer_uid": "54deabb4-ba45-4a60-9e6a-9c016fe7ab10"
},
"entity": "order",
"order_amount": 22,
"payment_session_id": "session_a1VXIPJo8kh7IBigVXX8LgTMupQW_cu25FS8KwLwQLOmiHqbBxq5UhEilrhbDSKKHA6UAuOj9506aaHNlFAHEqYrHSEl9AVtYQN9LIIc4vkH",
"order_currency": "INR",
"order_expiry_time": "2023-09-09T18:02:46+05:30",
"order_id": "order_3242Tq4Edj9CC5RDcMeobmJOWOBJij",
"order_meta": {
"return_url": "https://www.cashfree.com/devstudio/thankyou",
"payment_methods": "cc",
"notify_url": "https://example.com/cf_notify",
"payment_methods_filters": {
"methods": {
"action": "ALLOW",
"values": [
"debit_card",
"credit_card",
"credit_card_emi",
"debit_card_emi"
]
},
"filters": {
"card_bins": {
"action": "ALLOW",
"values": [
441144,
554455
]
},
"card_schemes": {
"action": "ALLOW",
"values": [
"VISA",
"MASTERCARD"
]
},
"card_suffix": {
"action": "ALLOW",
"values": [
4433,
8910
]
},
"card_emi_bins": {
"action": "ALLOW",
"values": [
441144,
554455
]
},
"card_emi_schemes": {
"action": "ALLOW",
"values": [
"VISA",
"MASTERCARD"
]
},
"card_emi_suffix": {
"action": "ALLOW",
"values": [
4433,
8910
]
}
}
}
},
"order_note": "some order note LIST",
"order_splits": [],
"order_status": "ACTIVE",
"order_tags": {
"name": "John",
"age": "19"
},
"terminal_data": null,
"cart_details": {
"cart_id": "1"
}
}
]{
"message": "bad URL, please check API documentation",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "request_failed",
"type": "invalid_request_error"
}{
"message": "authentication Failed",
"code": "request_failed",
"type": "authentication_error"
}{
"message": "something is not found",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "something_not_found",
"type": "invalid_request_error"
}{
"message": "order with same id is already present",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "order_already_exists",
"type": "invalid_request_error"
}{
"message": "something is not found",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "request_invalid",
"type": "idempotency_error"
}{
"message": "Too many requests from IP. Check headers",
"code": "request_failed",
"type": "rate_limit_error"
}{
"message": "internal Server Error",
"help": "Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
"code": "internal_error",
"type": "api_error"
}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 payment link ID for which you want to view the details.
Query Parameters
Mention What is status of orders you want to fetch, default is PAID. Possible value: ALL, PAID.
Response
Success response for viewing all order details for a payment link.
unique id generated by cashfree for your order.
link id of the order.
order_id sent during the api request.
Type of the entity.
Currency of the order. Example INR.
Possible values are
ACTIVE: Order does not have a sucessful transaction yetPAID: Order is PAID with one successful transactionEXPIRED: Order was not PAID and not it has expired. No transaction can be initiated for an EXPIRED order.
Additional note for order.
When the order was created at cashfree's server.
"2022-08-16T14:45:38+05:30"
Show child attributes
Show child attributes
The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details.
Show child attributes
Show child attributes
{
"customer_id": "7112AAA812234",
"customer_email": "john@cashfree.com",
"customer_phone": "9908734801",
"customer_name": "John Doe",
"customer_bank_account_number": "1518121112",
"customer_bank_ifsc": "XITI0000001",
"customer_bank_code": 3333
}
Optional meta details to control how the customer pays and how payment journey completes.
Show child attributes
Show child attributes
Custom Tags in the form of {"key":"value"} which can be passed for an order. A maximum of 10 tags can be added.
Show child attributes
Show child attributes
{
"product": "Laptop",
"shipping_address": "123 Main St."
}
Was this page helpful?