Skip to main content
GET
/
api
/
public
/
billing
/
invoices
/
statements
/
pdf
Download Statement PDF
curl --request GET \
  --url https://spaces.nexudus.com/api/public/billing/invoices/statements/pdf \
  --header 'Authorization: Basic <encoded-value>'
{
  "401 Unauthorized": {}
}

Documentation Index

Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt

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

Download Statement PDF

Returns a PDF statement summarising all invoices for the currently authenticated customer. The statement provides a consolidated overview of billing history in a single downloadable document.

Authentication

This endpoint requires a valid media JWT token obtained from GET /api/auth/media/customer.

Query Parameters

t
string
required
A short-lived media JWT obtained from GET /api/auth/media/customer. This token authorises temporary access to the binary file. Pass the jwt field from the response object directly as this query parameter value.

Response

Returns the raw PDF binary (application/pdf). The portal constructs the full URL and opens it in a new browser tab.

Code Examples

// 1. Fetch a media JWT (requires a valid Bearer token)
const { jwt } = await fetch('/api/auth/media/customer', {
  headers: { Authorization: `Bearer ${customerBearerToken}` },
}).then((r) => r.json())

// 2. Build the statement PDF URL
const statementUrl = `https://${business.WebAddress}/en/api/public/billing/invoices/statements/pdf?t=${jwt}`

// 3. Open directly — no additional fetch needed
window.open(statementUrl, '_blank')

Usage in Portal

This endpoint is used in the My Invoices section to provide a “Download statement” link at the bottom of the invoices table.
  • File: src/views/user/activity/invoices/MyInvoicesSection.tsx
  • GET /api/public/billing/invoices/my – List invoices
  • GET /api/public/billing/invoices/{invoiceId}/pdf – Download a single invoice PDF
  • GET /api/public/billing/invoices/draft/pdf – Preview upcoming invoice
  • GET /api/auth/media/customer – Obtain a short-lived media JWT

Error Responses

401 Unauthorized
error
Missing or invalid media JWT token.