In today’s ClickFix, you’ll learn how our exclusive Magic Hooks™️ work to give you more control over how people interact with the links you share.

In basic terms, Magic Hooks™️ let you do a couple of things at the moment.

  • Change when someone’s subscription or payment plan payments are charged
  • Toggle whether or not you want someone to receive a recurring invoice with every charge

I’ll get deeper into specific use cases in a separate video, but for now imagine that you want to gain better control over your cash flow so you decide that from now on, everyone is going to be charged on the first of every month. With Magic Hooks™️ you can do that and much more…

So, without further ado, let’s jump into the ClickFix App to see exactly how we create our Magic Hooks™️ and what types of options you’re currently working with.

We’ll start with changing the next charge date of an open order.

Once you’re on the Magic Hooks™️ page, you’ll notice that the first thing you have to do is select the Ontraport Application Key that you want to work with.

If you haven’t set up your Ontraport Key yet, navigate to Settings > Ontraport API Keys & set one up right now because all of the ClickFix apps will ask for your key before allowing you to use them. If you need help setting up your key, please refer to the video tutorial linked on that page.

After selecting your Ontraport key, you’ll see that the base URL changes to show your unique token.

From here, you just need to add the URL parameters that’ll tell Ontraport which open order to update & when you want the next charge (and subsequent charges) to take place. Let’s go over them one by one.

First up is the &id= parameter. This one will always be &id=[Contact ID] so that Ontraport knows which contact record to modify. Every Magic Hook™️ you create needs this parameter to work, so be sure to include it every time.

Next, you have the optional &from= parameter which allows you to choose between ‘today’ and ‘order’. This parameter tells Ontraport whether you want the offset you choose in a later step to be counted from today or from the current date of the open order.

Let me try to explain that with an example. Adding &from=today means that whatever offset type you choose later will be calculated from today. So, if you chose a 3 day offset, your Magic Hook™️ would change the next charge date to 3 days from today (ie. If today is November 21st, the next charge would be on November 24th). If you were to choose &from=order, then it would calculate 3 days from the date of the next order (ie. if today is November 21st & the next charge is set for December 21st, this would change the next charge to December 24th).

Moving on, we see that we can also choose the time zone that we want to use for the webhook’s calculations. This looks like &timezone= followed by the desired time zone in a Continent/City format like &timezone=Europe/London. Google “tz database time zones” if you need a list of compatible time zones. This is an optional parameter, but if it’s not specified, please keep in mind that it’ll default to GMT (essentially UK time for the uninitiated).

After that, we have the option to specify which product this is for using the &product= parameter. You can find your product ID list in your Ontraport dashboard under Sales > Products and then either adding the “Product ID” column or if you’re in Chrome you can just hover over the product name and look in the lower left corner of the browser window. Adding the &product= parameter tells your Magic Hook™️ to only modify the charging schedule of a specific product. If you don’t include this in your webhook, you may end up modifying every open order (both subscriptions and payment plans) currently active for that contact. So, make sure you include the specific product ID if you have multiple subscriptions and/or payment plans available on your website.

From there we get to the &type= followed by the &offset= parameters.

As the table shows, you have several options that you need to consider for the &type= variable which will determine what number you should include for the &offset= value.

Numeric 1 to 7 (Monday to Sunday)
Numeric from 1 to 31 (if no 31 in that month, set to last day of the month)
A number of days in the future
A number of weeks in the future
A number of months in the future

So, if you wanted to change the next charge date to next Tuesday, you would add &type=nextday&offset=2.

Or maybe you want it to be on the first of next month. In that case you’d add &type=nextmonth&offset=1.

Want to move it by a set number of days, weeks or months? Just add &type=days/weeks/months&offset=insert_a_number.

At the bottom of your ClickFix interface, you’ll see a couple examples of ready to use webhooks to give you a headstart on building yours.

The last thing to note is that you also have the option to combine Magic Hooks™️ for even more granular control.

For example, setting up 1 webhook element with an Ontraport Key above to reveal your token]&id=[Contact ID]&type=nextmonth&offset=1

Followed by another like this[Pick an Ontraport Key above to reveal your token]&id=[Contact ID]&type=nextday&offset=1&from=order

Would push the next charge date to the 1st monday of next month.

Let’s jump over to Ontraport to see how to deploy your new Magic Hook™️ in a campaign.

Once you’ve logged into Ontraport, navigate over to campaigns and start a new campaign from scratch.

Now you’ll need to decide on the type of trigger you want to use. If you’re planning on just updating your entire database to use a specific billing schedule like the first of the month, you’ll probably just place the webhook element directly under the default trigger and add your whole list.

But for this example, let’s assume that you want new subscribers to your membership site to be charged on the first of every month.

For that, we’ll make a trigger based on a specific product being purchased. Once we have our product selected, we add a webhook element to the canvas. Now, you’ll just copy & paste your Magic Hook™️ URL into the form field. Before you click done, double check that your product ID is correct so you don’t run into any issues.

That’s it!

Now every time someone purchases your subscription, they’ll automagically be charged on the first of every month like clockwork giving you a predictable way to manage your cashflow.