Create Plan
curl --request POST \
--url https://api.paytring.com/api/v1/subscription/plan/create \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"amount": "<string>",
"frequency": 123,
"key": "<string>",
"mer_reference_id": "<string>",
"hash": "<string>",
"cycle": 12,
"currency": "<string>",
"notes": {
"udf1": "<string>",
"udf2": "<string>",
"udf3": "<string>",
"udf4": "<string>",
"udf5": "<string>"
}
}
'import requests
url = "https://api.paytring.com/api/v1/subscription/plan/create"
payload = {
"title": "<string>",
"description": "<string>",
"amount": "<string>",
"frequency": 123,
"key": "<string>",
"mer_reference_id": "<string>",
"hash": "<string>",
"cycle": 12,
"currency": "<string>",
"notes": {
"udf1": "<string>",
"udf2": "<string>",
"udf3": "<string>",
"udf4": "<string>",
"udf5": "<string>"
}
}
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({
title: '<string>',
description: '<string>',
amount: '<string>',
frequency: 123,
key: '<string>',
mer_reference_id: '<string>',
hash: '<string>',
cycle: 12,
currency: '<string>',
notes: {
udf1: '<string>',
udf2: '<string>',
udf3: '<string>',
udf4: '<string>',
udf5: '<string>'
}
})
};
fetch('https://api.paytring.com/api/v1/subscription/plan/create', 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.paytring.com/api/v1/subscription/plan/create",
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([
'title' => '<string>',
'description' => '<string>',
'amount' => '<string>',
'frequency' => 123,
'key' => '<string>',
'mer_reference_id' => '<string>',
'hash' => '<string>',
'cycle' => 12,
'currency' => '<string>',
'notes' => [
'udf1' => '<string>',
'udf2' => '<string>',
'udf3' => '<string>',
'udf4' => '<string>',
'udf5' => '<string>'
]
]),
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.paytring.com/api/v1/subscription/plan/create"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"<string>\",\n \"frequency\": 123,\n \"key\": \"<string>\",\n \"mer_reference_id\": \"<string>\",\n \"hash\": \"<string>\",\n \"cycle\": 12,\n \"currency\": \"<string>\",\n \"notes\": {\n \"udf1\": \"<string>\",\n \"udf2\": \"<string>\",\n \"udf3\": \"<string>\",\n \"udf4\": \"<string>\",\n \"udf5\": \"<string>\"\n }\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.paytring.com/api/v1/subscription/plan/create")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"<string>\",\n \"frequency\": 123,\n \"key\": \"<string>\",\n \"mer_reference_id\": \"<string>\",\n \"hash\": \"<string>\",\n \"cycle\": 12,\n \"currency\": \"<string>\",\n \"notes\": {\n \"udf1\": \"<string>\",\n \"udf2\": \"<string>\",\n \"udf3\": \"<string>\",\n \"udf4\": \"<string>\",\n \"udf5\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paytring.com/api/v1/subscription/plan/create")
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 \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"<string>\",\n \"frequency\": 123,\n \"key\": \"<string>\",\n \"mer_reference_id\": \"<string>\",\n \"hash\": \"<string>\",\n \"cycle\": 12,\n \"currency\": \"<string>\",\n \"notes\": {\n \"udf1\": \"<string>\",\n \"udf2\": \"<string>\",\n \"udf3\": \"<string>\",\n \"udf4\": \"<string>\",\n \"udf5\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body"{}""{}"Subscription Management
Create Plan
POST
/
api
/
v1
/
subscription
/
plan
/
create
Create Plan
curl --request POST \
--url https://api.paytring.com/api/v1/subscription/plan/create \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"amount": "<string>",
"frequency": 123,
"key": "<string>",
"mer_reference_id": "<string>",
"hash": "<string>",
"cycle": 12,
"currency": "<string>",
"notes": {
"udf1": "<string>",
"udf2": "<string>",
"udf3": "<string>",
"udf4": "<string>",
"udf5": "<string>"
}
}
'import requests
url = "https://api.paytring.com/api/v1/subscription/plan/create"
payload = {
"title": "<string>",
"description": "<string>",
"amount": "<string>",
"frequency": 123,
"key": "<string>",
"mer_reference_id": "<string>",
"hash": "<string>",
"cycle": 12,
"currency": "<string>",
"notes": {
"udf1": "<string>",
"udf2": "<string>",
"udf3": "<string>",
"udf4": "<string>",
"udf5": "<string>"
}
}
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({
title: '<string>',
description: '<string>',
amount: '<string>',
frequency: 123,
key: '<string>',
mer_reference_id: '<string>',
hash: '<string>',
cycle: 12,
currency: '<string>',
notes: {
udf1: '<string>',
udf2: '<string>',
udf3: '<string>',
udf4: '<string>',
udf5: '<string>'
}
})
};
fetch('https://api.paytring.com/api/v1/subscription/plan/create', 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.paytring.com/api/v1/subscription/plan/create",
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([
'title' => '<string>',
'description' => '<string>',
'amount' => '<string>',
'frequency' => 123,
'key' => '<string>',
'mer_reference_id' => '<string>',
'hash' => '<string>',
'cycle' => 12,
'currency' => '<string>',
'notes' => [
'udf1' => '<string>',
'udf2' => '<string>',
'udf3' => '<string>',
'udf4' => '<string>',
'udf5' => '<string>'
]
]),
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.paytring.com/api/v1/subscription/plan/create"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"<string>\",\n \"frequency\": 123,\n \"key\": \"<string>\",\n \"mer_reference_id\": \"<string>\",\n \"hash\": \"<string>\",\n \"cycle\": 12,\n \"currency\": \"<string>\",\n \"notes\": {\n \"udf1\": \"<string>\",\n \"udf2\": \"<string>\",\n \"udf3\": \"<string>\",\n \"udf4\": \"<string>\",\n \"udf5\": \"<string>\"\n }\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.paytring.com/api/v1/subscription/plan/create")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"<string>\",\n \"frequency\": 123,\n \"key\": \"<string>\",\n \"mer_reference_id\": \"<string>\",\n \"hash\": \"<string>\",\n \"cycle\": 12,\n \"currency\": \"<string>\",\n \"notes\": {\n \"udf1\": \"<string>\",\n \"udf2\": \"<string>\",\n \"udf3\": \"<string>\",\n \"udf4\": \"<string>\",\n \"udf5\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paytring.com/api/v1/subscription/plan/create")
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 \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"<string>\",\n \"frequency\": 123,\n \"key\": \"<string>\",\n \"mer_reference_id\": \"<string>\",\n \"hash\": \"<string>\",\n \"cycle\": 12,\n \"currency\": \"<string>\",\n \"notes\": {\n \"udf1\": \"<string>\",\n \"udf2\": \"<string>\",\n \"udf3\": \"<string>\",\n \"udf4\": \"<string>\",\n \"udf5\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body"{}""{}"This API is used to create a subscription plan.
Request Body
{
"name": "string", // Name of the subscription plan
"amount": "integer", // Amount in cents/paisa
"currency": "string", // Currency code (e.g., USD, INR)
"interval": "string", // Billing interval (e.g., monthly, yearly)
"hash": "string" // Calculated hash for request validation
}
Responses
200 OK
{
"status": true,
"plan_id": "string",
"message": "Plan created successfully"
}
400 Bad Request
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
Body
application/json
no of days
Merchant key, available in dashboard profile section
to be calculated by key sort of all non-object key values of this request
how many times will we deduct this money.
Show child attributes
Show child attributes
Response
200
The response is of type object.
⌘I

