Retrieve Unpaid Invoice Payment Link Through API

In Max Classic, is is possible to retrieve an invoice payment link for an unpaid invoice to be able to merge into a custom email?

If my invoice ID is ‘123’, the format link that shows up does not include 123 in it, but instead includes a really long URL https://APPID.infusionsoft.com/app/invoiceView/{long-invoice-id-not-123}

I am not seeing a way to get the value for {long-invoice-id-not-123} through the API. Are there options for this?

Thanks,
Tim

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:

  1. Retrieve a list of emails sent by Contact ID and get the ID of the email that contains the invoice link: Keap REST API

  2. Retrieve the specific email information using the ID found in step ‘1’: Keap REST API

  3. html_content will be returned as a Base64 encoded HTML String and needs decoded.

  4. 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.

  5. 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.

Thanks!

1 Like