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": "f22e5b12-b533-4496-919f-e24e3e3b25f6",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1785077863,
"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": 1782485863,
"status": "paid",
"checkout": "b8290402-48d3-4fbe-896b-74b543079c12",
"price": "a825de3b-ec1c-400f-83ae-4065f1e4ff9c",
"subscription": "0363f444-2177-4bf8-abe4-09cd201b5d14",
"variant": null,
"created_at": 1782485863,
"updated_at": 1782485863
},
{
"id": "070e0872-24b0-4fc4-bd8a-c583ddf4b98d",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1785077863,
"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": 1782485863,
"status": "paid",
"checkout": "18f8c436-9ef9-4965-8d2d-44f2b33d59cb",
"price": "a825de3b-ec1c-400f-83ae-4065f1e4ff9c",
"subscription": "0363f444-2177-4bf8-abe4-09cd201b5d14",
"variant": null,
"created_at": 1782485863,
"updated_at": 1782485863
}
]
}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": "f22e5b12-b533-4496-919f-e24e3e3b25f6",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1785077863,
"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": 1782485863,
"status": "paid",
"checkout": "b8290402-48d3-4fbe-896b-74b543079c12",
"price": "a825de3b-ec1c-400f-83ae-4065f1e4ff9c",
"subscription": "0363f444-2177-4bf8-abe4-09cd201b5d14",
"variant": null,
"created_at": 1782485863,
"updated_at": 1782485863
},
{
"id": "070e0872-24b0-4fc4-bd8a-c583ddf4b98d",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1785077863,
"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": 1782485863,
"status": "paid",
"checkout": "18f8c436-9ef9-4965-8d2d-44f2b33d59cb",
"price": "a825de3b-ec1c-400f-83ae-4065f1e4ff9c",
"subscription": "0363f444-2177-4bf8-abe4-09cd201b5d14",
"variant": null,
"created_at": 1782485863,
"updated_at": 1782485863
}
]
}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