API Integration requires experience in programming. If you are not a developer, either consult one or try Email Integration. Unfortunately, we do not provide debugging support for this.
You should use API integration because:
You cannot BCC ReferralCandy on invoice emails, so Email Integration does not work for your store.
You want to do a custom integration with your existing rewards system.
Setting up API Integration
For API Integration, you will use the purchase method of the ReferralCandy API to send purchase information to ReferralCandy. You can also use other methods of our API to carry out a more customized integration with ReferralCandy.
Then, you'll have to insert the referral tracking code snippet on your store's purchase completed page.
How API Integration works
Insert the referral tracking code snippet on your store's purchase completed page. Paste the code just before the </body> tag.
A referrer signs up by visiting the link found at the top of your themes page, obtaining their invite link.
From another browser and IP address, another person is referred by visiting the referrer's invite link, and then the purchase completed page of your store.
the order_timestamp field must be within 10 minutes of the visit to your store's purchase completed page
the browser_ip and user_agent fields must correspond with the IP address and browser used by the purchase at step (3) above
curl --data "accessID=THISISMYACCESSID&browser_ip=126.96.36.199¤cy_code=USDemail@example.com&external_reference_id=1234&first_name=ReferralCandy&invoice_amount=100.0&last_name=Example&order_timestamp=1581002448×tamp=1581062448&signature=SIGNATUREASCALCULATEDBELOW" --data-urlencode "user_agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0" https://my.referralcandy.com/api/v1/purchase.json
You can also use other methods of our API to carry out a more customized integration with ReferralCandy. View API Documentation.
403 Forbidden error
The API will return the HTTP 403 Forbidden error code when:
You haven't set a campaign to Live
Your campaign was stopped by the system
Your account is suspended
Tips for ReferralCandy API Integration
Provide all of the required fields for a particular API method and include them in the signature calculation. See a sample
If you provide non-required fields, make sure that they are also included as part of the signature calculation
Sort all the name/value pairs in alphabetical order
If you have non-required fields, make sure to also sort them in alphabetical order
Use the correct values for the Access ID and Secret Key
Both the Access ID and Secret Key can be found in the "API Tokens" section of your My Profile page:
💬 Need help? Click the chat widget on the right to start a conversation. Learn more