getUserTransactions
Retrieve billing transaction history (invoices) for a specific member using member ID or WHMCS client ID.
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.
Empty result with misleading error: if the member has no billing record yet (never enrolled in any paid plan), BD returns HTTP 400 + {status:"error", message:"user_id or client_id is required"} even though the identifier WAS sent. The error wording is BD's, not the wrapper's. Treat that exact error message on this endpoint as "no billing data for this member" rather than "missing parameter".
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 invoice 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 may be false (literal boolean) when absent.
Reference support articles:
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`. |