Jump to content

Shareasale Recurring Commission Integration


lukewd

Recommended Posts

Hi there, for those who might want to integrate with shareasale in the future, this is successfully working for me:

 

Pleace the following code in complete.tpl:

 

{if $ispaid}
<!-- Enter any HTML code which needs to be displayed once a user has completed the checkout of their order here - for example conversion tracking and affiliate tracking scripts -->
<img src="https://shareasale.com/sale.cfm?amount={$amount}&tracking={$orderid}&transtype=sale&merchantID=XXXXX" width="1" height="1">
{/if}

 

 

This is all good and working, however it only tracks the affiliate commission on the first order. I would like to offer my affiliates a recurring commission for the lifetime of the client. Our product is billed monthly on a subscription basis.

 

This is the documentation that Shareasale provide for tracking recurring commissions:

Recurring commissions can be set up utilizing our Postback feature. There are two steps to the integration.

 

The first step is to create a "listener" script on your site. The ShareASale system will make an HTTP POST to this script for each transaction generated. Included in this POST will be a variable named "tracking". This is your order number or lead ID number. You will need to update your database record for this order/customer. The POST request will also contain a variable "userID", which is the affiliate ID responsible for this transaction. You will store this ID number with your order/customer record. This allows you to determine what orders/customers are related to ShareASale affiliates.

 

The second part of the integration is notifying us when a recurring commission should be made. When an order/customer performs an action that qualifies for a recurring commission, you should check your database to see if this order/customer is related to a ShareASale affiliate. If so, you will make a server to server HTTP GET request (in PHP this would be a CURL statement) to our server. This should be done on port 443, and the URL for the request should be:

 

https://shareasale.com/q.cfm?amount=AMOUNT&tracking=TRACKING&transtype=sale&merchantID=YOURMERCHANTID&userID=THESTOREDIDNUMBER

 

Where you replace the ALLCAPS words as follows:

 

AMOUNT should be replaced the amount of the new action (typically the order subtotal of the new order)

TRACKING should be replaced with the ID number for the new action (typically the new order number, payment number or invoice number)

YOURMERCHANTID should be replaced with your merchant ID number

THESTOREDIDNUMBER should be replaced with the affiliate ID value that is stored in your database

 

Now, what i'm wondering is if this is even required at all. I don't understand how WHMCS performs the recurring billing? If this is required, how would I go about integrating it. What files would I need to modify to make WHMCS notify Shareasale when a recurring commission should be made (the second part of the integration as described above)?

Link to comment
Share on other sites

  • 10 years later...

did you ever get anywhere with this?

I have signed up with shareasale, and I have tried to use hooks to add the code, a sI didn't want to modify templates,  since this requires ongoing maintenance every time I update WHMCS to make sure the template has not changed, and then adding the code again. If I forget to do this, I may have a broken template.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated