Skip to main content
GET
/
workspaces
/
{workspaceId}
/
billing-accounts
/
{billingAccountId}
/
subscriptions
/
{subscriptionId}
Retrieve a subscription
curl --request GET \
  --url https://v1.api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/subscriptions/{subscriptionId} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://v1.api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/subscriptions/{subscriptionId}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://v1.api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/subscriptions/{subscriptionId}', 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://v1.api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/subscriptions/{subscriptionId}",
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://v1.api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/subscriptions/{subscriptionId}"

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://v1.api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/subscriptions/{subscriptionId}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://v1.api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/subscriptions/{subscriptionId}")

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
{
  "id": "sub_a1b2c3d4e5f6g7h8",
  "billing_account_id": "cus_a1b2c3d4e5f6g7h8",
  "status": "active",
  "currency": "usd",
  "product_quantities": {
    "locations": {
      "price_id": "price_123abc",
      "quantity": 10,
      "interval": "month"
    },
    "users": {
      "price_id": "price_456def",
      "quantity": 50,
      "interval": "month"
    }
  },
  "metadata": {
    "order_id": "6735"
  },
  "current_period_start": "2025-10-15T00:00:00Z",
  "current_period_end": "2025-11-15T00:00:00Z",
  "created_at": "2025-10-15T12:30:00Z",
  "updated_at": "2025-10-20T09:00:00Z"
}

Authorizations

Authorization
string
header
required

Enter your JWT in the format: Bearer {token}

Path Parameters

workspaceId
string
required

The ID of the workspace.

Example:

"ws_a1b2c3d4e5f6g7h8"

billingAccountId
string
required

The ID of the billing account, which corresponds to a Stripe Customer ID (cus_...).

Example:

"cus_a1b2c3d4e5f6g7h8"

subscriptionId
string
required

The ID of the Stripe subscription (sub_...).

Example:

"sub_a1b2c3d4e5f6g7h8"

Response

The requested subscription object.

id
string

Unique identifier for the subscription (Stripe Subscription ID), prefixed with sub_.

Example:

"sub_a1b2c3d4e5f6g7h8"

billing_account_id
string

The ID of the billing account this subscription belongs to.

Example:

"cus_a1b2c3d4e5f6g7h8"

status
enum<string>

The status of the subscription.

Available options:
active,
past_due,
unpaid,
canceled,
incomplete,
incomplete_expired,
trialing,
paused
Example:

"active"

currency
enum<string>

The three-letter ISO currency code for the subscription.

Available options:
usd,
zar,
eur,
gbp,
aud
Example:

"usd"

product_quantities
object

A map of meterable product types to their subscribed quantities and pricing details.

Example:
{
"locations": {
"price_id": "price_123abc",
"quantity": 10,
"interval": "month"
},
"users": {
"price_id": "price_456def",
"quantity": 50,
"interval": "month"
}
}
metadata
object

A set of key-value pairs that you can attach to an object.

Example:
{ "order_id": "6735" }
current_period_start
string<date-time> | null

The start of the current billing period.

Example:

"2025-10-15T00:00:00Z"

current_period_end
string<date-time> | null

The end of the current billing period.

Example:

"2025-11-15T00:00:00Z"

created_at
string<date-time> | null

The timestamp when the subscription was created.

Example:

"2025-10-15T12:30:00Z"

updated_at
string<date-time> | null

The timestamp when the subscription was last updated in our system.

Example:

"2025-10-20T09:00:00Z"