Update a plan
curl --request PATCH \
--url https://payments.oaknetwork.org/api/v1/subscription/plans/{planId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"frequency": 123,
"price": 123,
"currency": "<string>",
"created_by": "<string>",
"overridden_price": 123,
"start_time": "2023-12-25",
"end_time": "2023-12-25",
"is_auto_renewable": true,
"allow_amount_override": true,
"campaign_id": "<string>",
"campaign_name": "<string>"
}
'import requests
url = "https://payments.oaknetwork.org/api/v1/subscription/plans/{planId}"
payload = {
"name": "<string>",
"description": "<string>",
"frequency": 123,
"price": 123,
"currency": "<string>",
"created_by": "<string>",
"overridden_price": 123,
"start_time": "2023-12-25",
"end_time": "2023-12-25",
"is_auto_renewable": True,
"allow_amount_override": True,
"campaign_id": "<string>",
"campaign_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
frequency: 123,
price: 123,
currency: '<string>',
created_by: '<string>',
overridden_price: 123,
start_time: '2023-12-25',
end_time: '2023-12-25',
is_auto_renewable: true,
allow_amount_override: true,
campaign_id: '<string>',
campaign_name: '<string>'
})
};
fetch('https://payments.oaknetwork.org/api/v1/subscription/plans/{planId}', 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://payments.oaknetwork.org/api/v1/subscription/plans/{planId}",
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' => '<string>',
'description' => '<string>',
'frequency' => 123,
'price' => 123,
'currency' => '<string>',
'created_by' => '<string>',
'overridden_price' => 123,
'start_time' => '2023-12-25',
'end_time' => '2023-12-25',
'is_auto_renewable' => true,
'allow_amount_override' => true,
'campaign_id' => '<string>',
'campaign_name' => '<string>'
]),
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://payments.oaknetwork.org/api/v1/subscription/plans/{planId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"frequency\": 123,\n \"price\": 123,\n \"currency\": \"<string>\",\n \"created_by\": \"<string>\",\n \"overridden_price\": 123,\n \"start_time\": \"2023-12-25\",\n \"end_time\": \"2023-12-25\",\n \"is_auto_renewable\": true,\n \"allow_amount_override\": true,\n \"campaign_id\": \"<string>\",\n \"campaign_name\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://payments.oaknetwork.org/api/v1/subscription/plans/{planId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"frequency\": 123,\n \"price\": 123,\n \"currency\": \"<string>\",\n \"created_by\": \"<string>\",\n \"overridden_price\": 123,\n \"start_time\": \"2023-12-25\",\n \"end_time\": \"2023-12-25\",\n \"is_auto_renewable\": true,\n \"allow_amount_override\": true,\n \"campaign_id\": \"<string>\",\n \"campaign_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payments.oaknetwork.org/api/v1/subscription/plans/{planId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"frequency\": 123,\n \"price\": 123,\n \"currency\": \"<string>\",\n \"created_by\": \"<string>\",\n \"overridden_price\": 123,\n \"start_time\": \"2023-12-25\",\n \"end_time\": \"2023-12-25\",\n \"is_auto_renewable\": true,\n \"allow_amount_override\": true,\n \"campaign_id\": \"<string>\",\n \"campaign_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"msg": "plan updated",
"data": "<string>"
}Subscriptions
Update a plan
Update plan properties. All fields are optional.
PATCH
/
api
/
v1
/
subscription
/
plans
/
{planId}
Update a plan
curl --request PATCH \
--url https://payments.oaknetwork.org/api/v1/subscription/plans/{planId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"frequency": 123,
"price": 123,
"currency": "<string>",
"created_by": "<string>",
"overridden_price": 123,
"start_time": "2023-12-25",
"end_time": "2023-12-25",
"is_auto_renewable": true,
"allow_amount_override": true,
"campaign_id": "<string>",
"campaign_name": "<string>"
}
'import requests
url = "https://payments.oaknetwork.org/api/v1/subscription/plans/{planId}"
payload = {
"name": "<string>",
"description": "<string>",
"frequency": 123,
"price": 123,
"currency": "<string>",
"created_by": "<string>",
"overridden_price": 123,
"start_time": "2023-12-25",
"end_time": "2023-12-25",
"is_auto_renewable": True,
"allow_amount_override": True,
"campaign_id": "<string>",
"campaign_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
frequency: 123,
price: 123,
currency: '<string>',
created_by: '<string>',
overridden_price: 123,
start_time: '2023-12-25',
end_time: '2023-12-25',
is_auto_renewable: true,
allow_amount_override: true,
campaign_id: '<string>',
campaign_name: '<string>'
})
};
fetch('https://payments.oaknetwork.org/api/v1/subscription/plans/{planId}', 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://payments.oaknetwork.org/api/v1/subscription/plans/{planId}",
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' => '<string>',
'description' => '<string>',
'frequency' => 123,
'price' => 123,
'currency' => '<string>',
'created_by' => '<string>',
'overridden_price' => 123,
'start_time' => '2023-12-25',
'end_time' => '2023-12-25',
'is_auto_renewable' => true,
'allow_amount_override' => true,
'campaign_id' => '<string>',
'campaign_name' => '<string>'
]),
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://payments.oaknetwork.org/api/v1/subscription/plans/{planId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"frequency\": 123,\n \"price\": 123,\n \"currency\": \"<string>\",\n \"created_by\": \"<string>\",\n \"overridden_price\": 123,\n \"start_time\": \"2023-12-25\",\n \"end_time\": \"2023-12-25\",\n \"is_auto_renewable\": true,\n \"allow_amount_override\": true,\n \"campaign_id\": \"<string>\",\n \"campaign_name\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://payments.oaknetwork.org/api/v1/subscription/plans/{planId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"frequency\": 123,\n \"price\": 123,\n \"currency\": \"<string>\",\n \"created_by\": \"<string>\",\n \"overridden_price\": 123,\n \"start_time\": \"2023-12-25\",\n \"end_time\": \"2023-12-25\",\n \"is_auto_renewable\": true,\n \"allow_amount_override\": true,\n \"campaign_id\": \"<string>\",\n \"campaign_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payments.oaknetwork.org/api/v1/subscription/plans/{planId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"frequency\": 123,\n \"price\": 123,\n \"currency\": \"<string>\",\n \"created_by\": \"<string>\",\n \"overridden_price\": 123,\n \"start_time\": \"2023-12-25\",\n \"end_time\": \"2023-12-25\",\n \"is_auto_renewable\": true,\n \"allow_amount_override\": true,\n \"campaign_id\": \"<string>\",\n \"campaign_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"msg": "plan updated",
"data": "<string>"
}Authorizations
Merchant authentication token. Obtained via POST /api/v1/merchant/token/grant. Pass as: Authorization: Bearer
Path Parameters
Body
application/json
Billing frequency in days
Price amount
⌘I