List
curl --request GET \
--url https://{defaultHost}/v1/periods \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/periods"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/periods', 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://{defaultHost}/v1/periods",
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://{defaultHost}/v1/periods"
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://{defaultHost}/v1/periods")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/periods")
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{
"object": "list",
"pagination": {
"count": 2,
"limit": 20,
"page": 1,
"url": "/v1/periods"
},
"data": [
{
"id": "2ff29f93-8cb3-40f8-8271-2d60da15eab6",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1789906823,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"quantity": 1,
"renewal": false,
"renewal_reminder_sent_at": null,
"restoral": false,
"skip_proration": false,
"start_at": 1787228423,
"status": "paid",
"checkout": "83321678-1676-42ef-8735-bd685ad8136d",
"price": "650a359f-74b5-4ece-82d4-5d987d579142",
"subscription": "e93ef1a1-3240-408f-a642-76eb53d4007b",
"variant": null,
"created_at": 1787228423,
"updated_at": 1787228423
},
{
"id": "745a164e-3dd4-4635-b7be-188a15bc6b42",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1789906823,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"quantity": 1,
"renewal": false,
"renewal_reminder_sent_at": null,
"restoral": false,
"skip_proration": false,
"start_at": 1787228423,
"status": "paid",
"checkout": "fa8c6690-6c28-470c-a303-115be41219a6",
"price": "650a359f-74b5-4ece-82d4-5d987d579142",
"subscription": "e93ef1a1-3240-408f-a642-76eb53d4007b",
"variant": null,
"created_at": 1787228423,
"updated_at": 1787228423
}
]
}Periods
List
Returns a list of periods.
GET
/
v1
/
periods
List
curl --request GET \
--url https://{defaultHost}/v1/periods \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/periods"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/periods', 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://{defaultHost}/v1/periods",
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://{defaultHost}/v1/periods"
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://{defaultHost}/v1/periods")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/periods")
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{
"object": "list",
"pagination": {
"count": 2,
"limit": 20,
"page": 1,
"url": "/v1/periods"
},
"data": [
{
"id": "2ff29f93-8cb3-40f8-8271-2d60da15eab6",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1789906823,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"quantity": 1,
"renewal": false,
"renewal_reminder_sent_at": null,
"restoral": false,
"skip_proration": false,
"start_at": 1787228423,
"status": "paid",
"checkout": "83321678-1676-42ef-8735-bd685ad8136d",
"price": "650a359f-74b5-4ece-82d4-5d987d579142",
"subscription": "e93ef1a1-3240-408f-a642-76eb53d4007b",
"variant": null,
"created_at": 1787228423,
"updated_at": 1787228423
},
{
"id": "745a164e-3dd4-4635-b7be-188a15bc6b42",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1789906823,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"quantity": 1,
"renewal": false,
"renewal_reminder_sent_at": null,
"restoral": false,
"skip_proration": false,
"start_at": 1787228423,
"status": "paid",
"checkout": "fa8c6690-6c28-470c-a303-115be41219a6",
"price": "650a359f-74b5-4ece-82d4-5d987d579142",
"subscription": "e93ef1a1-3240-408f-a642-76eb53d4007b",
"variant": null,
"created_at": 1787228423,
"updated_at": 1787228423
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Only return objects with the given IDs.
A limit on the number of items to be returned, between 1 and 100.
The page of items you want returned.
Only return objects that belong to the given subscriptions.
Was this page helpful?
⌘I