Loyalty

Get customer's full loyalty ledger

Changed on

[!note] Management API endpoints are not meant to be used in real-time integrations that directly serve your end users. Rate limit: 3 requests per second.

Get the loyalty ledger for this profile integration ID.

To get the integrationId of the profile from a sessionId, use the Update customer session endpoint.

Important: To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's Get customer's loyalty logs.

get/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}

Request

Path parameters

loyaltyProgramIdstring required

The identifier for the loyalty program.

integrationIdstring required

The integration identifier for this customer profile. Must be:

  • Unique within the deployment.
  • Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID.

Once set, you cannot update this identifier.

Response

OK

subLedgersobject

A map containing a list of all loyalty subledger balances.

Example response

{
  "ledger": {
    "transactions": [
      {
        "created": "2021-07-20T22:00:00Z",
        "programID": 5,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "customerSessionID": "t2gy5s-47274",
        "eventID": 5,
        "type": "addition",
        "amount": 100,
        "startDate": "2021-07-20T22:00:00Z",
        "expiryDate": "2022-07-20T22:00:00Z",
        "name": "Add points on purchase",
        "subLedgerID": "mysubledger",
        "userID": 499,
        "validityDuration": "30D"
      }
    ],
    "expiringPoints": [
      {
        "created": "2021-07-20T22:00:00Z",
        "programID": 5,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "customerSessionID": "t2gy5s-47274",
        "eventID": 5,
        "type": "addition",
        "amount": 100,
        "startDate": "2021-07-20T22:00:00Z",
        "expiryDate": "2022-07-20T22:00:00Z",
        "name": "Add points on purchase",
        "subLedgerID": "mysubledger",
        "userID": 499,
        "validityDuration": "30D"
      }
    ],
    "activePoints": [
      {
        "created": "2021-07-20T22:00:00Z",
        "programID": 5,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "customerSessionID": "t2gy5s-47274",
        "eventID": 5,
        "type": "addition",
        "amount": 100,
        "startDate": "2021-07-20T22:00:00Z",
        "expiryDate": "2022-07-20T22:00:00Z",
        "name": "Add points on purchase",
        "subLedgerID": "mysubledger",
        "userID": 499,
        "validityDuration": "30D"
      }
    ],
    "pendingPoints": [
      {
        "created": "2021-07-20T22:00:00Z",
        "programID": 5,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "customerSessionID": "t2gy5s-47274",
        "eventID": 5,
        "type": "addition",
        "amount": 100,
        "startDate": "2021-07-20T22:00:00Z",
        "expiryDate": "2022-07-20T22:00:00Z",
        "name": "Add points on purchase",
        "subLedgerID": "mysubledger",
        "userID": 499,
        "validityDuration": "30D"
      }
    ],
    "expiredPoints": [
      {
        "created": "2021-07-20T22:00:00Z",
        "programID": 5,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "customerSessionID": "t2gy5s-47274",
        "eventID": 5,
        "type": "addition",
        "amount": 100,
        "startDate": "2021-07-20T22:00:00Z",
        "expiryDate": "2022-07-20T22:00:00Z",
        "name": "Add points on purchase",
        "subLedgerID": "mysubledger",
        "userID": 499,
        "validityDuration": "30D"
      }
    ],
    "currentTier": {
      "id": 11,
      "name": "bronze",
      "startDate": "2025-05-03T12:32:00Z07:00",
      "expiryDate": "2026-08-02T15:04:05+07:00",
      "downgradePolicy": "one_down",
      "source": "points",
      "reason": "Subscription to newsletter"
    }
  },
  "subLedgers": {
    "mysubledger": {
      "total": 0,
      "totalActivePoints": 286,
      "totalPendingPoints": 50,
      "totalSpentPoints": 150,
      "totalExpiredPoints": 25,
      "totalNegativePoints": 0
    }
  }
}

Changes

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status