younifyd
Menu

Get Loyalty Points

Get customer's full loyalty ledger

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

Use it in a workflow

  1. Add a step and choose the Talon.One connector.
  2. Pick the Get Loyalty Points action (under management).
  3. Fill in the fields below, then reference the result from later steps as {{getLoyaltyPoints.response.data}}.

Request

Path parameters

loyaltyProgramIdstringrequired

The identifier for the loyalty program.

integrationIdstringrequired

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

Returns 200 with an object. Read it in later steps with {{getLoyaltyPoints.response.data.<field>}}.

ledgerobject

Ledger of Balance in Loyalty Program for a Customer.

totalnumberrequired

**DEPRECATED** Use `totalActivePoints` property instead. Total amount of currently active and available points in the customer's balance.

totalActivePointsnumberrequired

Total amount of currently active and available points in the customer's balance.

totalPendingPointsnumberrequired

Total amount of pending points, which are not active yet but will become active in the future.

totalSpentPointsnumberrequired

Total amount of points already spent by this customer.

totalExpiredPointsnumberrequired

Total amount of points, that expired without ever being spent.

totalNegativePointsnumberrequired

Total amount of negative points. This implies that `totalActivePoints` is `0`.

transactionsarray<object>16 fields

List of all events that have happened such as additions, subtractions and expiries.

expiringPointsarray<object>16 fields

List of all points that will expire.

activePointsarray<object>16 fields

List of all currently active points.

pendingPointsarray<object>16 fields

List of all points pending activation.

expiredPointsarray<object>16 fields

List of expired points.

currentTierobject5 fields
subLedgersobject

A map containing a list of all loyalty subledger balances.

json
{
  "ledger": {
    "total": 0.8008281904610115,
    "totalSpentPoints": 5.962133916683182,
    "activePoints": [
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      },
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      }
    ],
    "expiringPoints": [
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      },
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      }
    ],
    "totalActivePoints": 6.027456183070403,
    "totalPendingPoints": 1.4658129805029452,
    "totalExpiredPoints": 5.637376656633329,
    "totalNegativePoints": 2.3021358869347655,
    "transactions": [
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      },
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      }
    ],
    "expiredPoints": [
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      },
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      }
    ],
    "currentTier": {
      "expiryDate": {},
      "downgradePolicy": "one_down",
      "name": "bronze",
      "id": 11,
      "startDate": {}
    },
    "pendingPoints": [
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      },
      {
        "eventID": 5,
        "amount": 100,
        "created": {},
        "flags": {
          "createsNegativeBalance": true
        },
        "subLedgerID": "mysubledger",
        "customerSessionID": "t2gy5s-47274",
        "type": "addition",
        "userID": 499,
        "expiryDate": {},
        "archived": false,
        "customerProfileID": "URNGV8294NV",
        "cardID": 241,
        "name": "Add points on purchase",
        "validityDuration": "30D",
        "programID": 5,
        "startDate": {}
      }
    ]
  },
  "subLedgers": {
    "mysubledger": {
      "total": 0,
      "totalActivePoints": 286,
      "totalPendingPoints": 50,
      "totalSpentPoints": 150,
      "totalExpiredPoints": 25,
      "totalNegativePoints": 0
    }
  }
}

Need more? See the Talon.One guide for connection setup and behaviour shared by every action.