Skip to main content
GET
/
api
/
public
/
billing
/
invoices
/
{invoiceId}
{
  "Id": 123,
  "UniqueId": "<string>",
  "InvoiceNumber": "<string>",
  "Draft": true,
  "Paid": true,
  "PaidOn": "<string>",
  "DueDate": "<string>",
  "CreditNote": true,
  "Refunded": true,
  "CoworkerId": 123,
  "BusinessId": 123,
  "BusinessWebAddress": 123,
  "BillToName": "<string>",
  "BillToAddress": "<string>",
  "BillToCity": "<string>",
  "BillToState": "<string>",
  "BillToPostCode": "<string>",
  "BillToCountry": {},
  "TaxIDNumber": "<string>",
  "TotalAmount": 123,
  "DueAmount": 123,
  "PaidAmount": 123,
  "TaxAmount": 123,
  "DiscountAmount": 123,
  "Currency": {},
  "TransactionCurrency": {},
  "TotalFormated": "<string>",
  "DueAmountFormated": "<string>",
  "Lines": [
    {}
  ],
  "TaxCategories": [
    {}
  ],
  "UsedExtraServices": [
    {}
  ],
  "UsedBookingCredits": [
    {}
  ],
  "CreatedOn": "<string>",
  "CreatedOnUtc": "<string>",
  "UpdatedOn": "<string>",
  "UpdatedOnUtc": "<string>",
  "401 Unauthorized": {},
  "404 Not Found": {}
}

Get Invoice Details

Retrieves a single invoice for the current customer. Invoices are created during checkout flows for bookings, products, plans, and more. This endpoint returns the full invoice breakdown, including lines, taxes, totals, currency, and metadata for the location.

Authentication

This endpoint requires an authenticated customer session. The invoice must belong to the current customer or to a team the customer manages.

Path Parameters

invoiceId
number
required
The unique identifier of the invoice you want to retrieve.

Query Parameters

_shape
string
Comma-separated list of field paths to include in the response. When provided, only the specified fields are returned — useful for reducing payload size. Supports nested paths using dot notation. Example: _shape=InvoiceNumber,TotalAmount,DueAmount,Paid,Lines.

Response

The response shape follows the InvoicePreview contract used across checkout and payments. Below is a summary of the most-used fields.

Identification and Status

Id
number
Unique identifier for the invoice
UniqueId
string
Globally unique identifier for the invoice
InvoiceNumber
string
Human-friendly invoice number as visible to the customer
Draft
boolean
Whether the invoice is a draft
Paid
boolean
Whether the invoice is fully paid
PaidOn
string
ISO 8601 datetime when the invoice was paid (if paid)
DueDate
string
ISO 8601 date the invoice is due
CreditNote
boolean
Whether the document is a credit note
Refunded
boolean
Whether the invoice has been refunded

Customer and Location

CoworkerId
number
Customer id the invoice belongs to
BusinessId
number
Location id where this invoice was issued
BusinessWebAddress
number
Web address id for the issuing location

Billing To

BillToName
string
Billing contact or company name (can be null)
BillToAddress
string
Billing address line (can be null)
BillToCity
string
Billing city (can be null)
BillToState
string
Billing state/region (can be null)
BillToPostCode
string
Billing postal/ZIP code (can be null)
BillToCountry
object
Country object for the billing address
TaxIDNumber
string
Tax/VAT registration number (can be null)

Amounts and Currency

TotalAmount
number
Grand total amount of the invoice (in invoice currency)
DueAmount
number
Amount still due
PaidAmount
number
Amount paid so far
TaxAmount
number
Total tax amount across all lines
DiscountAmount
number
Total discount applied to the invoice
Currency
object
Invoice currency object with fields: Name, Code, Format, etc.
TransactionCurrency
object
Transaction currency used by the payment gateway (if different)
TotalFormated
string
Pre-formatted total, e.g. “$123.45”
DueAmountFormated
string
Pre-formatted due amount

Lines and Taxes

Lines
array
Array of line items. Each item includes fields such as Description, Quantity, UnitPrice, SubTotal, TaxAmount, TaxPercentage, and optional DiscountCode.
TaxCategories
array
Breakdown of totals by tax rate, including Rate, TaxSubTotal, SubTotal, and Lines.

