Get Price Intervals
curl --request GET \
--url https://api.paygentic.io/v0/subscriptions/{id}/intervals \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/subscriptions/{id}/intervals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/subscriptions/{id}/intervals', 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.paygentic.io/v0/subscriptions/{id}/intervals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.paygentic.io/v0/subscriptions/{id}/intervals"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paygentic.io/v0/subscriptions/{id}/intervals")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/subscriptions/{id}/intervals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"intervals": [
{
"id": "spi_p9q0r1s2t3u4v5w6",
"priceId": "price_x7y8z9a0b1c2d3e4",
"priceKey": "pk_m4n5o6p7q8r9s0t1",
"planVersionId": "pv_u2v3w4x5y6z7a8b9",
"unitPrice": null,
"baseQuantity": "1",
"quantityTransitions": [],
"billingCadence": "P1M",
"billingMode": "advance",
"billDate": null,
"startDate": "2024-02-01T14:45:30Z",
"endDate": null
}
]
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Subscriptions
Get Price Intervals
Returns the price intervals that the subscription bills now. If there are none, returns an empty array.
GET
/
v0
/
subscriptions
/
{id}
/
intervals
Get Price Intervals
curl --request GET \
--url https://api.paygentic.io/v0/subscriptions/{id}/intervals \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/subscriptions/{id}/intervals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/subscriptions/{id}/intervals', 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.paygentic.io/v0/subscriptions/{id}/intervals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.paygentic.io/v0/subscriptions/{id}/intervals"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paygentic.io/v0/subscriptions/{id}/intervals")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/subscriptions/{id}/intervals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"intervals": [
{
"id": "spi_p9q0r1s2t3u4v5w6",
"priceId": "price_x7y8z9a0b1c2d3e4",
"priceKey": "pk_m4n5o6p7q8r9s0t1",
"planVersionId": "pv_u2v3w4x5y6z7a8b9",
"unitPrice": null,
"baseQuantity": "1",
"quantityTransitions": [],
"billingCadence": "P1M",
"billingMode": "advance",
"billDate": null,
"startDate": "2024-02-01T14:45:30Z",
"endDate": null
}
]
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Path Parameters
The subscription ID
Response
The subscription's current price intervals.
The subscription's price intervals, ordered by start date. Empty when it has none.
Show child attributes
Show child attributes
Was this page helpful?