Trigger Recurring Payment
curl --request POST \
--url https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/ \
--header 'Content-Type: application/json' \
--data '{
"amount": 123
}'import requests
url = "https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/"
payload = { "amount": 123 }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123})
};
fetch('https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/', 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}/recurring_payment/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/"
payload := strings.NewReader("{\n \"amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Recurring payment triggered successfully",
"data": {
"subscription_id": "sub_abc123",
"payment_id": "REC-sub_abc123-a1b2c3d4",
"cf_payment_id": "cf_pay_789",
"payment_amount": 500.00,
"status": "success",
"message": "ADHOC recurring payment initiated successfully"
}
}
{
"success": false,
"error": {
"code": "PAYMENT_GATEWAY_VALIDATION_ERROR",
"message": "Validation error",
"details": {
"amount": [
"Recurring amount must be less than or equal to the subscription billing amount"
]
}
}
}
{
"success": false,
"error": {
"code": "PAYMENT_GATEWAY_API_ERROR",
"message": "Payment gateway API error",
"details": {
"message": "Failed to trigger recurring payment"
}
}
}
Subscriptions
Trigger Recurring Payment
Trigger a recurring payment for a ADHOC subscription.
POST
/
pg
/
subscriptions
/
{subscription_id}
/
recurring_payment
/
Trigger Recurring Payment
curl --request POST \
--url https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/ \
--header 'Content-Type: application/json' \
--data '{
"amount": 123
}'import requests
url = "https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/"
payload = { "amount": 123 }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123})
};
fetch('https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/', 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}/recurring_payment/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/"
payload := strings.NewReader("{\n \"amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/pg/subscriptions/{subscription_id}/recurring_payment/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Recurring payment triggered successfully",
"data": {
"subscription_id": "sub_abc123",
"payment_id": "REC-sub_abc123-a1b2c3d4",
"cf_payment_id": "cf_pay_789",
"payment_amount": 500.00,
"status": "success",
"message": "ADHOC recurring payment initiated successfully"
}
}
{
"success": false,
"error": {
"code": "PAYMENT_GATEWAY_VALIDATION_ERROR",
"message": "Validation error",
"details": {
"amount": [
"Recurring amount must be less than or equal to the subscription billing amount"
]
}
}
}
{
"success": false,
"error": {
"code": "PAYMENT_GATEWAY_API_ERROR",
"message": "Payment gateway API error",
"details": {
"message": "Failed to trigger recurring payment"
}
}
}
Trigger a charge on an active ADHOC subscription. The API call initiates the payment — the actual payment outcome (success, failure, or cancellation) is delivered asynchronously via webhooks, at which point the order and payment records are created in the system.
This endpoint only supports ADHOC subscriptions. The subscription must have an active mandate before a recurring payment can be triggered.
Path Parameters
string
required
The unique identifier (uid) of the subscription.
Request Body
number
Amount to charge for this recurring execution. If not provided, the subscription’s
billing_amount is used. Must be less than or equal to the subscription’s billing_amount.Response Fields
string
The subscription identifier.
string
Auto-generated with
REC- prefix if not provided.number
The amount charged for this recurring payment.
string
Status of the API call.
success means the payment was initiated — not that it has been captured.{
"success": true,
"message": "Recurring payment triggered successfully",
"data": {
"subscription_id": "sub_abc123",
"payment_id": "REC-sub_abc123-a1b2c3d4",
"cf_payment_id": "cf_pay_789",
"payment_amount": 500.00,
"status": "success",
"message": "ADHOC recurring payment initiated successfully"
}
}
{
"success": false,
"error": {
"code": "PAYMENT_GATEWAY_VALIDATION_ERROR",
"message": "Validation error",
"details": {
"amount": [
"Recurring amount must be less than or equal to the subscription billing amount"
]
}
}
}
{
"success": false,
"error": {
"code": "PAYMENT_GATEWAY_API_ERROR",
"message": "Payment gateway API error",
"details": {
"message": "Failed to trigger recurring payment"
}
}
}
⌘I