Usage of Credits (if applicable)

UsedExtraServices
array
Applied extra service credits with Amount, ChargePeriod, ExpiresOn.
UsedBookingCredits
array
Applied booking credits with Amount, ChargePeriod, ExpiresOn.

System Fields

CreatedOn
string
ISO 8601 datetime when the invoice was created (local time)
CreatedOnUtc
string
ISO 8601 datetime when the invoice was created (UTC)
UpdatedOn
string
ISO 8601 datetime when the invoice was last updated (local time)
UpdatedOnUtc
string
ISO 8601 datetime when the invoice was last updated (UTC)

Example Response

{
  "Id": 12345,
  "IdString": "12345",
  "UniqueId": "e9a3a3b8-8d3e-4b54-9f2d-0c82b2a8b9a1",
  "InvoiceNumber": "INV-2025-000123",
  "CoworkerId": 987,
  "BusinessId": 42,
  "DueDate": "2025-09-30",
  "Paid": false,
  "Draft": false,
  "Currency": { "Code": "USD", "Name": "US Dollar", "Format": "$0,0.00" },
  "TotalAmount": 199.0,
  "DueAmount": 199.0,
  "TaxAmount": 33.17,
  "DiscountAmount": 0,
  "Lines": [
    {
      "Id": 1,
      "Description": "Meeting room booking",
      "Quantity": 1,
      "UnitPrice": 165.83,
      "SubTotal": 165.83,
      "TaxAmount": 33.17,
      "TaxPercentage": 20,
      "SubTotalFormatted": "$165.83",
      "TaxAmountFormatted": "$33.17",
      "UnitPriceFormatted": "$165.83"
    }
  ],
  "TaxCategories": [{ "Rate": 20, "TaxSubTotal": 33.17, "SubTotal": 165.83, "Name": "VAT 20%", "Lines": [] }],
  "TotalFormated": "$199.00",
  "DueAmountFormated": "$199.00",
  "CreatedOn": "2025-09-28T10:15:00",
  "CreatedOnUtc": "2025-09-28T09:15:00Z"
}

Usage in Portal

This endpoint is used during checkout and payment flows whenever an existing invoice id is present (e.g., resuming payment or redirecting back from a payment provider). Key usages include:
  1. Checkout flow controller – decides steps when an invoice_id is present
    • File: src/views/checkout/CheckoutLayoutPage.tsx
  2. Payment selection and processing (uses invoice data to start payment sessions)
    • Files:
      • src/views/checkout/SignupPaymentPage.tsx
      • src/views/public/checkout/booking/components/StripeCheckoutForm.tsx
      • src/views/public/checkout/booking/components/SpreedlyCheckoutForm.tsx
  3. Completion step context
    • File: src/views/checkout/SignupCompletePage.tsx
  4. Invoice fetching and basket state orchestration
    • File: src/states/useBasketData.tsx (calls endpoints.billing.invoices.one when invoice_id is in the URL)
  5. Discount code summary UI (reads invoice lines and currency)
    • File: src/views/public/checkout/booking/components/DiscountCodeForm.tsx

Typical integration pattern

// From src/api/endpoints.ts
// const endpoints.billing.invoices.one = (invoiceId: number) => ({
//   url: `/api/public/billing/invoices/${invoiceId}`,
//   type: null as unknown as InvoicePreview,
// })

// Usage in React
const endpoint = endpoints.billing.invoices.one(Number(invoiceId))
const { resource: invoice } = useData<typeof endpoint.type>(httpClient, invoiceId ? endpoint.url : null)
  • POST /en/basket/CreateInvoice – Create an invoice from the current basket
  • POST /api/public/payments/stripe/createGuestSession – Start a Stripe checkout session
  • POST /api/public/payments/spreedly/createGuestSession – Start a Spreedly payment session

Error Responses

401 Unauthorized
error
The current user is not authenticated or The invoice is not accessible to the current user
404 Not Found
error
Invoice with the specified id does not exist or is not accessible