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": "SUBPAY-sub123-cf456",
"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": "SUBPAY-sub123-cf456",
"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
string
required
The unique identifier (uid) of the subscription.
Response Fields
string
Unique identifier of the payment request.
string
Unique identifier of the associated order.
string
Merchant-facing reference ID for the order.
number
Payment amount in the billing currency (e.g., INR).
string
ISO 4217 currency code (e.g.,
INR).string
Payment status. One of:
PENDING— Payment is pendingCAPTURED— Payment was successfully capturedFAILED— Payment failedINVALID— Payment is invalid
string
Type of payment. One of:
REGULAR— One-time paymentRECURRING— Recurring subscription paymentMANDATE— Mandate/authorization payment
string
Mode of payment. One of:
CREDIT_CARD, DEBIT_CARD, UPI, NET_BANKING, WALLET, QR, EMI, BNPL, CARD, VBA_TRANSFER.string
Bank reference number for the transaction.
string
Additional status message or failure reason.
string
ISO 8601 timestamp when the payment record was created.
string
ISO 8601 timestamp when the payment was completed at the gateway.
{
"success": true,
"message": "Subscription payments fetched successfully",
"data": [
{
"payment_id": "dpr_abc123",
"order_id": "ord_xyz789",
"reference_id": "SUBPAY-sub123-cf456",
"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"
}
}
}