getUserTransactions
Fetch a member's billing transactions and invoices by user ID or client ID to review payments, unpaid balances, payment methods, and billing status.
Instructions
Get member billing transactions (invoices) - Fetch the billing transaction history (invoices) for a specific member. Read-only. Backed by the WHMCS billing integration.
Required: exactly one of user_id (standard — the BD member ID) OR client_id (power-user — the WHMCS billing record ID stored on the user as users_data.clientid). Default to user_id; reach for client_id only when you already have one in hand and want to bypass the user lookup.
Use when: you need to see a member's paid/unpaid invoices, payment methods, billing history, or reconcile billing status. Common reasons: answering a member's "what did I pay for?" question, exporting billing history, auditing revenue per member.
See also: getUserSubscriptions (active/past membership plan signups - different resource from invoices), getUser (member profile).
Returns: { status: "success", message: { total: <count>, invoices: [{...invoice records}] } }. Each entry is { invoice_details, subscription_details }. invoice_details includes id, invoicenum (may be empty string), date, duedate, datepaid, subtotal, credit, tax, total, status (Paid, Unpaid, etc.), paymentmethod, notes (admin-facing; may contain internal comments - redact before surfacing to end users), and an items array with per-line description, amount, type. NOT a simple list of rows - the message is an object containing invoices as the array. Unpaid invoices have datepaid: "0000-00-00 00:00:00" (MariaDB zero-date sentinel) - do NOT parse as ISO-8601; check status === 'Unpaid' or datepaid.startsWith('0000') first. subscription_details is the linked subscription, or false when there is none.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | No | Member ID (the standard input). Pass this OR `client_id`. | |
| client_id | No | WHMCS billing record ID. Power-user alternative to `user_id`. Pass this OR `user_id`. |