Manage Subscriptions
curl --request GET \
--url https://olp-api.nipuntheekshana.com/v1/subscriptionsimport requests
url = "https://olp-api.nipuntheekshana.com/v1/subscriptions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://olp-api.nipuntheekshana.com/v1/subscriptions', 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://olp-api.nipuntheekshana.com/v1/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://olp-api.nipuntheekshana.com/v1/subscriptions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://olp-api.nipuntheekshana.com/v1/subscriptions")
.asString();require 'uri'
require 'net/http'
url = URI("https://olp-api.nipuntheekshana.com/v1/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodySubscriptions
Manage Subscriptions
List, view, and cancel subscriptions
GET
/
v1
/
subscriptions
Manage Subscriptions
curl --request GET \
--url https://olp-api.nipuntheekshana.com/v1/subscriptionsimport requests
url = "https://olp-api.nipuntheekshana.com/v1/subscriptions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://olp-api.nipuntheekshana.com/v1/subscriptions', 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://olp-api.nipuntheekshana.com/v1/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://olp-api.nipuntheekshana.com/v1/subscriptions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://olp-api.nipuntheekshana.com/v1/subscriptions")
.asString();require 'uri'
require 'net/http'
url = URI("https://olp-api.nipuntheekshana.com/v1/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
All subscription management endpoints require a Bearer token in theAuthorization header.
Authorization: Bearer <your_jwt_token>
List Subscriptions
GET /v1/subscriptionsQuery Parameters
integer
default:"1"
The page number for pagination.
integer
default:"20"
The number of subscriptions per page. Maximum value is
100.string
Filter by subscription status. Accepted values:
active, trialing, cancelled, past_due, expired.string
Filter by a specific subscription plan ID.
Example Request
curl -X GET "https://olp-api.nipuntheekshana.com/v1/subscriptions?status=active&page=1&limit=10" \
-H "Authorization: Bearer <your_jwt_token>"
Example Response
{
"subscriptions": [
{
"id": "sub_abc123def456",
"planId": "plan_abc123def456",
"planName": "Pro Monthly",
"customerEmail": "alice@example.com",
"customerName": "Alice Johnson",
"status": "active",
"currentPeriodStart": "2026-03-26T14:30:00Z",
"currentPeriodEnd": "2026-04-26T14:30:00Z",
"createdAt": "2026-03-12T14:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 42,
"totalPages": 5
}
}
Get Subscription Details
GET /v1/subscriptions/{id}Path Parameters
string
required
The unique identifier of the subscription.
Example Request
curl -X GET "https://olp-api.nipuntheekshana.com/v1/subscriptions/sub_abc123def456" \
-H "Authorization: Bearer <your_jwt_token>"
Example Response
{
"id": "sub_abc123def456",
"planId": "plan_abc123def456",
"planName": "Pro Monthly",
"amount": 29.99,
"currency": "USD",
"interval": "monthly",
"customerEmail": "alice@example.com",
"customerName": "Alice Johnson",
"walletAddress": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef12",
"status": "active",
"currentPeriodStart": "2026-03-26T14:30:00Z",
"currentPeriodEnd": "2026-04-26T14:30:00Z",
"trialEnd": null,
"cancelledAt": null,
"createdAt": "2026-03-12T14:30:00Z"
}
Cancel Subscription
POST /v1/subscriptions/{id}/cancelPath Parameters
string
required
The unique identifier of the subscription to cancel.
Example Request
curl -X POST "https://olp-api.nipuntheekshana.com/v1/subscriptions/sub_abc123def456/cancel" \
-H "Authorization: Bearer <your_jwt_token>"
Example Response
{
"id": "sub_abc123def456",
"status": "cancelled",
"cancelledAt": "2026-03-26T15:00:00Z",
"currentPeriodEnd": "2026-04-26T14:30:00Z",
"message": "Subscription cancelled. Access remains active until the end of the current billing period."
}
Subscription Statuses
| Status | Description |
|---|---|
active | The subscription is active and payments are being collected |
trialing | The subscription is in its free trial period |
past_due | A renewal payment failed; the system will retry |
cancelled | The subscription has been cancelled; active until period end |
expired | The subscription has fully expired after cancellation |