Skip to main content
POST
/
v1
/
client-invoices
/
preview-pdf
Preview Client Invoice PDF
curl --request POST \
  --url https://api.spairehq.com/v1/client-invoices/preview-pdf \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "organization_id": "<string>",
  "currency": "<string>",
  "line_items": [
    {
      "description": "—",
      "quantity": 1,
      "unit_amount": 0
    }
  ],
  "customer_id": "<string>",
  "due_date": "2023-12-25",
  "memo": "<string>",
  "po_number": "<string>",
  "on_behalf_of_label": "<string>",
  "discount_amount": 0,
  "discount_label": "<string>",
  "include_payment_link": true,
  "checkout_link_url": "<string>",
  "show_logo": true,
  "show_mor_attribution": true,
  "billing_name": "<string>",
  "billing_line1": "<string>",
  "billing_line2": "<string>",
  "billing_city": "<string>",
  "billing_state": "<string>",
  "billing_postal_code": "<string>",
  "billing_country": "<string>"
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.spairehq.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

You can generate a Personal Access Token from your settings.

Body

application/json

Request body for generating a real-time PDF preview without persisting.

organization_id
string<uuid4>
required

Organization ID.

currency
string
required

ISO 4217 currency code.

Required string length: 3
line_items
ClientInvoiceLineItemPreview · object[]
required

Invoice line items.

Minimum array length: 1
customer_id
string<uuid4> | null

Optional customer ID to pull name/address from.

due_date
string<date> | null
memo
string | null
po_number
string | null
on_behalf_of_label
string | null
discount_amount
integer
default:0
Required range: x >= 0
discount_label
string | null

Whether to show the organization logo on the PDF.

show_mor_attribution
boolean
default:true

Whether to show 'via spaire' label under the logo.

billing_name
string | null
billing_line1
string | null
billing_line2
string | null
billing_city
string | null
billing_state
string | null
billing_postal_code
string | null
billing_country
string | null

Response

Successful Response