> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mention-me.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Find a friend

> Search for a referrer by name (or email) to allow your customer to find their friend via NameShare.

If an exact match is found, we will return a 200 response. The 200 response will include the `referrerMentionMeIdentifier` and `referrerToken`. You should next collect the referee's details (i.e. their email address) and register them with the "Register referee" API. Completion of the registration with a valid email, `referrerMentionMeIdentifier` and `referrerToken` will allow the referee to gain their reward.

If no exact match is found, we will return a 404 response. A 404 may indicate we didn't find anyone, or it may indicate that we found multiple people with the same name. If we did find multiple people with the same name, we will also set the `foundMultipleReferrers` parameter in the root of the response to true.

If `foundMultipleReferrers` is set to true, the client should prompt the referee to narrow down the search, e.g. by entering the email address of the referrer. The exact narrowing strategy is up to the client.



## OpenAPI

````yaml /openapi/consumer_api.oas.json get /api/consumer/{version}/referrer/search
openapi: 3.0.0
info:
  title: Consumer API
  description: Create your own front end for the referral journey using our Consumer API.
  termsOfService: https://mention-me.com/help/tnc_f/site
  version: v2
servers:
  - url: https://mention-me.com
    description: Production
  - url: https://demo.mention-me.com
    description: Demo
security: []
tags:
  - name: Record Order
  - name: Enrol Referrer
  - name: Get referrer dashboard
  - name: Find referrer by name
  - name: Link new customer to referrer
paths:
  /api/consumer/{version}/referrer/search:
    get:
      tags:
        - Find referrer by name
      summary: Find a friend
      description: >-
        Search for a referrer by name (or email) to allow your customer to find
        their friend via NameShare.


        If an exact match is found, we will return a 200 response. The 200
        response will include the `referrerMentionMeIdentifier` and
        `referrerToken`. You should next collect the referee's details (i.e.
        their email address) and register them with the "Register referee" API.
        Completion of the registration with a valid email,
        `referrerMentionMeIdentifier` and `referrerToken` will allow the referee
        to gain their reward.


        If no exact match is found, we will return a 404 response. A 404 may
        indicate we didn't find anyone, or it may indicate that we found
        multiple people with the same name. If we did find multiple people with
        the same name, we will also set the `foundMultipleReferrers` parameter
        in the root of the response to true.


        If `foundMultipleReferrers` is set to true, the client should prompt the
        referee to narrow down the search, e.g. by entering the email address of
        the referrer. The exact narrowing strategy is up to the client.
      operationId: get_api_name_search
      parameters:
        - name: version
          in: path
          description: Version
          required: true
          schema:
            type: string
            pattern: v2|v1
            enum:
              - v2
              - v1
          example: v2
        - name: name
          in: query
          description: Name of a referrer to search for (entered by the new customer)
          required: true
          schema:
            type: string
          example: '[REFERRERS-NAME]'
        - name: email
          in: query
          description: >-
            Optionally ask the new customer to qualify the name with an email
            address belonging to the referrer. We typically ask for a Name first
            and then if no matches found, offer Name + Email address.
          required: false
          schema:
            type: string
        - name: request[partnerCode]
          in: query
          description: Your partner code, used to link to your users and offers
          required: true
          schema:
            type: string
          example: '[YOUR-PARTNER-CODE]'
        - name: request[situation]
          in: query
          description: >-
            Situation - a string representing where in the application you are
            making this request
          required: true
          schema:
            type: string
          example: mobile-app
        - name: request[ipAddress]
          in: query
          description: >-
            IP address of the customer connection. If you're making a request on
            behalf of a customer, pass their IP address here. If the customer
            will connect directly, leave this empty and we will retrieve this
            from their request.
          required: false
          schema:
            type: string
        - name: request[localeCode]
          in: query
          description: >-
            Locale code - ISO standard locale code (e.g. en_GB) for the locale
            you expect the content to be in
          required: true
          schema:
            type: string
        - name: request[userDeviceIdentifier]
          in: query
          description: >-
            User Device Identifier should be a unique reference to this
            combination of app + user.
          required: false
          schema:
            type: string
        - name: request[deviceType]
          in: query
          description: >-
            Device type - your description of the device the user is using. We
            use this for performance and conversion optimisation.
          required: false
          schema:
            type: string
        - name: request[appName]
          in: query
          description: Your application name. Used for reporting.
          required: false
          schema:
            type: string
        - name: request[appVersion]
          in: query
          description: >-
            Your application version reference. Used for reporting and
            troubleshooting.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Returned when successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferrerFound'
        '403':
          description: Returned when the integration for this merchant is not enabled
        '404':
          description: Returned when it is not possible to find a match for this search
        '500':
          description: The request contains errors
        '503':
          description: The service was unavailable, try again shortly
