how can I search transactions for the last 4 digits of a credit card number?
This is going to be a multiple API table look up to link the Card back to the Invoices.
You will need to use the XML-RPC API to achieve this, as there is no way to this via the REST API.
You will need to use the “DataService.query” API function to achieve querying the tables.
https://developer.keap.com/docs/xml-rpc/#data-query-a-data-table
You can search the “Last4” field via “CreditCard” Table, but keep a note of the “Id” field.
https://developer.infusionsoft.com/docs/table-schema/#CreditCard
Next, you need to query the “CCharge” table via the Credit Card Id field “CCId”, but keep a note of the “PaymentId” field.
https://developer.infusionsoft.com/docs/table-schema/#CCharge
Next, you need to query the “Payment” table via the Payment Id field “Id”. You can then use the “InvoiceId” field for the referring Invoice.
https://developer.infusionsoft.com/docs/table-schema/#Payment
The Invoice table can be found here.
https://developer.infusionsoft.com/docs/table-schema/#Invoice
Does that help?