Fetch payments for a QR code
Returns a list of all payments received through a specific QR code.
GET
/
payments
/
qr_codes
/
{id}
/
payments
Fetch payments for a QR code
curl --request GET \
--url https://api.razorpay.com/v1/payments/qr_codes/{id}/payments \
--header 'Authorization: Basic <encoded-value>'const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.razorpay.com/v1/payments/qr_codes/{id}/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.razorpay.com/v1/payments/qr_codes/{id}/payments"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.razorpay.com/v1/payments/qr_codes/{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 => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.razorpay.com/v1/payments/qr_codes/{id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.razorpay.com/v1/payments/qr_codes/{id}/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.razorpay.com/v1/payments/qr_codes/{id}/payments")
.header("Authorization", "Basic <encoded-value>")
.asString();{
"entity": "collection",
"count": 1,
"items": [
{
"id": "pay_EtjRHrOCp0Uzxc",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "captured",
"method": "upi"
}
]
}{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The amount must be greater than 0.",
"field": "amount"
}
}{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The amount must be greater than 0.",
"field": "amount"
}
}Authorizations
Use your Razorpay Key ID as the username and Key Secret as the password.
Path Parameters
Unique identifier of the QR code.
Example:
"qr_EtjRHL7viz7RCz"
Query Parameters
Number of payments to return. Default is 10, maximum is 100.
Required range:
x <= 100Number of payments to skip. Used for pagination.
Was this page helpful?
⌘I
Fetch payments for a QR code
curl --request GET \
--url https://api.razorpay.com/v1/payments/qr_codes/{id}/payments \
--header 'Authorization: Basic <encoded-value>'const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.razorpay.com/v1/payments/qr_codes/{id}/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.razorpay.com/v1/payments/qr_codes/{id}/payments"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.razorpay.com/v1/payments/qr_codes/{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 => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.razorpay.com/v1/payments/qr_codes/{id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.razorpay.com/v1/payments/qr_codes/{id}/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.razorpay.com/v1/payments/qr_codes/{id}/payments")
.header("Authorization", "Basic <encoded-value>")
.asString();{
"entity": "collection",
"count": 1,
"items": [
{
"id": "pay_EtjRHrOCp0Uzxc",
"entity": "payment",
"amount": 100,
"currency": "INR",
"status": "captured",
"method": "upi"
}
]
}{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The amount must be greater than 0.",
"field": "amount"
}
}{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The amount must be greater than 0.",
"field": "amount"
}
}