Get Subscription Payments
curl --request GET \
--url https://api.example.com/pg/subscriptions/{subscription_id}/payments/import requests
url = "https://api.example.com/pg/subscriptions/{subscription_id}/payments/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/pg/subscriptions/{subscription_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://api.example.com/pg/subscriptions/{subscription_id}/payments/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/pg/subscriptions/{subscription_id}/payments/"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/pg/subscriptions/{subscription_id}/payments/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/pg/subscriptions/{subscription_id}/payments/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Subscription payments fetched successfully",
"data": [
{
"payment_id": "dpr_abc123",
"order_id": "ord_xyz789",
"reference_id": "REC-SUB7989707770-a1b2c3d4",
"amount": 1000.00,
"currency": "INR",
"status": "CAPTURED",
"payment_type": "RECURRING",
"mop_type": "UPI",
"bank_ref_num": "BANK123456",
"status_message": null,
"created_at": "2025-03-20T10:30:00Z",
"payment_completed_at": "2025-03-20T10:30:05Z"
}
]
}
{
"success": false,
"error": {
"code": "PAYMENT_GATEWAY_ERROR",
"message": "Subscription not found",
"details": {
"error": "Subscription not found"
}
}
}
Subscriptions
Get Subscription Payments
Fetch all payments from the internal system associated with a subscription.
GET
/
pg
/
subscriptions
/
{subscription_id}
/
payments
/
Get Subscription Payments
curl --request GET \
--url https://api.example.com/pg/subscriptions/{subscription_id}/payments/import requests
url = "https://api.example.com/pg/subscriptions/{subscription_id}/payments/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/pg/subscriptions/{subscription_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://api.example.com/pg/subscriptions/{subscription_id}/payments/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/pg/subscriptions/{subscription_id}/payments/"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/pg/subscriptions/{subscription_id}/payments/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/pg/subscriptions/{subscription_id}/payments/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Subscription payments fetched successfully",
"data": [
{
"payment_id": "dpr_abc123",
"order_id": "ord_xyz789",
"reference_id": "REC-SUB7989707770-a1b2c3d4",
"amount": 1000.00,
"currency": "INR",
"status": "CAPTURED",
"payment_type": "RECURRING",
"mop_type": "UPI",
"bank_ref_num": "BANK123456",
"status_message": null,
"created_at": "2025-03-20T10:30:00Z",
"payment_completed_at": "2025-03-20T10:30:05Z"
}
]
}
{
"success": false,
"error": {
"code": "PAYMENT_GATEWAY_ERROR",
"message": "Subscription not found",
"details": {
"error": "Subscription not found"
}
}
}
Fetch all payments from the internal system associated with the given subscription. Available for all payment gateways and all environments (including production).
Path Parameters
Response Fields
Merchant-facing reference ID for the order. For a recurring debit, it is the
reference_id you sent to Trigger Recurring Payment, so you can match the debit to your own order. If you sent none, it is the payment_id that call returned where it returned one, or otherwise a generated reference starting REC-. If the same debit is retried, each retry is a separate payment whose reference_id has -attempt-1, -attempt-2, and so on appended — search for the payment_id to find every attempt. Older debits, and debits not started through that call, may carry a generated reference starting SUBPAY- instead.Payment status. One of:
PENDING— Payment is pendingCAPTURED— Payment was successfully capturedFAILED— Payment failedINVALID— Payment is invalid
Type of payment. One of:
REGULAR— One-time paymentRECURRING— Recurring subscription paymentMANDATE— Mandate/authorization payment
Mode of payment. One of:
CREDIT_CARD, DEBIT_CARD, UPI, NET_BANKING, WALLET, QR, EMI, BNPL, CARD, VBA_TRANSFER.{
"success": true,
"message": "Subscription payments fetched successfully",
"data": [
{
"payment_id": "dpr_abc123",
"order_id": "ord_xyz789",
"reference_id": "REC-SUB7989707770-a1b2c3d4",
"amount": 1000.00,
"currency": "INR",
"status": "CAPTURED",
"payment_type": "RECURRING",
"mop_type": "UPI",
"bank_ref_num": "BANK123456",
"status_message": null,
"created_at": "2025-03-20T10:30:00Z",
"payment_completed_at": "2025-03-20T10:30:05Z"
}
]
}
{
"success": false,
"error": {
"code": "PAYMENT_GATEWAY_ERROR",
"message": "Subscription not found",
"details": {
"error": "Subscription not found"
}
}
}