GET
/
api
/
loyalty
/
rule_chains
import SnagSolutions from '@snagsolutions/sdk';

const client = new SnagSolutions({
  apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const response = await client.loyalty.transactions.listRuleChains({
    organizationId: '123e4567-e89b-12d3-a456-426614174001',
    websiteId: '123e4567-e89b-12d3-a456-426614174002',
  });

  console.log(response.data);
}

main();
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174001",
      "name": "My Rule Chain",
      "loyaltyRuleId": "123e4567-e89b-12d3-a456-426614174111",
      "loyaltyConditions": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174001",
          "type": "rule",
          "description": "My Condition",
          "amount": 100,
          "repeatCount": 1,
          "requiredCount": 1,
          "csvUrl": "https://example.com/csv",
          "association": [
            {
              "id": "123e4567-e89b-12d3-a456-426614174001",
              "loyaltyRuleGroupId": "123e4567-e89b-12d3-a456-426614174001",
              "loyaltyRuleId": "123e4567-e89b-12d3-a456-426614174111",
              "loyaltyCurrencyId": "123e4567-e89b-12d3-a456-426614174001",
              "loyaltyBadgeId": "123e4567-e89b-12d3-a456-426614174001",
              "loyaltyRule": {
                "name": "My Loyalty Rule"
              }
            }
          ]
        }
      ]
    }
  ],
  "hasNextPage": true
}

Authorizations

X-API-KEY
string
header
required

Query Parameters

organizationId
string
required

Unique identifier for the organization

Example:

"123e4567-e89b-12d3-a456-426614174001"

websiteId
string
required

Unique identifier for the website

Example:

"123e4567-e89b-12d3-a456-426614174002"

limit
number | null
default:10

Number of rule chains to return

Example:

10

startingAfter
string

Starting after the given rule chain ID

Example:

"123e4567-e89b-12d3-a456-426614174002"

Response

200
application/json
200
data
object[]
required
hasNextPage
boolean
required