Hi,
I am looking to retrieve a Payments report through API access. Can someone point me to how to go about this? The Payments report is under E-Commerce > Reports > Payment Reports.
Thank you.
Hi,
I am looking to retrieve a Payments report through API access. Can someone point me to how to go about this? The Payments report is under E-Commerce > Reports > Payment Reports.
Thank you.
Hi @Salman_Javeed,
The best option you have got here is to use the XML-RPC API to do the querying.
REST v1 API has the Order Payments API Endpoint.
https://developer.infusionsoft.com/docs/rest/#tag/E-Commerce/operation/listOrderPaymentsUsingGET
REST v2 API has this Reporting (Saves Searches) API Endpoint below, but mentions the following in the documentation “Deprecated as of v2”. I am wondering if they are going to be changing the way to do the reporting in a later release.
https://developer.keap.com/docs/restv2/#tag/Reporting/operation/runReportUsingPOST
In the XML-RPC you have a couple of ways to do this.
For Saved Searches, you can use these API Endpoints below. Note, you cannot modify the Search Criteria for the Report via the API, so you have to manually create and save the report in Keap first.
https://developer.keap.com/docs/xml-rpc/#search-retrieve-a-complete-report-from-a-saved-search
https://developer.keap.com/docs/xml-rpc/#search-retrieve-a-partial-report-from-a-saved-search
Or, you can query the “InvoicePayment” or “Payment” table instead. This gives better flexibility here. But, you may need to query several other tables to get the Invoice or Contact details.
https://developer.keap.com/docs/xml-rpc/#data-query-a-data-table
https://developer.infusionsoft.com/docs/table-schema/#InvoicePayment
https://developer.infusionsoft.com/docs/table-schema/#Payment
If you want to find the Saved Search Id, you can query the “SavedFilter” table.
https://developer.infusionsoft.com/docs/table-schema/#SavedFilter
Or, inspect the Saved Search Element in the Web Browser. The “id” attribute contains the Saved Search Id.
Hope that helps.