PagePromise you can await for one page or for await to auto-paginate.
Credits are first-class: every customer can hold one or more credit wallets alongside their dollar balances.
listCreditAccounts returns them.unitpay.customers.get
Fetch one customer by ID. ReturnsPromise<Customer> (id, email, name, status, type, salesMotion, address fields, metadata, …).
unitpay.customers.list
List customers. Takes optional queryparams (Record<string, unknown>); returns PagePromise<Customer>.
unitpay.customers.listInvoices
Invoices for a customer. ReturnsPagePromise<Invoice> (totalAmount, amountDue, amountPaid, currency, status, dueDate, paidAt, …).
unitpay.customers.listPaymentMethods
Payment methods on file. ReturnsPagePromise<PaymentMethod> (type, status, isDefault, and card: { brand, last4, expMonth, expYear }).
unitpay.customers.listCreditAccounts
The customer’s credit wallets. ReturnsPagePromise<CreditAccount> — one per credit currency, with balance, available, reserved, and currencyId.
unitpay.subscriptions.list
List subscriptions. Filter with queryparams — { customerId, status }. This is also how you list one customer’s subscriptions (there’s no customer-nested route). Returns PagePromise<Subscription> (planId, status, billingInterval, collectionMethod, currentBillingPeriodEnd, …).
unitpay.subscriptions.cancel
Cancel a subscription by ID. Optionalparams (Record<string, unknown>) controls cancellation behavior (e.g. immediate vs. at period end). Returns Promise<Subscription>.
unitpay.subscriptions.uncancel
Reverse a pending cancellation before it takes effect. ReturnsPromise<Subscription>.
See also
Usage & ingestion
Track billable events.
Portal sessions
Mint the token for customer-facing UI.