import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const response = await client.loyalty.transactions.listRuleChains({
organizationId: '123e4567-e89b-12d3-a456-426614174001',
websiteId: '123e4567-e89b-12d3-a456-426614174002',
});
console.log(response.data);
{
"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
}
Retrieve configured loyalty rule chains
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const response = await client.loyalty.transactions.listRuleChains({
organizationId: '123e4567-e89b-12d3-a456-426614174001',
websiteId: '123e4567-e89b-12d3-a456-426614174002',
});
console.log(response.data);
{
"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
}
Unique identifier for the organization
"123e4567-e89b-12d3-a456-426614174001"
Unique identifier for the website
"123e4567-e89b-12d3-a456-426614174002"
Number of rule chains to return
10
Starting after the given rule chain ID
"123e4567-e89b-12d3-a456-426614174002"
200
The response is of type object
.
Was this page helpful?