Get Referrals (Lookup)

Retrieves the referee details of a customer (referral).

Using Multiple Identifiers

When dual eligibility is enabled in your organisation, the API allows you to send multiple identifiers while fetching details. The system automatically identifies which one is the primary identifier and retrieves the details accordingly. This removes the need for you to know or specify only the primary identifier. This is beneficial in a dual eligibility–enabled scenario, as the feature allows you to register multiple users with the same secondary identifiers. When you submit multiple identifiers in a lookup request:

  • The service checks that dual eligibility is active.
  • It parses all submitted identifiers, for example email,mobile,externalId
  • It determines which identifier is configured as the primary key.
  • If one of the provided values matches the primary key, the API uses it for the lookup.
  • The API returns the single customer profile associated with the primary identifier.

You can enter multiple identifiers as comma-separated values using the identifierName and identifierValue query parameters. Ensure the order of the identifierName matches the identifierValue.

Endpoint example with multiple identifiers

https://eu.api.capillarytech.com/v2/customers/lookup/referrals?source=INSTORE&identifierName=email,mobile&[email protected],915795008395

Here,

Note: If you provide only one identifier that is not the primary identifier, the system will return an error, 8015 - Customer not found for given identifiers.

Rate limit

  • Demo and Testing Clusters: 1,000 requests per minute per API key
  • Other Organizations: The rate limit is brand-specific.

To modify the limit, create a ticket with the Capillary Product support team.

Example request

curl --location 'https://eu.api.capillarytech.com/v2/customers/lookup/referrals?source=INSTORE&identifierName=mobile&identifierValue=919777785205&campaignToken=SL7UN' \
--header 'accept: application/json' \
--header 'Authorization: Basic ='

Resource Information

URIv2/customers/lookup/referrals
HTTP methodGET
AuthenticationBasic
Pagination supportYes
Batch supportNA

Query Parameter

ParameterTypeRequiredDescription
sourcestringYesSource system where the referral originated
identifierNamestringYesType of identifier used for lookup
identifierValuestringYesValue of the identifier to lookup
campaignTokenstringYesUnique token identifying the referral campaign
limitintNoMaximum records returned per page. Default value: 10
offsetintNoNumber of records skipped (zero-based). Default value: 0

Example response

{
    "pagination": {
        "limit": 10,
        "offset": 0,
        "total": 0
    },
    "data": [
        {
            "customer": {
                "id": 564955301,
                "profiles": [
                    {
                        "firstName": "testgrp3",
                        "lastName": "testgrpv2",
                        "fields": {},
                        "allFields": {},
                        "identifiers": [
                            {
                                "type": "externalId",
                                "value": "434547"
                            },
                            {
                                "type": "email",
                                "value": "[email protected]"
                            },
                            {
                                "type": "mobile",
                                "value": "919777785205"
                            }
                        ],
                        "commChannels": [],
                        "userId": 564955301,
                        "accountId": "",
                        "autoUpdateTime": "2025-09-08T11:32:27Z",
                        "identifiersAll": [
                            {
                                "type": "externalId",
                                "value": "434547"
                            },
                            {
                                "type": "email",
                                "value": "[email protected]"
                            },
                            {
                                "type": "mobile",
                                "value": "919777785205"
                            }
                        ]
                    }
                ]
            },
            "referralCode": "testgrp3rp5ZKo",
            "invitees": [],
            "referee": [],
            "incentives": []
        }
    ],
    "warnings": [],
    "errors": []
}

Response Parameter

ParameterTypeDescription
.paginationobjectObject containing the pagination details
..limitintegerMaximum number of records to return
..offsetintegerStarting index for returning the records
..totalintegerTotal records matching the query
.dataarrayArray containing referral information
..customerobjectCustomer details
...idlongUnique customer ID
...profilesarrayArray containing the customer details
....firstNamestringCustomer's first name
....lastNamestringCustomer's last name
....fieldsobjectCustom fields (key-value pairs)
.....allFieldsobjectAll available fields (including system fields)
....identifiersarrayArray containing information on the identifiers associated with the specific source for the customer(e.g., email, mobile)
.....typestringIdentifier type (e.g., "externalId", "email", "mobile")
.....valuestringIdentifier value (e.g., email address, phone number)
....commChannelsarrayCommunication channels (e.g., email, SMS)
....userIdlongUnique user ID (matches customer.id)
....accountIdstringAccount ID (for multi-account systems)
....autoUpdateTimestringTimestamp of last profile update (ISO 8601) YY-MM-DD-HH-MM-SS
....identifiersAllarrayArray containing information on all the identifiers known for the customer across sources
.....typestringIdentifier type (e.g., "externalId", "email", "mobile")
.....valuestringIdentifier value (e.g., email address, phone number)
..referralCodestringunique code assigned to the referrer customer, to be shared with referees; used to attribute the referral and rewards.
..inviteesarrayCustomers invited by this customer
..refereearrayList of referee details
..incentivesarrayIncentives earned via referrals
.warningsarrayArray containing warnings, if any.
.errorsarrayArray containing errors, if any.

Error Code

Error CodeDescriptionReason
8015Customer not found for the given identifiersThe identifier provided is incorrect. Also occurs when a customer does not exist and when a lookup uses a valid but non-primary identifier.
8003Invalid sourceUnsupported source passed
8013Lookup,Invalid identifier passedUnsupported identifier value passed
1222Internal error with the referral systemcampaigntoken value is invalid
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!