Altostrat Studio is here — the AI-native network operations IDE for engineers running production. Terminal, diagrams, runbooks, and Copilot in one workspace. Get started →
curl --request POST \
--url https://v1.api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/invoices/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscription_id": "sub_a1b2c3d4e5f6g7h8",
"items": [
{
"product_type": "locations",
"quantity": 15,
"interval": "month"
}
],
"cancel_subscription": false
}
'{
"id": "in_1Kb...",
"customer_id": "cus_...",
"status": "paid",
"amount_due": 999,
"amount_paid": 999,
"currency": "usd",
"created_at": "2025-10-29T00:40:06.000000Z",
"subtotal": 1099,
"total": 999,
"tax": 0,
"discount_amount": 100,
"discount_names": [
"10% Off Coupon"
],
"lines": [
{
"id": "il_1Kb...",
"description": "10 × Locations",
"amount": 1000,
"currency": "usd",
"quantity": 10,
"price_id": "price_...",
"unit_amount": 100,
"product_name": "Locations"
}
],
"due_date": null,
"hosted_invoice_url": "https://invoice.stripe.com/...",
"invoice_pdf": "https://pay.stripe.com/...",
"number": "AB123-001"
}Previews an upcoming invoice for a billing account, showing the financial impact of potential subscription changes, such as adding products or changing quantities. This does not modify any existing subscriptions.
curl --request POST \
--url https://v1.api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/invoices/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscription_id": "sub_a1b2c3d4e5f6g7h8",
"items": [
{
"product_type": "locations",
"quantity": 15,
"interval": "month"
}
],
"cancel_subscription": false
}
'{
"id": "in_1Kb...",
"customer_id": "cus_...",
"status": "paid",
"amount_due": 999,
"amount_paid": 999,
"currency": "usd",
"created_at": "2025-10-29T00:40:06.000000Z",
"subtotal": 1099,
"total": 999,
"tax": 0,
"discount_amount": 100,
"discount_names": [
"10% Off Coupon"
],
"lines": [
{
"id": "il_1Kb...",
"description": "10 × Locations",
"amount": 1000,
"currency": "usd",
"quantity": 10,
"price_id": "price_...",
"unit_amount": 100,
"product_name": "Locations"
}
],
"due_date": null,
"hosted_invoice_url": "https://invoice.stripe.com/...",
"invoice_pdf": "https://pay.stripe.com/...",
"number": "AB123-001"
}Documentation Index
Fetch the complete documentation index at: https://altostrat.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Enter your JWT in the format: Bearer {token}
The ID of the workspace.
"ws_a1b2c3d4e5f6g7h8"
The ID of the billing account, which corresponds to a Stripe Customer ID (cus_...).
"cus_a1b2c3d4e5f6g7h8"
The ID of an existing subscription to preview changes for. If omitted, previews a new subscription.
"sub_a1b2c3d4e5f6g7h8"
A list of products and their new quantities to preview. To remove a product, set its quantity to 0 or omit it.
Show child attributes
Set to true to preview the invoice for canceling the subscription at the end of the current period.
false
The previewed invoice object.
"in_1Kb..."
"cus_..."
"paid"
Final amount due in the smallest currency unit (e.g., cents).
999
The amount paid on this invoice in the smallest currency unit.
999
"usd"
"2025-10-29T00:40:06.000000Z"
Total of all line items before discounts and taxes.
1099
Total after discounts and taxes.
999
The amount of tax on this invoice.
0
The total discount amount applied to this invoice.
100
["10% Off Coupon"]Show child attributes
null
"https://invoice.stripe.com/..."
"https://pay.stripe.com/..."
"AB123-001"
Was this page helpful?