Skip to main content
PATCH
/
subscription
/
api
/
v1
/
subscription-plans
/
{planCode}
Update Plan Details
curl --request PATCH \
  --url https://api.payaza.africa/live/subscription/api/v1/subscription-plans/{planCode} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Pro Monthly Plus",
  "description": "Updated monthly subscription",
  "trialPeriodDays": 7,
  "billingLimit": 24
}
'
import requests

url = "https://api.payaza.africa/live/subscription/api/v1/subscription-plans/{planCode}"

payload = {
"name": "Pro Monthly Plus",
"description": "Updated monthly subscription",
"trialPeriodDays": 7,
"billingLimit": 24
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Pro Monthly Plus',
description: 'Updated monthly subscription',
trialPeriodDays: 7,
billingLimit: 24
})
};

fetch('https://api.payaza.africa/live/subscription/api/v1/subscription-plans/{planCode}', 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.payaza.africa/live/subscription/api/v1/subscription-plans/{planCode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Pro Monthly Plus',
'description' => 'Updated monthly subscription',
'trialPeriodDays' => 7,
'billingLimit' => 24
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.payaza.africa/live/subscription/api/v1/subscription-plans/{planCode}"

payload := strings.NewReader("{\n \"name\": \"Pro Monthly Plus\",\n \"description\": \"Updated monthly subscription\",\n \"trialPeriodDays\": 7,\n \"billingLimit\": 24\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "<api-key>")
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.patch("https://api.payaza.africa/live/subscription/api/v1/subscription-plans/{planCode}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Pro Monthly Plus\",\n \"description\": \"Updated monthly subscription\",\n \"trialPeriodDays\": 7,\n \"billingLimit\": 24\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.payaza.africa/live/subscription/api/v1/subscription-plans/{planCode}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Pro Monthly Plus\",\n \"description\": \"Updated monthly subscription\",\n \"trialPeriodDays\": 7,\n \"billingLimit\": 24\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "message": "Plan updated",
  "data": {
    "id": 34,
    "name": "The FIRST Day",
    "description": "Superior marketing",
    "amount": 800,
    "currency": "NGN",
    "interval": "MONTHLY",
    "intervalCount": 1,
    "trialPeriodDays": 5,
    "billingLimit": 2,
    "status": "ACTIVE",
    "planCode": "PLN_DD41251",
    "billingDaysOfWeek": null,
    "metadata": null,
    "createdAt": "2026-07-08T16:42:53.051861",
    "updatedAt": "2026-07-08T17:25:31.342977889"
  }
}

Authorizations

Authorization
string
header
required

Payaza {{Public API Key in Base 64}}

Path Parameters

planCode
string
required

The unique identifier of the subscription plan.

Body

application/json
name
string

The updated name of the subscription plan.

Example:

"Pro Monthly Plus"

description
string

The updated description of the plan.

Example:

"Updated monthly subscription"

trialPeriodDays
integer

The updated trial period in days.

Example:

7

billingLimit
integer

The updated maximum number of billing cycles.

Example:

24

Response

200 - application/json

Subscription plan details updated successfully

success
boolean

Indicates if the request was successful.

Example:

true

message
string

Descriptive message regarding the plan update operation.

Example:

"Plan updated"

data
object

The payload containing the details of the updated plan.