Skip to main content
CreditHistory lists credit operations as a table: when, type, feature, credits and status. From React 0.11.0. When to use
  • Below CreditBalance in your billing settings.
  • A support or audit view of a customer’s credit activity.
  • A paged list of operations with a “Load more” button.
CreditHistory with four operations and a Load more button, light theme

Importing CreditHistory

Rendering CreditHistory

Read the signed-in customer’s operations with useCreditHistory and pass them in:
components/credit-activity.tsx
Each operation gets one row with a readable type: Used, Granted, Adjustment, Expired, Revoked, Refunded or Transfer. Times show in en-US in the browser’s time zone (“Oct 16, 2026, 8:40 AM”). An operation without a feature shows ”—”. The status of denied and reversed operations shows in muted text. A wide table scrolls sideways inside its frame.

Data

Each row is a CreditOperationData: the id, type, status, credit_amount, feature_code and occurred_at of an operation.

Live data

useCreditHistory({ creditSystemCode?, limit? }) reads the signed-in customer’s operations a page at a time through your billingEndpoint. operations holds every loaded page; see Rendering CreditHistory for the full wiring. Without the hooks, pass the SDK’s credits.operations page and fetch the next page with its next_cursor.

Examples

Load more

With hasMore and onLoadMore, a “Load more” button shows under the table. While isLoading is true and operations are already shown, the button reads “Loading…” and is disabled.
CreditHistory with four operations and a Load more button, light theme

Loading, empty and error

With no operations, isLoading shows a placeholder, an empty list shows emptyMessage, and error shows its message as an alert.
CreditHistory loading placeholder, No credit activity yet message, and an error message, light theme

API reference

CreditOperationData[]
id, type, status, credit_amount, feature_code and occurred_at of each operation. Defaults to an empty list.
boolean
default:false
With onLoadMore, shows a “Load more” button under the table.
() => void
Fires when “Load more” is clicked.
boolean
default:false
With no operations, shows a loading placeholder. With operations, the button reads “Loading…” and is disabled.
Error | string | null
default:null
Shows the message as an alert instead of the table.
string
default:"No credit activity yet."
Shown when there are no operations.
Appearance
Theme, variables and element overrides on top of the provider’s. See Appearance.

States

Appearance

creditHistory (root), creditHistory__table, creditHistory__row.Style them with appearance.elements. See Elements.

CreditBalance

The credits available now.

Credits

How credit systems work.