file-invoice-dollarBilling & Account

Hooks for retrieving account details, invoices, and billing statements in the Limio SDK.

These hooks provide access to billing data — account-level details, invoices, and billing statements from the connected system. They are available when your Limio environment is integrated with a billing provider, such as Zuora.

circle-info

For core user and subscription hooks that work with any billing provider, see the User & Subscriptions page.


useUserAccountInformation()

Returns account-level details from the billing system, including billing configuration and financial metrics.

import { useUserAccountInformation } from "@limio/sdk"

const { accountInformation } = useUserAccountInformation()

Returns:

Field
Type
Description

accountInformation

object

The Billing account object (see fields below)

revalidate

() => void

Refresh the account data

mutate

(data) => void

Optimistically update the local cache

The accountInformation object contains three sections:

Section
Fields
Description

basicInfo

name

Account holder name

billingAndPayment

additionalEmailAddresses, autoPay, billCycleDay, paymentTerm

Billing configuration

metrics

currency, totalInvoiceBalance, totalDebitMemoBalance, unappliedCreditMemoAmount, unappliedPaymentAmount

Financial summary

Example — display account details and balance:

import React from "react"
import { useUserAccountInformation, formatCurrency, getCookie } from "@limio/sdk"

const AccountDetails = () => {
  const { accountInformation } = useUserAccountInformation()
  const locale = getCookie("limio-country")

  const {
    basicInfo: { name },
    billingAndPayment: { autoPay, billCycleDay, paymentTerm },
    metrics: { currency, totalInvoiceBalance, unappliedPaymentAmount }
  } = accountInformation

  return (
    <section>
      <h2>Account Details</h2>
      <table>
        <tbody>
          <tr>
            <td>Account Name</td>
            <td>{name}</td>
          </tr>
          <tr>
            <td>Bill Cycle Day</td>
            <td>{billCycleDay}</td>
          </tr>
          <tr>
            <td>Payment Term</td>
            <td>{paymentTerm}</td>
          </tr>
          <tr>
            <td>Auto Pay</td>
            <td>{autoPay ? "Enabled" : "Disabled"}</td>
          </tr>
          <tr>
            <td>Invoice Balance</td>
            <td>{formatCurrency(totalInvoiceBalance, currency, locale)}</td>
          </tr>
          <tr>
            <td>Unapplied Payments</td>
            <td>{formatCurrency(unappliedPaymentAmount, currency, locale)}</td>
          </tr>
        </tbody>
      </table>
    </section>
  )
}
chevron-rightExample accountInformation objecthashtag

useUserInvoices()

Returns a paginated list of the Billing system invoices for the authenticated user.

Parameters:

Param
Type
Default
Description

pageSize

number

40

Number of invoices per page

page

number

1

Page number to retrieve

Returns:

Field
Type
Description

invoices

ZuoraInvoice[]

Array of invoice objects

revalidate

() => void

Refresh the invoices data

mutate

(invoice) => void

Optimistically update a specific invoice

nextPage

string

Pagination token for the next page

Each invoice object includes fields such as invoiceNumber, amount, status, invoiceDate, and dueDate.

Example — display invoices with status:

chevron-rightExample invoice objecthashtag

sendSummaryStatementEmail()

Triggers a summary statement from the Billing system email for the authenticated user's account. The statement covers all billing activity from the given start date to the current date.

Parameters:

Param
Type
Description

startDate

string

Start date for the statement period (YYYY-MM-DD format)

Returns: { success: boolean } — indicates whether the email was successfully queued.

Example — send billing statement button:


LimioFetchers.invoiceFetch() — Downloading invoice PDFs

Fetches an invoice file (PDF) from Zuora as a blob. Use this to build "Download invoice" buttons in your invoice list or subscription overview components.

Example — download button for an invoice row:

Parameters:

Param
Type
Description

path

string

API path for the invoice file endpoint

token

string

Authentication token from useUser()

Returns: Blob — the invoice file data.


See also

Last updated

Was this helpful?