Pause Subscription
curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause \
--header 'Authorization: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause"
headers = {
"Authorization": "<api-key>",
"x-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'x-api-key': '<api-key>'}
};
fetch('https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause', 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-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"x-api-key: <api-key>"
],
]);
$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-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
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-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause")
.header("Authorization", "<api-key>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"status_code": 200,
"is_live": false,
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Subscription Updated.",
"code": "INFO3000"
},
"subscription_details": {
"id": "664dc930-88bd-4696-8807-5e0f1fedba0b",
"type": "CYCLE",
"max_cycle_count": 10,
"status": "PAUSED",
"completed_payment_cycle": 1,
"last_payment_status": "SUCCESSFUL",
"next_payment_date": "2024-11-28T01:31:29.154Z",
"next_payment_cycle": 2,
"subscription_plan_details": {
"name": "Three weeks plan",
"desc": "Billed every two days",
"billing_cycle_type": "DAYS",
"billing_cycle_interval": 2,
"amount": 1000,
"ccy": "JPY",
"trial_period_duration": "",
"trial_period_duration_type": "NONE",
"plan_discount_percentage": 10,
"plan_discount_duration": 2
},
"subscription_transaction_details": [
{
"id": "359f39bd-673a-47b3-b9ec-cbd6cd313b8e",
"ref": 74860,
"cycle": 1,
"status": "SUCCESSFUL",
"transaction_date": "2024-11-26T01:31:29.000Z",
"amount": 900,
"ccy": "JPY",
"event": "CAPTURED"
}
]
}
}Subscriptions
Pause Subscription API
The Pause Subscription API allows merchants to temporarily pause a customer subscription, halting any upcoming billing cycles until the subscription is resumed.
POST
/
api
/
v1
/
server-to-server-interface
/
subscription
/
{subscription_id}
/
pause
Pause Subscription
curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause \
--header 'Authorization: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause"
headers = {
"Authorization": "<api-key>",
"x-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'x-api-key': '<api-key>'}
};
fetch('https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause', 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-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"x-api-key: <api-key>"
],
]);
$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-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
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-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause")
.header("Authorization", "<api-key>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/subscription/{subscription_id}/pause")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"status_code": 200,
"is_live": false,
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Subscription Updated.",
"code": "INFO3000"
},
"subscription_details": {
"id": "664dc930-88bd-4696-8807-5e0f1fedba0b",
"type": "CYCLE",
"max_cycle_count": 10,
"status": "PAUSED",
"completed_payment_cycle": 1,
"last_payment_status": "SUCCESSFUL",
"next_payment_date": "2024-11-28T01:31:29.154Z",
"next_payment_cycle": 2,
"subscription_plan_details": {
"name": "Three weeks plan",
"desc": "Billed every two days",
"billing_cycle_type": "DAYS",
"billing_cycle_interval": 2,
"amount": 1000,
"ccy": "JPY",
"trial_period_duration": "",
"trial_period_duration_type": "NONE",
"plan_discount_percentage": 10,
"plan_discount_duration": 2
},
"subscription_transaction_details": [
{
"id": "359f39bd-673a-47b3-b9ec-cbd6cd313b8e",
"ref": 74860,
"cycle": 1,
"status": "SUCCESSFUL",
"transaction_date": "2024-11-26T01:31:29.000Z",
"amount": 900,
"ccy": "JPY",
"event": "CAPTURED"
}
]
}
}Key Points
Pause a Subscription
- Merchants can use this API to pause a subscription, which stops future billing for the customer until the subscription is resumed.
- During the paused period, the subscription remains active but will not trigger billing or provide services unless resumed.
Subscription Status
- The subscription will change to paused status in the system.
- No billing cycles will be processed while the subscription is paused, but the merchant retains control over when to resume the subscription.
Required Parameters
- Subscription ID: The unique identifier of the subscription to be paused.
Flow diagram
Api Parameters
Authorizations
API Key for Authorization. Format: 'Basic YOUR_API_KEY_HERE'
API Key specific to x-api-key.
Path Parameters
The Subscription ID of the subscription. Example: 664dc930-88bd-4696-8807-5e0f1fedba0b. The unique Subscription ID of the subscription.
Maximum string length:
36Response
200 - application/json
A successful response indicating the subscription has been paused.
Indicates whether the operation was successful.
Example:
true
The HTTP status code of the response.
Example:
200
Indicates if the transaction is live or a test transaction.
Example:
false
Response details from the gateway.
Show child attributes
Show child attributes
Details of the subscription.
Show child attributes
Show child attributes