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

> Follow this quickstart guide to 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.

## Step 1 — Generate an Auth Token

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

```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;
```

**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

```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"
  }'
```

## Step 3 — Submit a Transaction

```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"
  }'
```

## Step 4 — Check Points Balance

```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}
  }'
```

## Next Steps

> [card] [Bulk Transactions (V2)](https://help-loyalife.xoxoday.com/api-reference/transactions/insert-transaction-v2.md)
>
> Submit multiple transactions asynchronously as a batch.

> [card] [Redeem Points](https://help-loyalife.xoxoday.com/api-reference/payment-gateway/redeem-points.md)
>
> Initiate a points redemption for a member.
