To whom it may concern, I have come up with a workaround as I do not see a way to retrieve the URL to pay an invoice without some extra steps:
Here’s how I Extracted the Payment Link URL using Keap’s REST API:
Retrieve a list of emails sent by Contact ID and get the ID of the email that contains the invoice link: Keap REST API
Retrieve the specific email information using the ID found in step ‘1’: Keap REST API
html_content will be returned as a Base64 encoded HTML String and needs decoded.
Use a Regular Expression to pattern match the URL that gets sent to view and pay invoices. That RegEx should be something like href=“(https://{YOURAPPID}.infusionsoft.com/app/invoiceView/[^”]+)" where you need to replace {YOURAPPID} with your APP’s ID.
The value you are looking for should have been returned in ‘4’. Now, you just need to store that in a custom field on the contact record and merge it into an email.
Ooof, that is a painful way to have to retrieve it; I have ticketed for our ecommerce team to take a look at exposing the Invoice UUID on Rest v2 API objects. I can’t provide a timeline for it, but it’s at least in the pipeline now.