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

# Create Profile

> Enroll a new member in your loyalty program.

Registers a new member in your loyalty program. The `relation_reference` you supply becomes the member's permanent identifier across all Loyalife APIs — choose it carefully (typically an email-based UUID or your internal customer ID). New members are created in `Inactive` status by default; activation happens through a separate workflow. If a member with the same `relation_reference` already exists, the API returns a `409` rather than overwriting.

## Member Status Values

| Code | Status             | Description                                                                  |
| ---- | ------------------ | ---------------------------------------------------------------------------- |
| `1`  | Active             | Member is fully active — can earn points, redeem, and log in                 |
| `2`  | Suspended          | Member account is suspended                                                  |
| `3`  | Login Blocked      | Member cannot log in but other operations may still function                 |
| `4`  | Canceled           | Member account has been canceled                                             |
| `5`  | Inactive           | Default state for new enrollments — member is enrolled but not yet activated |
| `6`  | Membership Blocked | Member's loyalty membership is blocked                                       |

<Note>
  Status can be managed both via API and through the Loyalife Admin portal. Any mandatory custom attributes defined in your CPD schema must also be included in the request. Optional custom attributes can also be passed.
</Note>

## Responses

<AccordionGroup>
  <Accordion title="200 — Success">
    | Path                       | Type    | Description                     |
    | -------------------------- | ------- | ------------------------------- |
    | `results.IsSucessful`      | boolean | `true`                          |
    | `results.ErrorCode`        | string  | `000`                           |
    | `results.ExceptionMessage` | string  | `Success`                       |
    | `results.ReturnObject`     | boolean | `true` on successful enrollment |
  </Accordion>

  <Accordion title="409 — Member Already Exists">
    | Path                       | Type    | Description                                          |
    | -------------------------- | ------- | ---------------------------------------------------- |
    | `results.IsSucessful`      | boolean | `false`                                              |
    | `results.ErrorCode`        | string  | Error code from the platform                         |
    | `results.ExceptionMessage` | string  | Human-readable reason — check this field for details |
  </Accordion>
</AccordionGroup>

***

## Error Codes

| Code   | ExceptionMessage                                   | Cause                                                   |
| ------ | -------------------------------------------------- | ------------------------------------------------------- |
| `000`  | Success                                            | Member enrolled successfully                            |
| `E201` | Duplicate record                                   | `relation_reference` already exists in this program     |
| `E205` | Duplicate Email: The email already exists          | `email_id` is already registered to another member      |
| `E206` | Duplicate Mobile: The mobile number already exists | `mobile_number` is already registered to another member |
| `E102` | Invalid Email                                      | `email_id` format is invalid                            |
| `E103` | Mandatory field missing — MRN                      | `relation_reference` not provided                       |
| `E104` | Mandatory field missing — Name                     | `full_name` not provided                                |
| `E105` | Mandatory field missing — Mobile Number            | `mobile_number` not provided                            |
| `E106` | Mandatory field missing — DOB                      | `dob` not provided                                      |
| `E107` | Mandatory field missing — Gender                   | `gender` not provided                                   |
| `006`  | Insert failed                                      | Data was valid but the database insertion failed        |
| `999`  | Bad request                                        | Malformed JSON or missing required fields               |

<Note>
  `email_id` is configured as non-mandatory for some programs (e.g. Citibank). Mandatory field codes `E103`–`E107` only fire when the field is configured as required for your program.
</Note>


## OpenAPI

````yaml POST /lbms-ingress/member/api/Member/CreateProfileWithAttributes
openapi: 3.1.0
info:
  title: Loyalife LBMS API
  description: >-
    REST API for Loyalife's Loyalty Management System. Covers member management,
    OTP authentication, loyalty transactions, and points redemption.
  version: 1.0.0
  contact:
    name: Xoxoday Support
    email: support@xoxoday.com
servers:
  - url: https://loyalife-api.xoxoday.in
    description: Production
security:
  - bearerAuth: []
paths:
  /lbms-ingress/member/api/Member/CreateProfileWithAttributes:
    post:
      tags:
        - Member Management
      summary: Create Profile
      description: Enroll a new member in your loyalty program.
      operationId: createProfile
      parameters:
        - $ref: '#/components/parameters/pintProgramId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - relation_reference
                - full_name
                - email_id
                - mobile_number
                - status
              properties:
                relation_reference:
                  type: string
                  description: >-
                    Unique member identifier — typically email-based. Primary
                    key across all APIs.
                  example: jane.doe@example.com
                full_name:
                  type: string
                  example: Jane Doe
                email_id:
                  type: string
                  format: email
                  example: jane.doe@example.com
                mobile_number:
                  type: string
                  example: '+919876543210'
                status:
                  type: string
                  description: >-
                    Use `5` for Inactive — standard initial state for new
                    enrollments.
                  example: '5'
                address:
                  type: string
                  example: 123 Main Street, Mumbai 400001
                gender:
                  type: string
                  enum:
                    - M
                    - F
                    - O
                  example: F
                dob:
                  type: string
                  format: date
                  description: Date of birth in YYYY-MM-DD format
                  example: '1990-06-15'
            example:
              relation_reference: jane.doe@example.com
              full_name: Jane Doe
              email_id: jane.doe@example.com
              mobile_number: '+919876543210'
              gender: F
              dob: '1990-06-15'
              status: '5'
      responses:
        '200':
          description: Member created
          content:
            application/json:
              example:
                results:
                  IsSucessful: true
                  ErrorCode: '000'
                  ExceptionMessage: Success
                  ReturnObject: true
        '409':
          description: Member already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
              example:
                results:
                  IsSucessful: false
                  ErrorCode: E409
                  ExceptionMessage: Member already exists
components:
  parameters:
    pintProgramId:
      name: pintProgramId
      in: query
      required: true
      description: Your loyalty program ID
      schema:
        type: integer
        example: 19
  schemas:
    StandardError:
      type: object
      properties:
        results:
          type: object
          properties:
            IsSucessful:
              type: boolean
              example: false
            ErrorCode:
              type: string
              example: E400
            ExceptionMessage:
              type: string
              example: Error description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT obtained from Generate Auth Token. Pass as `Authorization: bearer
        {token}`.

````