Pause Subscription
curl --request PUT \
--url https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>'import requests
url = "https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription"
headers = {
"X-Client-Id": "<x-client-id>",
"X-Client-Secret": "<x-client-secret>"
}
response = requests.put(url, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Client-Id': '<x-client-id>', 'X-Client-Secret': '<x-client-secret>'}
};
fetch('https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription', 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/api/v2/subscriptions/{subReferenceId}/pause-subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"X-Client-Id: <x-client-id>",
"X-Client-Secret: <x-client-secret>"
],
]);
$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/api/v2/subscriptions/{subReferenceId}/pause-subscription"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("X-Client-Id", "<x-client-id>")
req.Header.Add("X-Client-Secret", "<x-client-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription")
.header("X-Client-Id", "<x-client-id>")
.header("X-Client-Secret", "<x-client-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Client-Id"] = '<x-client-id>'
request["X-Client-Secret"] = '<x-client-secret>'
response = http.request(request)
puts response.read_body{
"status": "OK",
"message": "Subscription paused successfully"
}Subscription
Pause Subscription
Use this API to temporarily pause a subscription. Once this API is called, the subscription status will be updated to āPAUSEDā. Only a periodic subscription can be paused. To reactivate the subscription, you can use the Activate Subscription API.
PUT
/
api
/
v2
/
subscriptions
/
{subReferenceId}
/
pause-subscription
Pause Subscription
curl --request PUT \
--url https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>'import requests
url = "https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription"
headers = {
"X-Client-Id": "<x-client-id>",
"X-Client-Secret": "<x-client-secret>"
}
response = requests.put(url, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Client-Id': '<x-client-id>', 'X-Client-Secret': '<x-client-secret>'}
};
fetch('https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription', 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/api/v2/subscriptions/{subReferenceId}/pause-subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"X-Client-Id: <x-client-id>",
"X-Client-Secret: <x-client-secret>"
],
]);
$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/api/v2/subscriptions/{subReferenceId}/pause-subscription"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("X-Client-Id", "<x-client-id>")
req.Header.Add("X-Client-Secret", "<x-client-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription")
.header("X-Client-Id", "<x-client-id>")
.header("X-Client-Secret", "<x-client-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/api/v2/subscriptions/{subReferenceId}/pause-subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Client-Id"] = '<x-client-id>'
request["X-Client-Secret"] = '<x-client-secret>'
response = http.request(request)
puts response.read_body{
"status": "OK",
"message": "Subscription paused successfully"
}Headers
Client ID provided by Cashfree.
Example:
"clientId123"
Client Secret provided by Cashfree.
Example:
"clientSecret456"
Path Parameters
The reference ID of the subscription to be paused.
Example:
95491
Response
Successful pause of the subscription.
Was this page helpful?
āI