Help Center

API Integration

Last Updated: Mar 10, 2017
Before Starting

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:

1. You cannot bcc ReferralCandy on invoice emails. So Email Integration does not work for your store.

2. You cannot expose dynamic checkout variables needed for JavaScript Integration.

3. You want to do a custom integration with your existing rewards system.

4. You have a non-standard checkout process for your online store. For e.g. the invoice information is finalized some time after the initial JavaScript tracking code is triggered.

API Integration

1. 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. View API Documentation.

2. Insert the referral tracking code snippet. Paste the code just before the </body> tag on your stores purchase completed page.

Tips for ReferralCandy API Integration
Provide all of the required fields for a particular API method and include them in the signature calculation
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 profile page

Worked example to calculate signature
Here's is how you would calculate the signature for the Purchase Method of the APIs.
  1. Gather all the field/value pairs that you have, ensuring that all the required fields have a value
    • List of fields used in this example to calculate signature
      • Required
        • ​first_name=ReferralCandy
        • order_timestamp=1464334498
        • browser_ip=
        • user_agent=Chrome
        • invoice_amount=100.0
        • currency_code=USD
        • timestamp=1464334600
      • Optional
        • last_name=Example
        • external_reference_id=1234
  2. Sort the field/value pairs in alphabetical order
    • Alphabetical list of fields
      2. browser_ip=
      3. currency_code=USD
      5. external_reference_id=1234
      6. ​first_name=ReferralCandy
      7. invoice_amount=100.0
      8. last_name=Example
      9. order_timestamp=1464334498
      10. timestamp=1464334600
      11. user_agent=Chrome
  3. Join all of the field/value pairs into a single string​
  4. ​Prepend your API Secret Key to the single string from the previous step

  5. The calculated signature is the MD5 of the combined single string from the previous step

Still have questions? Contact us.

Have other questions? Contact us.
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found