Use this API to make a referral for a Referral campaign running on your Firecart account. 



Code for the Make a Referral API:

  

Request URL: http://app.firecart.io/CampaignServiceHandler.do

Request Parameters:
apiAccessKey = <your access key>
apiSecret = <your app secret>
campaignHashId = <campaign_hash_id>
action = MAKE_A_REFERRAL
data = <data in json format> 

  

Since, the campaignHashId is unique for every Referral Campaign you run on your account, you can find the campaignHashId in the Launch section of the Referral campaign in the Firecart Dashboard.





Parameters Description:


Parameter Name

Description

Example Value

apiAccessKey

Your api access key

125423254asas544

apiSecret

Your api secret

sadds54554

campaignHashId

The hash id of the campaign

201545gtf210

action

Action

MAKE_A_REFERRAL

data

The actual referral data in json format



Note:

1. If you do not want to send the thank you email multiple times you can set the “sendThankYouEmail” attribute to “false” in the json data

2. If you have the unique sharing code for the customer then you can send that instead of “customer” as “uniqueReferrerCode”


{

customer:{

name:'david',

mobile:'12121212',

email:'david@mail.com',

Child_Name:'rahul'

},

friend:{

name:'abc',

mobile:'21212121',

email:'abc@mail.com'

},

sendThankYouEmail:true

}


------ OR ------


{    uniqueReferrerCode:’RHF453JFRW’,

    friend:{

         name:'abc',

         mobile:'21212121',

         email:'abc@mail.com'

    },

    sendThankYouEmail:true

}



Example:


    

Ex: 1
http://app.firecart.io/CampaignServiceHandler.do?campaignHashId=111&apiAccessKey=222&apiSecret=333&action=MAKE_A_REFERRAL&data={customer:{name:'david',email:'david@mail.com',mobile:'12121212',Child_Name:'rahul'},friend:{name:'abc',email:'abc@mail.com',mobile:'21212121'},sendThankYouEmail:'true'}

Ex: 2
http://app.firecart.io/CampaignServiceHandler.do?campaignHashId=111&apiAccessKey=222&apiSecret=333&action=MAKE_A_REFERRAL&data={uniqueReferrerCode:’REF4534GR4’,friend:{name:'abc',email:'abc@mail.com',mobile:'21212121'},sendThankYouEmail:'true'}

Example Output:
1) {"status":"SUCCESS","data":{"uniqueSharingLink":"http://bit.ly/ABC123","uniqueSharingCode":"AA908AD7"}}
2) {"status":"FAILED","ERROR_CODE":"ALREADY_REFERRED"} 

    

 

Response Codes:


Status

Error Codes

Description

FAILED

INVALID_CAMPAIGN

When the campaign is not valid (deactivated or timed out campaign)

FAILED

CAMPAIGN_NOT_SUPPORTED

When the given campaign hash id does not match a valid campaign

FAILED

INVALID_DATA

Given data is not formatted properly (JSON) or not submitted as part of the request

FAILED

INVALID_CUSTOMER_DATA

When the customer information is missing in the request


FAILED

INVALID_FRIEND_DATA

When the friend information is missing in the request

FAILED

INVALID_REQUEST

When the specified “action” does not exist

FAILED

CUSTOMER_ALREADY_EXISTS

When the friend’s information already exists in your account

FAILED

ALREADY_REFERRED

When the friend has been referred previously

SUCCESS


When the api is successfully executed and the referral happened successfully. Unique sharing link & unique sharing code for the contact will also be returned.


Note:

1. If you do not want to send the thank you email multiple times you can set the “sendThankYouEmail” attribute to “false” in the json request.