[memb_keap_list_invoices]
Description
Lists the current member's Keap invoices. An invoice and an order are the same record in Keap, so this list and [memb_keap_list_orders] read the same data; the invoice view leads with the invoice ID and the money columns. The default table shows invoice ID, title, date, status, total, amount paid, and balance due.
Paying from the list is opt-in. pay="yes" adds a pay control beside
every invoice that still carries a balance. One card on file means just
the button; several cards get a picker listing each card's type, last
four digits, and expiry; no card on file gets an "Add a card to pay"
link pointed at card_url, or nothing when card_url is unset. The
click asks the member to confirm, then charges the chosen card in Keap.
After the attempt the member returns to success_url or failure_url,
the page they started on by default, carrying a flash notice that lands
above the list. On a successful payment, tag_id is applied so your
automations can react.
status buckets the list: paid shows invoices Keap marks Paid,
unpaid shows the Sent and Viewed invoices the member still owes, and
draft invoices only appear under all, since a draft is not yet an
obligation.
When the list comes back empty, empty_text shows in its place. If Keap
cannot be reached, the shortcode renders nothing rather than telling the
member they have no invoices. Flash notices from the card and
subscription flows settle above the list the same way. The list reads
the same five-minute per-contact cache as the orders list, so a payment
settles into the table on the next pass.
Design controls match
[memb_keap_list_subscriptions]:
the same layout and fields attributes, the same --torii-list-* CSS
tokens, and theme templates on the same contract with template="name".
Shortcode Examples
The default table:
[memb_keap_list_invoices]
Everything the member still owes, payable in place:
[memb_keap_list_invoices status="unpaid" pay="yes" card_url="/billing/add-card/"]
Choose the columns and their order:
[memb_keap_list_invoices fields="invoice_id,title,total_due,status"]
Shortcode Parameters
card_url
Link target shown in place of the pay control for members with no card
on file. Empty renders nothing for those members. Default: ''.
confirm
Whether the pay click asks the member to confirm before charging.
Default: yes.
date_format
PHP date format applied to every date field. Default: M j, Y.
debug
Prepend a count of invoices before and after filtering, any ignored
fields keys with the valid alternatives, and a notice when card data
was unavailable and the pay controls were suppressed. Super admins only.
Default: no.
empty_text
Message shown in place of the list when the member has no invoices
after filtering. Default: You have no invoices..
failure_url
Where the member lands after a failed payment. Default: the page the list is on.
fields
Comma-separated field keys that choose which columns appear and in what
order. Unknown keys are dropped, and an att where every key is unknown
falls back to the default set. See Fields below for the keys and their
types. Default:
invoice_id,title,creation_date,status,total,total_paid,total_due.
layout
table, cards, rows, or plain. plain enqueues no CSS, so a
page builder container or your own stylesheet dresses the bare
structure. Default: table.
order_by
Field to sort on: id, title, status, creation_time, or
invoice_id. Unrecognized values fall back to creation_time.
Default: creation_time.
pay
Whether each balance-carrying invoice gets a pay control. Default:
no.
pay_text
Label on the pay button. Default: Pay Now.
sort
Sort direction: asc or desc. Default: desc (newest first).
status
paid, unpaid, or all. Unrecognized values behave as all.
Default: all.
success_url
Where the member lands after a successful payment. Default: the page the list is on.
tag_id
Torii tag ID applied to the member after a successful payment. Default:
0.
template
Render through a named template instead of the built-in skeleton. See
Customizing with Templates below. Default: ''.
Fields
The registry is the order registry plus the invoice-only keys. The type decides how a value renders.
| Field | Type | Shows |
|---|---|---|
id |
text | Keap order ID |
invoice_id |
text | Keap invoice ID |
title |
text | Order title |
creation_date |
date | Date the order was created, in your site's time zone |
status |
enum | Keap status: Draft, Sent, Viewed, or Paid |
total |
money | Order total, formatted by Keap with its currency |
total_paid |
money | Amount paid so far |
total_due |
money | Balance due |
items |
text | One line per item, e.g. 2 × Widget |
order_date |
date | Date the order was placed, in your site's time zone |
promo_code |
text | Promo code applied to the order |
refund_status |
text | Refund status, when Keap reports one |
due_date |
date | Due date of the first payment still owed, from the payment plan |
terms |
text | Payment terms from the invoice |
notes |
text | Invoice notes |
credit_status |
text | Credit status from the invoice |
invoice_number |
text | Reserved: Keap fills invoice numbers only on Pro and Max apps, and Torii does not read the field yet |
Date fields follow date_format and convert from UTC to your site's
time zone before formatting.
Customizing with CSS
The list shares the subscription list's stylesheet, tokens, and markup
contract. The wrapper carries torii-list--keap-invoices, and rows
carry data-order-id and data-status. Re-theme it with the same
--torii-list-* custom properties, documented at
[memb_keap_list_subscriptions].
Customizing with Templates
Set template="my-invoices" and Torii looks for
torii/shortcodes/keap/invoices/my-invoices.php in your theme (child
theme first), falling back to the shared skeletons in the plugin's
templates/shortcodes/list/ directory. Templates receive the same
$atts, $content, $code, and $data contract as the subscription
list, documented at
[memb_keap_list_subscriptions].
A pay key in each item's actions array carries the pay control's
markup. The general workflow is documented in Shortcode
Templates.
Shortcode Attributes
| Attribute | Value |
|---|---|
| Conditional | No |
| Nestable | No |
| Accepts formatting | No |