components:
  schemas:
    ReferrerFound:
      properties:
        referrer:
          title: >-
            The primary payload of the response, assuming we found the referrer
            successfully. If we didn't this will be empty.
          oneOf:
            - $ref: '#/components/schemas/ReferrerIdentifier'
        foundMultipleReferrers:
          title: >-
            Whether the user should be prompted to narrow the search (by
            entering an email address for example)
          type: boolean
        links:
          title: >-
            Pagination of output and links to associated resources, including
            content-collection items.
          type: array
          items:
            $ref: '#/components/schemas/ContentCollectionLink'
        termsLinks:
          title: Links to the terms and conditions for this offer.
          oneOf:
            - $ref: '#/components/schemas/TermsLinks'
        meta:
          title: >-
            This is used to hold a meta status code which is then used to pass a
            response back to the actual response later.
          type: object
          additionalProperties: true
      type: object
    ReferrerIdentifier:
      properties:
        referrerMentionMeIdentifier:
          title: Our identifier for the referrer identified, the customer ID
          type: integer
        referrerToken:
          title: |-
            Token used to identify the referrer uniquely
            (flowId)
          type: string
        referrerOfferIdentifier:
          title: Identify the Offer (i.e. this is an Offer Id)
          type: integer
        offer:
          title: >-
            Description of the offer and rewards which this referrer is able to
            offer
          default: null
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/Offer'
      type: object
    ContentCollectionLink:
      properties:
        relationship:
          title: Relationship of the link between the two resources
          type: string
          default: content-collection
        resource:
          title: The target resource being linked
          type: array
          items:
            $ref: '#/components/schemas/Content'
      type: object
    TermsLinks:
      properties:
        localeCode:
          title: The locale code of the terms link
          type: string
        linkToTermsInLocale:
          title: Link to the terms and conditions in the locale stated
          type: string
      type: object
    Offer:
      properties:
        id:
          title: The identifier of the offer.
          type: integer
        localeCode:
          title: The locale code of the Offer.
          type: string
        headline:
          title: The headline description for the Offer.
          description: e.g. "You can get a £20 gift card if you refer a friend to ..."
          type: string
        description:
          title: The details of the Offer.
          description: e.g. "Give your friends a 20% off introductory offer"
          type: string
        callToAction:
          title: >-
            The callToAction text of the Offer - typically goes on the button of
            the offer
          description: e.g. "Get a £20 gift card"
          type: string
        privacyNotice:
          title: >-
            The privacyNotice text of the Offer - typically shown near the CTA
            if required by privacy regulation
          description: e.g. "Get a £20 gift card"
          type: string
        privacyLink:
          title: >-
            The URL to the Mention Me privacy policy - typically shown near the
            Privacy Notice.
          description: e.g. "https://mention-me.com/help/privacy_policy"
          type: string
        referrerReward:
          title: The explicit description of the Referrer Reward for the Referrer.
          oneOf:
            - $ref: '#/components/schemas/Reward'
        refereeReward:
          title: The explicit description of the Referee reward for the Referrer.
          oneOf:
            - $ref: '#/components/schemas/Reward'
      type: object
    Content:
      properties:
        key:
          title: The content key
          type: string
        content:
          title: The content string
          type: string
      type: object
    Reward:
      properties:
        description:
          title: Friendly description of a reward for the intended recipient.
          description: >-
            The description we give may vary depending on the point in the flow
            that we choose to give it. Note that in some cases this might be
            "promising the reward" and in other cases "giving it".


            e.g. "You'll get £20 for each friend you refer" e.g. "Your friends
            get a free camera when they order for the first time" e.g. "A 20%
            discount code"
          type: string
        summary:
          title: >-
            Summary - now deprecated - it serves no purpose over and above the
            description.
          type: string
        amount:
          title: >-
            The reward amount - now deprecated (because rewards don't have a
            consistent amount - some have text, percentage, number. Use the
            description to describe the reward.
          type: string
      type: object

````