# Members & Cards

Manage loyalty program members: retrieve member information, check points balance, register new members, and enroll existing customers into loyalty programs.

### `GET /v1/loyalty/restaurants/{restaurantId}/customers/{customerId}/member` - Get Loyalty Member by Customer ID

Retrieve loyalty member information for a specific customer at a given restaurant. Customers can only access their own membership. Optionally includes SmartPass data.

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| restaurantId | integer | Yes | The unique identifier of the restaurant. |
| customerId | integer | Yes | The unique identifier of the customer. |
| includeSmartPass | boolean | No | Whether to include SmartPass URL in the response. |

#### Response

```json
{
  "status": 200,
  "code": "loyalty_card_found",
  "message": "A loyalty card has been found for that code.",
  "data": {
    "id": "member_abc123",
    "customerId": 5001,
    "externalId": "ext_789",
    "cardNumber": "CARD-001234",
    "email": "john.doe@example.com",
    "phone": "+33612345678",
    "points": 1250,
    "tierName": "Gold"
  }
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "loyalty\_card\_found" | Machine-readable application code for the result. |
| message | string | "A loyalty card has been found for that code." | Human-readable result message. Do not use this value for program logic. |
| data | object | {…} | Endpoint-specific response payload. |
| data.id | string | "member\_abc123" | The id value. |
| data.customerId | integer | 5001 | Identifier of the customer. |
| data.externalId | string | "ext\_789" | Identifier in the connected external system. |
| data.cardNumber | string | "CARD-001234" | The card number value. |
| data.email | string | "john.doe@example.com" | Email address. |
| data.phone | string | "+33612345678" | Phone number. |
| data.points | integer | 1250 | The points value. |
| data.tierName | string | "Gold" | The tier name value. |

### `GET /v1/loyalty/restaurants/{restaurantId}/customers/{externalId}/points` - Get Points Balance

Retrieve the current points balance for a loyalty member identified by their external ID at a specific restaurant.

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| restaurantId | integer | Yes | The unique identifier of the restaurant. |
| externalId | string | Yes | The external loyalty provider ID of the member. |

#### Response

```json
{
  "status": 200,
  "code": "points_balance_found",
  "message": "Points balance has been found.",
  "data": {
    "points": 1250,
    "currency": "pts"
  }
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "points\_balance\_found" | Machine-readable application code for the result. |
| message | string | "Points balance has been found." | Human-readable result message. Do not use this value for program logic. |
| data | object | {…} | Endpoint-specific response payload. |
| data.points | integer | 1250 | The points value. |
| data.currency | string | "pts" | ISO 4217 currency code. |

### `POST /v1/loyalty/restaurants/{restaurantId}/members/register` - Register Loyalty Member

Register a new member in the loyalty program for a restaurant. The memberId can be an email address or phone number. If Splio pairing is enabled, this also ensures a customer account exists for the brand. Primarily used by Kiosk and POS.

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| restaurantId | integer | Yes | The unique identifier of the restaurant. |

#### Request Body

```json
{
  "memberId": "john.doe@example.com",
  "optIns": [
    1,
    2
  ]
}
```

##### Request Body Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| memberId | string | "john.doe@example.com" | Identifier of the associated member. |
| optIns | array | \[…\] | List of opt ins entries. |
| optIns\[\] | integer | 1 | The opt ins value. |

#### Response

```json
{
  "status": 200,
  "code": "loyalty_card_found",
  "message": "A loyalty card has been found for that code.",
  "data": {
    "id": "member_abc123",
    "customerId": 5001,
    "externalId": "ext_789",
    "email": "john.doe@example.com",
    "phone": null,
    "points": 0,
    "tierName": null
  }
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "loyalty\_card\_found" | Machine-readable application code for the result. |
| message | string | "A loyalty card has been found for that code." | Human-readable result message. Do not use this value for program logic. |
| data | object | {…} | Endpoint-specific response payload. |
| data.id | string | "member\_abc123" | The id value. |
| data.customerId | integer | 5001 | Identifier of the customer. |
| data.externalId | string | "ext\_789" | Identifier in the connected external system. |
| data.email | string | "john.doe@example.com" | Email address. |
| data.phone | null | null | Phone number. |
| data.points | integer | 0 | The points value. |
| data.tierName | null | null | The tier name value. |

### `POST /v1/loyalty/restaurants/{restaurantId}/customers/{customerId}/enrollment` - Enroll Customer in Loyalty

Enroll an existing customer into the loyalty program for a restaurant. The customer must already exist and the request must come from the customer themselves. The enrollment method (phone or email) depends on the provider register configuration.

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| restaurantId | integer | Yes | The unique identifier of the restaurant. |
| customerId | integer | Yes | The unique identifier of the customer to enroll. |

#### Response

```json
{
  "status": 200,
  "code": "module_loyalty_updated",
  "message": "A module loyalty has been updated.",
  "data": {
    "id": "member_abc123",
    "customerId": 5001,
    "externalId": "ext_789",
    "email": "john.doe@example.com",
    "points": 0
  }
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "module\_loyalty\_updated" | Machine-readable application code for the result. |
| message | string | "A module loyalty has been updated." | Human-readable result message. Do not use this value for program logic. |
| data | object | {…} | Endpoint-specific response payload. |
| data.id | string | "member\_abc123" | The id value. |
| data.customerId | integer | 5001 | Identifier of the customer. |
| data.externalId | string | "ext\_789" | Identifier in the connected external system. |
| data.email | string | "john.doe@example.com" | Email address. |
| data.points | integer | 0 | The points value. |

### `POST /v1/loyalty/pairing` - Pair Customer with Loyalty Program

Create a new customer account and pair it with the loyalty program in a single step. This is a public endpoint (no authentication required) that handles both customer creation and loyalty registration.

#### Request Body

```json
{
  "restaurantId": 1001,
  "firstName": "John",
  "lastName": "Doe",
  "email": "john.doe@example.com",
  "password": "securePassword123",
  "birthdate": "1990-05-15",
  "gender": "male",
  "phone": "+33612345678",
  "country": "FR",
  "optinLoyalty": true,
  "optinMarketing": false,
  "customFields": {
    "favoriteFood": "pizza"
  },
  "optInLists": [
    1,
    2
  ]
}
```

##### Request Body Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| restaurantId | integer | 1001 | Identifier of the restaurant. |
| firstName | string | "John" | The first name value. |
| lastName | string | "Doe" | The last name value. |
| email | string | "john.doe@example.com" | Email address. |
| password | string | "securePassword123" | The password value. |
| birthdate | string | "1990-05-15" | The birthdate value. |
| gender | string | "male" | The gender value. |
| phone | string | "+33612345678" | Phone number. |
| country | string | "FR" | The country value. |
| optinLoyalty | boolean | true | The optin loyalty value. |
| optinMarketing | boolean | false | The optin marketing value. |
| customFields | object | {…} | Object containing custom fields fields. |
| customFields.favoriteFood | string | "pizza" | The favorite food value. |
| optInLists | array | \[…\] | List of opt in lists entries. |
| optInLists\[\] | integer | 1 | The opt in lists value. |

#### Response

```json
{
  "id": "member_abc123",
  "customerId": 5001,
  "externalId": "ext_789",
  "cardNumber": "CARD-001234",
  "email": "john.doe@example.com",
  "phone": "+33612345678",
  "points": 0
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| id | string | "member\_abc123" | The id value. |
| customerId | integer | 5001 | Identifier of the customer. |
| externalId | string | "ext\_789" | Identifier in the connected external system. |
| cardNumber | string | "CARD-001234" | The card number value. |
| email | string | "john.doe@example.com" | Email address. |
| phone | string | "+33612345678" | Phone number. |
| points | integer | 0 | The points value. |
