Subscription Plans
curl --request POST \
--url https://api-sandbox.pavewaygroup.com/v1/subscriptions/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"amount": 123,
"currency": "<string>",
"billing_cycle": "<string>",
"trial_days": 123
}
'import requests
url = "https://api-sandbox.pavewaygroup.com/v1/subscriptions/plans"
payload = {
"name": "<string>",
"code": "<string>",
"amount": 123,
"currency": "<string>",
"billing_cycle": "<string>",
"trial_days": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
amount: 123,
currency: '<string>',
billing_cycle: '<string>',
trial_days: 123
})
};
fetch('https://api-sandbox.pavewaygroup.com/v1/subscriptions/plans', 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-sandbox.pavewaygroup.com/v1/subscriptions/plans",
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([
'name' => '<string>',
'code' => '<string>',
'amount' => 123,
'currency' => '<string>',
'billing_cycle' => '<string>',
'trial_days' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-sandbox.pavewaygroup.com/v1/subscriptions/plans"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"billing_cycle\": \"<string>\",\n \"trial_days\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.pavewaygroup.com/v1/subscriptions/plans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"billing_cycle\": \"<string>\",\n \"trial_days\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.pavewaygroup.com/v1/subscriptions/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"billing_cycle\": \"<string>\",\n \"trial_days\": 123\n}"
response = http.request(request)
puts response.read_body{
"status_code": 200,
"data": {
"id": "658dc...",
"name": "Silver Monthly",
"code": "silver_v1",
"amount": 5000,
"currency": "XAF",
"billing_cycle": "monthly"
}
}
Subscriptions API
Subscription Plans
Manage recurring billing tiers and pricing structures.
POST
/
subscriptions
/
plans
Subscription Plans
curl --request POST \
--url https://api-sandbox.pavewaygroup.com/v1/subscriptions/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"amount": 123,
"currency": "<string>",
"billing_cycle": "<string>",
"trial_days": 123
}
'import requests
url = "https://api-sandbox.pavewaygroup.com/v1/subscriptions/plans"
payload = {
"name": "<string>",
"code": "<string>",
"amount": 123,
"currency": "<string>",
"billing_cycle": "<string>",
"trial_days": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
amount: 123,
currency: '<string>',
billing_cycle: '<string>',
trial_days: 123
})
};
fetch('https://api-sandbox.pavewaygroup.com/v1/subscriptions/plans', 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-sandbox.pavewaygroup.com/v1/subscriptions/plans",
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([
'name' => '<string>',
'code' => '<string>',
'amount' => 123,
'currency' => '<string>',
'billing_cycle' => '<string>',
'trial_days' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-sandbox.pavewaygroup.com/v1/subscriptions/plans"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"billing_cycle\": \"<string>\",\n \"trial_days\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.pavewaygroup.com/v1/subscriptions/plans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"billing_cycle\": \"<string>\",\n \"trial_days\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.pavewaygroup.com/v1/subscriptions/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"billing_cycle\": \"<string>\",\n \"trial_days\": 123\n}"
response = http.request(request)
puts response.read_body{
"status_code": 200,
"data": {
"id": "658dc...",
"name": "Silver Monthly",
"code": "silver_v1",
"amount": 5000,
"currency": "XAF",
"billing_cycle": "monthly"
}
}
Plans define the cost and frequency of a recurring charge.
Create a Plan
POST /subscriptions/plans
Name shown to customers (e.g., “Silver Monthly”).
Unique slug for your plan (e.g.,
silver_v1).Price per period.
XAF, NGN, USD, etc.Frequency:
daily, weekly, monthly, quarterly, yearly.Number of free trial days before the first charge.
{
"status_code": 200,
"data": {
"id": "658dc...",
"name": "Silver Monthly",
"code": "silver_v1",
"amount": 5000,
"currency": "XAF",
"billing_cycle": "monthly"
}
}
List Plans
GET /subscriptions/plans
Deactivate Plan
DELETE /subscriptions/plans/{id}⌘I

