Retrieve subscription
curl --request GET \
--url https://api.piriod.com/subscriptions/{id}/ \
--header 'Authorization: <api-key>' \
--header 'x-simple-workspace: <x-simple-workspace>'import requests
url = "https://api.piriod.com/subscriptions/{id}/"
headers = {
"x-simple-workspace": "<x-simple-workspace>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-simple-workspace': '<x-simple-workspace>', Authorization: '<api-key>'}
};
fetch('https://api.piriod.com/subscriptions/{id}/', 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.piriod.com/subscriptions/{id}/",
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: <api-key>",
"x-simple-workspace: <x-simple-workspace>"
],
]);
$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.piriod.com/subscriptions/{id}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-simple-workspace", "<x-simple-workspace>")
req.Header.Add("Authorization", "<api-key>")
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.piriod.com/subscriptions/{id}/")
.header("x-simple-workspace", "<x-simple-workspace>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.piriod.com/subscriptions/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-simple-workspace"] = '<x-simple-workspace>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customer": "<string>",
"document": 123,
"date_start": "2023-12-25",
"next_billing": "2023-12-25",
"lines": [
{
"plan": "<string>",
"quantity": 2,
"id": "<string>",
"coupon": "<string>",
"coupon_redemptions": 123,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}
],
"id": "<string>",
"previous_billing": "2023-12-25",
"billing_cycles": 123,
"next_billing_cycle": 1,
"expiration_days": 10,
"collection_scheme": "send_invoice",
"default_source": "<string>",
"custom_change": 2,
"coupon": "<string>",
"coupon_redemptions": 123,
"require_reference": false,
"note": "<string>",
"orgunit": 123,
"status": "active",
"status_description": "<string>",
"needs_attention": "2023-11-07T05:31:56Z",
"needs_attention_reason": "biller_issue",
"cancel_reason": "custom",
"cancelled": "2023-11-07T05:31:56Z",
"paused": "2023-11-07T05:31:56Z",
"paused_reason": "not_specified",
"pause_until": "2023-12-25",
"addons": [
{
"addon": "<string>",
"quantity": 2,
"addon_redemptions": 123,
"rates": [
{
"billing_cycle": 123,
"percentage": 123,
"description": "<string>"
}
]
}
],
"references": [
{
"date": "2023-12-25",
"document": "<string>",
"serial": "<string>",
"date_end": "2023-12-25",
"description": "<string>"
}
],
"test_mode": true,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}{
"detail": "Authentication credentials were not provided."
}Subscriptions
Retrieve subscription
GET
/
subscriptions
/
{id}
/
Retrieve subscription
curl --request GET \
--url https://api.piriod.com/subscriptions/{id}/ \
--header 'Authorization: <api-key>' \
--header 'x-simple-workspace: <x-simple-workspace>'import requests
url = "https://api.piriod.com/subscriptions/{id}/"
headers = {
"x-simple-workspace": "<x-simple-workspace>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-simple-workspace': '<x-simple-workspace>', Authorization: '<api-key>'}
};
fetch('https://api.piriod.com/subscriptions/{id}/', 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.piriod.com/subscriptions/{id}/",
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: <api-key>",
"x-simple-workspace: <x-simple-workspace>"
],
]);
$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.piriod.com/subscriptions/{id}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-simple-workspace", "<x-simple-workspace>")
req.Header.Add("Authorization", "<api-key>")
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.piriod.com/subscriptions/{id}/")
.header("x-simple-workspace", "<x-simple-workspace>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.piriod.com/subscriptions/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-simple-workspace"] = '<x-simple-workspace>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customer": "<string>",
"document": 123,
"date_start": "2023-12-25",
"next_billing": "2023-12-25",
"lines": [
{
"plan": "<string>",
"quantity": 2,
"id": "<string>",
"coupon": "<string>",
"coupon_redemptions": 123,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}
],
"id": "<string>",
"previous_billing": "2023-12-25",
"billing_cycles": 123,
"next_billing_cycle": 1,
"expiration_days": 10,
"collection_scheme": "send_invoice",
"default_source": "<string>",
"custom_change": 2,
"coupon": "<string>",
"coupon_redemptions": 123,
"require_reference": false,
"note": "<string>",
"orgunit": 123,
"status": "active",
"status_description": "<string>",
"needs_attention": "2023-11-07T05:31:56Z",
"needs_attention_reason": "biller_issue",
"cancel_reason": "custom",
"cancelled": "2023-11-07T05:31:56Z",
"paused": "2023-11-07T05:31:56Z",
"paused_reason": "not_specified",
"pause_until": "2023-12-25",
"addons": [
{
"addon": "<string>",
"quantity": 2,
"addon_redemptions": 123,
"rates": [
{
"billing_cycle": 123,
"percentage": 123,
"description": "<string>"
}
]
}
],
"references": [
{
"date": "2023-12-25",
"document": "<string>",
"serial": "<string>",
"date_end": "2023-12-25",
"description": "<string>"
}
],
"test_mode": true,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}{
"detail": "Authentication credentials were not provided."
}Authorizations
Use header Authorization: Token <api_token>.
API tokens are obtained from the Piriod dashboard.
Headers
Workspace (account) identifier. Required for every request.
Whether to operate against test-mode data. Defaults to false.
Path Parameters
Resource identifier.
Response
The subscription.
Customer ID.
Document type ID used to issue invoices.
Show child attributes
Show child attributes
Total cycles or null for indefinite.
Days until invoices generated by this subscription expire.
Available options:
send_invoice, charge_payment Default payment source ID. Required when collection_scheme=charge_payment.
Custom currency conversion factor for issued invoices.
Required range:
x >= 1Coupon ID applied at the subscription (invoice-level) scope.
Maximum string length:
100Available options:
active, paused, cancelled, finalized, needs_attention Maximum string length:
512Available options:
biller_issue, gateway_issue, reference_expired, without_usage_records, processing_issue, without_reference Available options:
custom, fraud_review_failed, insolvency, no_card, non_compliant_customer, not_paid, not_specified, shutdown_ops Available options:
not_specified, non_compliant_customer, custom Show child attributes
Show child attributes
Show child attributes
Show child attributes
