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": "925e28b4-c5b3-468e-8e13-3a9e0b9b5d13",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1798655954,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"proration_method": "unused_amount_paid",
"quantity": 1,
"renewal": false,
"renewal_reminder_sent_at": null,
"restoral": false,
"start_at": 1796063954,
"status": "paid",
"checkout": "d26e96ce-c674-4f1b-a81c-082fb3514dbf",
"price": "c2aca279-6f8d-448d-acb5-fd5daa098030",
"subscription": "5fdf14ec-43d1-4e22-8733-4f36b8336cdf",
"variant": null,
"created_at": 1796063954,
"updated_at": 1796063954
},
{
"id": "fcde3407-cf16-49c8-8af1-34722c856f6c",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1798655954,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"proration_method": "unused_amount_paid",
"quantity": 1,
"renewal": false,
"renewal_reminder_sent_at": null,
"restoral": false,
"start_at": 1796063954,
"status": "paid",
"checkout": "483cb932-abf9-485f-b6ac-3ecb3095b10f",
"price": "c2aca279-6f8d-448d-acb5-fd5daa098030",
"subscription": "5fdf14ec-43d1-4e22-8733-4f36b8336cdf",
"variant": null,
"created_at": 1796063954,
"updated_at": 1796063954
}
]
}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": "925e28b4-c5b3-468e-8e13-3a9e0b9b5d13",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1798655954,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"proration_method": "unused_amount_paid",
"quantity": 1,
"renewal": false,
"renewal_reminder_sent_at": null,
"restoral": false,
"start_at": 1796063954,
"status": "paid",
"checkout": "d26e96ce-c674-4f1b-a81c-082fb3514dbf",
"price": "c2aca279-6f8d-448d-acb5-fd5daa098030",
"subscription": "5fdf14ec-43d1-4e22-8733-4f36b8336cdf",
"variant": null,
"created_at": 1796063954,
"updated_at": 1796063954
},
{
"id": "fcde3407-cf16-49c8-8af1-34722c856f6c",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1798655954,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"proration_method": "unused_amount_paid",
"quantity": 1,
"renewal": false,
"renewal_reminder_sent_at": null,
"restoral": false,
"start_at": 1796063954,
"status": "paid",
"checkout": "483cb932-abf9-485f-b6ac-3ecb3095b10f",
"price": "c2aca279-6f8d-448d-acb5-fd5daa098030",
"subscription": "5fdf14ec-43d1-4e22-8733-4f36b8336cdf",
"variant": null,
"created_at": 1796063954,
"updated_at": 1796063954
}
]
}Authorizations
Query Parameters
Was this page helpful?