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

Response

200 - application/json

An invoice preview object.

The response is of type object.