---
title: "Get customer referrals"
method: GET
path: "/customers/{customer_id}/referrals"
tags: ["Customers"]
---

# Get customer referrals

`GET /customers/{customer_id}/referrals`

A referral program is a customer acquisition technique in which existing customers invite others to register. Each participating customer receives a unique referral code to share. When a new customer registers using that code, a link is recorded between the two accounts and any configured incentives are applied according to the referral campaign rules.

The technique is known under several names in the industry:

- **Member get member (MGM)** - the most common term in loyalty and CRM programs; emphasises that an existing member recruits a new one.
- **Refer a friend** - the consumer-facing label most often used in marketing communications.
- **Friend referral** - a variant of the above, common in mobile and e-commerce contexts.
- **Referral marketing** - the broader marketing discipline term for advocacy-driven acquisition.

In CareCloud, the referral program is configured at the campaign level. A referral campaign defines the code generation method, validity period, and the customer relation type created on a successful referral. This endpoint returns the referral code assigned to a customer for a given campaign.

Get the referral code assigned to a customer. Each referral record contains a unique code that the customer can share to invite others to register. When a new customer registers using the code, a customer relation is created between the new customer and the referral code holder.

**Default campaign behaviour**

When no `referral_campaign_id` filter is provided, the result contains the code for the project's default referral campaign. To retrieve a code for a specific campaign, pass the `referral_campaign_id` filter.

Related: [GET /customers](https://carecloud.readme.io/reference/getcustomers)

## Path parameters

- `customer_id` string, required

## Query parameters

- `count` integer
- `offset` integer
- `sort_field` string
- `sort_direction` 'ASC' | 'DESC'
- `is_valid` true | false
- `referral_campaign_id` string
- `referral_code` string

## Headers

- `Accept-Language` string

## Response `200`

OK

- object
  - `data` object
    - `referrals` Referral[] — Collection of customer referral codes.
      - `referral_id` string, required — The unique ID of the referral record.
      - `code` string, required — The referral code to share with others.
      - `customer_id` string, required — The unique ID of the customer who owns the referral code. [GET /customers](https://carecloud.readme.io/reference/getcustomers)
      - `referral_campaign_id` string, required — The unique ID of the referral campaign the code belongs to.
      - `valid_to` string, nullable — Timestamp of when the referral code expires. Null means the code does not expire. Format: `YYYY-MM-DD HH:MM:SS`. All times are in the local timezone.
    - `total_items` integer — The number of all found referral codes.

## Other responses

- `400` — Bad input parameter. The response body's `error.error_data.invalid_params[]` array lists the parameters that caused the failure, each carrying a `reason` code. See the `BadRequestErrorBody` schema for the generic reason taxonomy. Operations with domain-specific business rules document additional reasons at the operation level.
- `401` — The client has invalid credentials or auth token.
- `403` — The client does not exist or the client tried to access an unauthorized property or resource.
- `404` — The resource was not found.
- `405` — The resource does not support the specified HTTP method.
- `429` — Too many requests - more than the resource limit.
- `500` — Server is not working as expected.
- `503` — Temporary state when the service is temporarily unavailable, overloaded or there is a maintenance window.

---

[API](https://skmtc.net/crmcarecloud/apis/rest-api-reference.md) · [All operations](https://skmtc.net/crmcarecloud/apis/rest-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crmcarecloud/rest-api-reference/revisions/329c06dbf8d9/schema)
