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"
},
"entity": "order",
"order_amount": 22,
"order_currency": "INR",
"order_expiry_time": "2023-09-09T18:02:46+05:30",
"order_id": "order_3242Tq4Edj9CC5RDcMeobmJOWOBJij",
"order_meta": {
"return_url": "https://example.com/return/{order_id}",
"notify_url": "https://example.com/notify",
"payment_methods": "cc"
},
"order_note": "some order note LIST",
"order_splits": [],
"order_status": "ACTIVE",
"order_tags": {
"name": "John",
"age": "19"
},
"payment_session_id": "session_a1VXIPJo8kh7IBigVXX8LgTMupQW_cu25FS8KwLwQLOmiHqbBxq5UhEilrhbDSKKHA6UAuOj9506aaHNlFAHEqYrHSEl9AVtYQN9LIIc4vkH",
"payments": {
"url": "https://sandbox.cashfree.com/pg/orders/order_3242Tq4Edj9CC5RDcMeobmJOWOBJij/payments"
},
"refunds": {
"url": "https://sandbox.cashfree.com/pg/orders/order_3242Tq4Edj9CC5RDcMeobmJOWOBJij/refunds"
},
"settlements": {
"url": "https://sandbox.cashfree.com/pg/orders/order_3242Tq4Edj9CC5RDcMeobmJOWOBJij/settlements"
},
"terminal_data": null
}
]{
"message": "bad URL, please check API documentation",
"code": "request_failed",
"type": "invalid_request_error"
}{
"message": "authentication Failed",
"code": "request_failed",
"type": "authentication_error"
}{
"message": "something is not found",
"code": "somethind_not_found",
"type": "invalid_request_error"
}{
"message": "order with same id is already present",
"code": "order_already_exists",
"type": "invalid_request_error"
}{
"message": "something is not found",
"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",
"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"
},
"entity": "order",
"order_amount": 22,
"order_currency": "INR",
"order_expiry_time": "2023-09-09T18:02:46+05:30",
"order_id": "order_3242Tq4Edj9CC5RDcMeobmJOWOBJij",
"order_meta": {
"return_url": "https://example.com/return/{order_id}",
"notify_url": "https://example.com/notify",
"payment_methods": "cc"
},
"order_note": "some order note LIST",
"order_splits": [],
"order_status": "ACTIVE",
"order_tags": {
"name": "John",
"age": "19"
},
"payment_session_id": "session_a1VXIPJo8kh7IBigVXX8LgTMupQW_cu25FS8KwLwQLOmiHqbBxq5UhEilrhbDSKKHA6UAuOj9506aaHNlFAHEqYrHSEl9AVtYQN9LIIc4vkH",
"payments": {
"url": "https://sandbox.cashfree.com/pg/orders/order_3242Tq4Edj9CC5RDcMeobmJOWOBJij/payments"
},
"refunds": {
"url": "https://sandbox.cashfree.com/pg/orders/order_3242Tq4Edj9CC5RDcMeobmJOWOBJij/refunds"
},
"settlements": {
"url": "https://sandbox.cashfree.com/pg/orders/order_3242Tq4Edj9CC5RDcMeobmJOWOBJij/settlements"
},
"terminal_data": null
}
]{
"message": "bad URL, please check API documentation",
"code": "request_failed",
"type": "invalid_request_error"
}{
"message": "authentication Failed",
"code": "request_failed",
"type": "authentication_error"
}{
"message": "something is not found",
"code": "somethind_not_found",
"type": "invalid_request_error"
}{
"message": "order with same id is already present",
"code": "order_already_exists",
"type": "invalid_request_error"
}{
"message": "something is not found",
"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",
"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 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
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
The payment link ID for which you want to view the details.
Response
OK
unique id generated by cashfree for your 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
URL for payment retrieval for an order
Show child attributes
Show child attributes
Settlement URL object
Show child attributes
Show child attributes
URL to get refunds for order
Show child attributes
Show child attributes
Custom Tags in thr 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?