import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const response = await client.loyalty.ruleEdits.restore('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(response.id);
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"loyaltyRuleId": "123e4567-e89b-12d3-a456-426614174001",
"websiteId": "123e4567-e89b-12d3-a456-426614174002",
"organizationId": "123e4567-e89b-12d3-a456-426614174003",
"editedByUserId": "123e4567-e89b-12d3-a456-426614174004",
"editedAt": "2021-08-30T20:00:00Z",
"action": "create",
"data": {
"name": "New Rule Name"
},
"previousData": {
"name": "Old Rule Name"
},
"comment": "Updated rule name"
}
Restore a loyalty rule from a rule edit
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const response = await client.loyalty.ruleEdits.restore('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(response.id);
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"loyaltyRuleId": "123e4567-e89b-12d3-a456-426614174001",
"websiteId": "123e4567-e89b-12d3-a456-426614174002",
"organizationId": "123e4567-e89b-12d3-a456-426614174003",
"editedByUserId": "123e4567-e89b-12d3-a456-426614174004",
"editedAt": "2021-08-30T20:00:00Z",
"action": "create",
"data": {
"name": "New Rule Name"
},
"previousData": {
"name": "Old Rule Name"
},
"comment": "Updated rule name"
}
Body
The body is of type object
.
200
The response is of type object
.
Was this page helpful?