v1

latestOpenAPI 3.0.12026-07-24501176.6 MB

Get Referral Details

Retrieves the stats of the referrals along with the unique referral code of a specific customer.

get/customer/referrals

Query parameters

mobilestring

Mobile number of the customer.

emailstring

Email ID of the customer.

external_idstring

External ID of the customer.

idinteger

Unique ID of the customer.

campaign_tokenstring

Pass the specific token id of the referral campaign that you want to fetch. If no campaign id is passed, the details of the customer’s referral history of the default campaign will be retrieved

start_datestring date

Get customers referred on or after a specific date (YYYY-MM-DD). To get referral history of a specific duration, pass the date range in start_date and end_date.

end_datestring date

Get customers referred before a specific date (YYYY-MM-DD). To get referral history of a specific duration, pass the date range in start_date and end_date.

store_codestring

Retrieve referral stats of the specific store. Default value will be the current store. Set all to track details from all the stores

order_by'created_date' | 'amount' | 'valid_till'

Order the results by a specific entry. valid_till is for issued_till.

sort_order'asc' | 'desc'

Sort the results in ascending (asc) or descending (desc) order of order_by.

limitinteger

Limit the number of results to be retrieved. For example: limit=10 to retrieve the history of ten recent coupons of the customer.

only_referral_codeboolean

Set true to retrieve the referral code of the respective referral campaigns (of the specific customer).

Response

200

Example response

{
  "response": {
    "status": {
      "success": "true",
      "code": 200,
      "message": "SUCCESS"
    },
    "customer": {
      "mobile": "971544979350",
      "external_id": "971544979350",
      "firstname": "Ishant",
      "lastname": "Jindal",
      "referral_code": "1mba0dlo5",
      "invitees": {
        "referral_type": [
          {
            "type": "MOBILE",
            "invitee": [
              {
                "identifier": "971564265901",
                "name": "Siddhant",
                "invited_on": "2020-01-29 12:25:46.0",
                "till": {
                  "code": "jotun.uae.admin.2",
                  "name": "jotun.uae.admin.2"
                }
              }
            ]
          }
        ]
      },
      "referees": {
        "referee": [
          {
            "event_type": "REGISTRATION",
            "added_on": "2020-01-29 13:24:15"
          }
        ]
      },
      "item_status": {
        "success": "true",
        "code": 1000,
        "message": "Referral statistics retrieved successfully"
      }
    }
  }
}