> ## 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.

# Quickstart

> Make your first Loyalife API call in under 5 minutes.

## Prerequisites

Before you begin, obtain the following from your Xoxoday onboarding pack:

| Credential      | Description                                 |
| --------------- | ------------------------------------------- |
| `client_id`     | Your OAuth client ID                        |
| `client_secret` | Your OAuth client secret                    |
| `ProgramId`     | Your loyalty program ID (e.g. `19`)         |
| `domain`        | API domain (e.g. `loyalife-api.xoxoday.in`) |

<Warning>
  Never commit `client_secret` or bearer tokens to source control.
</Warning>

## Step 1 — Generate an Auth Token

All API calls require a bearer token. Generate one using your client credentials:

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://{domain}/lbms-ingress/oauth/api/Auth/Token \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --data '{
      "grant_type": "client_credentials",
      "client_id": "{client_id}",
      "client_secret": "{client_secret}",
      "scope": "[\"LOGIN\",\"{RelationReference}\"]"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://{domain}/lbms-ingress/oauth/api/Auth/Token",
      headers={"Content-Type": "application/json", "Accept": "application/json"},
      json={
          "grant_type": "client_credentials",
          "client_id": "{client_id}",
          "client_secret": "{client_secret}",
          "scope": '["LOGIN","{RelationReference}"]'
      }
  )
  token = response.json()["results"]["token"]
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    `https://{domain}/lbms-ingress/oauth/api/Auth/Token`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json", "Accept": "application/json" },
      body: JSON.stringify({
        grant_type: "client_credentials",
        client_id: "{client_id}",
        client_secret: "{client_secret}",
        scope: '["LOGIN","{RelationReference}"]'
      })
    }
  );
  const { results } = await response.json();
  const token = results.token;
  ```
</CodeGroup>

**Response**

```json theme={null}
{
  "results": {
    "token": "eyJhbGci...",
    "tokenExpiresOn": "2026-03-16T15:15:02Z"
  }
}
```

Save the `token` value — use it as `Authorization: bearer {token}` in all subsequent calls.

## Step 2 — Enroll a Member

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://{domain}/lbms-ingress/member/api/Member/CreateProfileWithAttributes?pintProgramId={ProgramId}' \
    --header 'Authorization: bearer {token}' \
    --header 'Content-Type: application/json' \
    --data '{
      "relation_reference": "jane.doe@example.com",
      "full_name": "Jane Doe",
      "email_id": "jane.doe@example.com",
      "mobile_number": "+919876543210",
      "status": "5"
    }'
  ```
</CodeGroup>

## Step 3 — Submit a Transaction

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://{domain}/lbms-ingress/transaction-lm/API/Transaction/InsertTransactionData?pintProgramId={ProgramId}' \
    --header 'Authorization: bearer {token}' \
    --header 'Content-Type: application/json' \
    --data '{
      "transaction_id": "TXN-001",
      "amount": 500,
      "transaction_date": "2026-05-11",
      "product_code": "RETAIL001",
      "member_relation_reference": "jane.doe@example.com",
      "transaction_type": "DR"
    }'
  ```
</CodeGroup>

## Step 4 — Check Points Balance

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://{domain}/lbms-ingress/transaction-lm/API/Transaction/GetMemberStatementSummary' \
    --header 'Authorization: bearer {token}' \
    --header 'Content-Type: application/json' \
    --data '{
      "RelationReference": "jane.doe@example.com",
      "TransactionCurrency": "DEFAULT",
      "RelationType": 4,
      "ProgramId": {ProgramId}
    }'
  ```
</CodeGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Bulk Transactions (V2)" icon="layer-group" href="/api-reference/transactions/insert-transaction-v2">
    Submit multiple transactions asynchronously as a batch.
  </Card>

  <Card title="Redeem Points" icon="gift" href="/api-reference/payment-gateway/redeem-points">
    Initiate a points redemption for a member.
  </Card>
</CardGroup>
