This page assumes that you already have a Recurly account created and are able to create plans. To sign-up and create a Recurly account, visit the Recurly website.
In order to integrate Recurly with Moesif, there are a few prerequisites which must be completed. These include:
- Creating an account with Recurly
- Creating a plan in Recurly
The plan must be set to bill at the End of the billing period and must include at least one add-on. The add-on is what the usage metrics will be linked to.
Configuring the Recurly integration
Moesif’s connection with Recurly involves 2-way communication. Moesif has created a simple way to get all the info you need and to configure certain variables for Recurly in a single screen.The Recurly setup details screen can be accessed a few ways, including:
Through Settings > Extensions
and then selecting install on the Recurly extension
Through the Billing Meters screen Edit Billing Providers dropdown
And through the Create New Billing Meter screen
Once you’ve opened the configuration screen through one of the routes above, you can get the info needed to add the Moesif Webhook to Recurly, inputs to plug the Recurly API into Moesif, and customize your Customer ID source in a single place.
Adding the Moesif Webhook to Recurly
In Recurly, a Webhook needs to be added so that Recurly can send subscription updates to Moesif. To do this you’ll need to make sure you are logged into your Recurly account. Once logged in, use the left-side menu to navigate to Integrations > Webhooks.
Once you’re on the Webhooks page click the Configure button in the top-right of the screen.
Then click New Endpoint button in the top-right of the screen.
On the New Endpoint screen, create a name for the endpoint, paste in the Webhook URL into the ENDPOINT URL field, and your Moesif Application ID into the HTTP AUTH USERNAME field. Leave the HTTP AUTH PASSWORD field blank.
These details can be found in Moesif by clicking the Edit Billing Provider dropdown on the Billing Meters screen or by going to Settings > Extensions > Recurly and clicking install.
Then click Save Changes. The Webhook should then be created and display on the Webhooks screen in Recurly.
Configuring the Recurly extension in Moesif
In Moesif, you will need to plug in the Recurly API details so that Moesif can post usage details to Recurly to bill upon. These details can be entered into the Recurly API Version and Recurly API Key fields on the Recurly Setup Details screen.
Currently, Moesif only supports v3 of the Recurly API.
The Recurly Private API Key can be found in Recurly by navigating to Recurly > Integrations > API Credentials.
Take the value listed under PRIVATE API KEY and paste it into the Recurly API Key field on the Recurly Setup Details screen.
Once completed, be sure to click Save.
Customizing the Customer ID source
The Customize Customer ID Source configuration on the Recurly Setup Details screen allows users to specify the Recurly subscription and account field that Moesif will use as the Moesif company id and Moesif user id respectfully.
Linking a plan in Recurly to a billing meter
When creating a new billing meter, in the Link To section you can specify Recurly as the Billing Provider and then select the Plan and Add-on you’d like the usage to be linked to.