The Gather Refer a Friend API
As a Gather account, you can send Gather a Referral event. Referral events are either a:
sale
optin
To successfully access the referral event API, first authenticate with your account’s email and password. With your returned bearer token, you will be able to make subsequent requests.
1. Authenticate first
method: POST
api/v1/authentication#authenticate_user
Authentication will return to you a JWT authentication token.
Example Response
{
"auth_token": "XXXXXXX.XXXXXXX.XXXXXXXXXXXXXXXXXXXXXX",
"user": {
"id": 5485,
"email": "emailusedforgatheraccount@domain .com"
}
}
Referral Event API endpoint
method: POST
https://www.gathercustomers.com/api/v1/referral_event
Parameters
*API_Key: String
*referral_code: from cookie (only applicable for an affiliate program at this stage)
* referred_lead_email: string (required for a refer a friend campaign)
*campaign_id: your campaign id
ip_address: session ip address (incase we need to do to some retrospective reconciliation)
referred_lead_name:
*event_name: choose between ‘sale’ or ‘optin’. Use sale when you are sending an event for a sale. The system will default to ‘optin’ if no event name sent.
subscribed: A boolean flag for if a referred lead is subscribed to marketing. Send either a ‘true’ or ‘false’ value. The default will be ‘false’ if this is not set.
uuid: string. Any external id associated with the event.
order_id: your order id.
order_price: price of order.
order_currency: currency of order passed as the currency abbreviation. E.g. US Dollar is USD.
reward_code: string. Code used by the referred customer to make a purchase. (applicable to a referral campaign)
Authorization header: Add Bearer Token which would have been returned to you in the step 1.
Example response:
Success response for refer a friend campaign:
{
"status": "processing referral"
}
Success response for partner or affiliate program:
{
"message_type": "created_referral",
"partner_name": "Gather",
"referrer_name": "Gather",
"ex_partner_id": "8937498364",
"ex_referrer_id": "8937498364",
"partner_email": "hello@gathercustomers.com",
"referrer_email": "hello@gathercustomers.com",
"partner_codes": {
"branded": "gather",
"default": "8367473800"
},
"referrer_code": "a57edeb358",
"referred_lead": {
"id": 170,
"email": "Jondoe@example.com",
"name": "john doe",
"phone": null,
"account_id": null,
"created_at": "2020-12-21T05:23:47.812Z",
"updated_at": "2020-12-21T05:23:47.812Z",
"referral_code": "b41c1d704e",
"unsubscribe_flag": false,
"retargeted_with_email": false,
"invitation_message": null,
"campaign_id": null,
"confirmed": null,
"synced": false,
"shopify_id": null,
"latitude": null,
"longitude": null,
"ip_address": "84.247.49.22",
"country": null,
"country_code": "SG",
"address": null,
"channel_url": null,
"data_attributes": {},
"subscribed": false,
"reward_tier": null,
"mailchimp_integration_provider_last_sync": null,
"partner_id": null
},
"referral": {
"ex_data": {
"event": "sale",
"uuid": "12345",
"order_id": "782632170",
"order_price": "45"
},
"campaign_id": "2",
"goal_type": "sale",
"id": 124,
"status": "successful_on_sale",
"lead_id": 100,
"referred_lead_id": 170,
"created_at": "2020-12-21T05:23:47.837Z",
"updated_at": "2020-12-21T05:23:48.036Z",
"message": null,
"account_id": 1,
"confirmation_code": "2c71e2039756de7a456c",
"referral_type": null,
"ip_match_flag": false,
"browser_match_flag": false,
"completion_url": null,
"completion_notification_type": null,
"manually_approved": false,
"referred_confirmation_sent": false
}
}