---
search:
  tags:
    - billing
    - POST
seo:
  description: >-
    Preview an invoice. Reference for the POST /v1/invoices/preview endpoint in
    the Vortex Payments API.
sidebar:
  label: Preview an invoice
  badge: POST
title: Preview an invoice
type: openapi-operation
---
`POST /v1/invoices/preview`

**curl**

```bash
curl "https://api.vortex.nyc/v1/invoices/preview?environment=sandbox&merchantAccountId=..." \
  -X POST \
  -H "Authorization: Bearer $VORTEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customerId":"bcust_123","billingAccountId":"bacc_123","lineItems":[{"priceId":"price_core_monthly","quantity":1}]}'
```

**TypeScript**

```ts
import { previewInvoice, createVortex } from "@vortex-api/vortex/2026-09";

const vortex = createVortex({ apiKey: process.env.VORTEX_API_KEY });
const { data } = await previewInvoice({
  client: vortex,
  query: { environment: "sandbox", merchantAccountId: "..." },
  body: {"customerId":"bcust_123","billingAccountId":"bacc_123","lineItems":[{"priceId":"price_core_monthly","quantity":1}]},
});
```

**Request body** (`application/json`, required)

- `customerId` (string, required)
- `billingAccountId` (string, required)
- `lineItems` (object[], required)
- `invoiceId` (string) — Caller-chosen invoice id; omit to auto-mint.
- `asOf` (string<date-time>)
- `couponId` (string)
- `tenantId` (string)
- `taxIdempotencyKey` (string)
- `customerTaxAddress` (TaxAddress)
- `customerTaxIds` (object[])
- `customerType` (string)
- `customerTaxExempt` (boolean)
- `customerTaxExemptionRef` (string)
- `fallbackOnProviderUnavailable` (boolean)
- `taxIdValidation` (string)
- `taxIdUnverifiableTreatment` (string)
- `shipFromAddress` (TaxAddress)
- `taxBehavior` (string)
- `classificationKey` (string)
- `metadata` (Metadata)

Request body example:

```json
{
  "customerId": "bcust_123",
  "billingAccountId": "bacc_123",
  "lineItems": [
    {
      "priceId": "price_core_monthly",
      "quantity": 1
    }
  ]
}
```

**Responses**

- `200` — Success
- `400` — Bad request, including malformed JSON
- `401` — Missing or invalid API key
- `409` — Conflict, including idempotency body drift
- `422` — Validation failed
- `429` — API key rate limit exceeded
- `default` — Error

Response example, 200:

```json
{
  "data": {},
  "requestId": "string"
}
```
