Skip to main content
POST
/
workspaces
/
{workspace_id}
/
billing-accounts
/
{billing_account_id}
/
invoices
/
preview
Preview Invoice Changes
curl --request POST \
  --url https://api.altostrat.io/workspaces/{workspace_id}/billing-accounts/{billing_account_id}/invoices/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "subscription_id": "<string>",
  "items": {},
  "cancel_subscription": false
}'
{
  "id": "<string>",
  "customer_id": "<string>",
  "status": "draft",
  "amount_due": 123,
  "amount_paid": 123,
  "currency": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "subtotal": 123,
  "total": 123,
  "tax": 123,
  "discount_amount": 123,
  "discount_names": [
    "<string>"
  ],
  "lines": [
    {
      "id": "<string>",
      "description": "<string>",
      "amount": 123,
      "currency": "<string>",
      "quantity": 123,
      "price_id": "<string>",
      "unit_amount": 123,
      "product_name": "<string>"
    }
  ],
  "due_date": "2023-11-07T05:31:56Z",
  "hosted_invoice_url": "<string>",
  "invoice_pdf": "<string>",
  "number": "<string>"
}

Authorizations

Authorization
string
header
required

Auth0 JWT token for user authentication.

Path Parameters

workspace_id
string
required

The unique identifier for the workspace.

Example:

"ws_abc123"

billing_account_id
string
required

The unique identifier for the billing account (Stripe customer ID).

Example:

"cus_abc123"

Body

application/json
items
object
required
subscription_id
string
cancel_subscription
boolean
default:false

Response

200 - application/json

An invoice preview object.

id
string
customer_id
string
status
enum<string>
Available options:
draft,
open,
paid,
uncollectible,
void
amount_due
integer

Amount in cents

amount_paid
integer

Amount in cents

currency
string
created_at
string<date-time>
subtotal
integer
total
integer
tax
integer | null
discount_amount
integer | null
discount_names
string[]
lines
object[]
due_date
string<date-time> | null
hosted_invoice_url
string<uri> | null
invoice_pdf
string<uri> | null
number
string | null
I