FirstPromoter can integrate with almost any billing provider, including Shopify Partners platform through our tracking API.
Shopify doesn't provide webhooks for Shopify Apps to notify recurring charges, but FirstPromoter can work without that by scheduling recurring commissions and cancel them when the app is uninstalled from a store.
Please follow this guide to fully integrate FirstPromoter with your Shopify App.
1) Insert website tracking scripts
- after you sign up, follow the "Getting Started" instructions until you reach the 3rd step "Quick Setup". Click on "Start" then "View Instructions"Note: When you create the campaign, we recommend to un-check the field from last step called "Auto accept pending rewards"
- insert the visitor tracking script(from Step 1) on all website marketing pages
- to track app installs, use the script on Step 2(sign up tracking script) > Option 2 and include it on the page that redirects after the users installs your application(the signups won't be tracked twice)
- replace <user-billing-id> with store domain name (the rest of the fields are optional)
- go back to FirstPromoter(you need to be on "/quick_setup" page), click "Next", skip "Connect to billing platform" and finish the "Test tracking and integration" process
2) Use the API to track recurring commissions/rewards
You need to call the API once the store owner accepts the charge. Probably you already set a "return_url" for when the users accept the charge on the RecurringApplicationCharege API call to Shopify. Make the following API request when the user reaches that "return_url" to start tracking the commissions:
Use the following parameters:
- api_key and wid - here's more information of how to get them
- uid - store domain.
- amount [integer, value in cents] - the recurring charge amount, minus 20% Shopify fee.
- mrr [integer, value in cents] - monthly recurring revenue brought by the customer. For monthly subscriptions is usually the same as "amount" value.
- plan (optional) - in case you use multiple plans. It's needed if you set plan level rewards in the campaign(different rewards for each plan).
- start_recurring_reward_in - if you offer a free trial, set the trial amount in days(like 7 for 7 days trial)
- recurring_reward_frequency - set 30 for monthly subscriptions
- max_recurring (optional) - if you want to limit the commissions for only 1 year, set 12. For life-time commission, omit this parameter.
In case of upgrades, just send a new call with the new amount, mrr, new plan and without the "start_recurring_reward_in" parameter.
When the app is uninstalled(assuming you use the Shopify webhook for that), you will need to call:
with the same api_key, wid and uid parameters. All recurring rewards will be stopped for that store.
3) Test the entire setup
To make sure everything works as expected, create a new promoter and test the entire flow by installing the app on a test store and making a fake charge.