Earns and accumulates points based on core (earn and burn) rules, promotional rules, etc. set at the club level. It is possible, for instance, to set rules that a member will earn 10 points for every 100spentinapurchasetransaction,and10pointsareequivalentto2. Rules are customizable based on the requirement.
Points are categorized as:
1) Base points: Earned in any purchase transaction based on the core rule.
2) Bonus points: Earned as a bonus for example on a large purchase.
3) Promotional Points: Earned as part of promotional events.
4) Restricted Points: Points to be used only on specified stores.
Earn
endpoint uses the following formula for validating Payload:
1) Amount Paid = Gross Amount - Discounts
2) Net Amount = Gross Amount - Taxes - Discounts
3) At the Transaction Item level: Item Price - (Discount/Quantity) = Net Amount / Quantity
4) Total of all Transaction Items' Gross Amount = Total Gross Amount
curl --request POST \
--url https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"entityReference": "Company LIBERTY CENTER",
"transactionTypeExternalReference": "Supplements",
"activityTimestamp": "2020-02-08 09:30:26",
"transactionExternalReference": "123321abc",
"transactionGrossAmount": 200,
"checkForDuplicateTransaction": 1,
"fetchUpdatedMemberPointTotals": 0,
"totalAmountPaid": 180,
"discountValue": 20,
"totalTax": 20,
"netAmount": 160,
"issueAuditUser": "Joe",
"cancelAuditUser": "John",
"redemptionCode": [
"67460e74-02e3-11e8-b443-00163e990bdb"
],
"reasonCode": "9393",
"reasonDescription": "earning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"value": 20,
"id": 23
}
],
"transactionItems": [
{
"grossAmount": 200,
"totalAmountPaid": 200,
"taxAmount": 20,
"netAmount": 180,
"itemName": "demo item",
"itemPrice": 90,
"itemQuantity": 2,
"SKU": "1123455",
"UOM": "unit",
"lineNumber": 0,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 0
}
],
"couponCodes": [
"H4B-1000"
]
}
],
"setToPending": false
}'
{
"status": 201,
"message": "earned",
"errors": {},
"data": {
"transactionCode": "78660e74-02e3-11e8-b443-00163e911bd2",
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"transactionNumber": "LOYALTY-54321",
"transactionDateTime": "2020-03-20T14:28:23.382748",
"activityTimestamp": "2020-03-20T14:28:23.382748",
"totalAmountPaid": 180,
"totalTax": 20,
"transactionNetAmount": 160,
"points": 16,
"basePoints": 16,
"bonusPoints": 0,
"promotionalPoints": 0,
"currentPointsBalance": 26,
"reasonCode": "9393",
"reasonDescription": "earning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 20
}
],
"discountValue": 20,
"transactionItems": [
{
"grossAmount": 200,
"totalAmountPaid": 200,
"taxAmount": 20,
"netAmount": 180,
"itemName": "demo item",
"itemPrice": 90,
"itemQuantity": 2,
"SKU": "1123455",
"UOM": "unit",
"lineNumber": 0,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 0
}
],
"couponCodes": [
"H4B-1000"
]
}
],
"rewards": [
{
"reward_id": 111,
"core_rule_id": 2,
"reward_portion": 10
}
],
"issueAuditUser": "Joe",
"cancelAuditUser": "John",
"deviceId": "D10626",
"transactionType": "EARN",
"transactionActivityType": "BASE_POINTS_EARNED",
"transactionTypeExternalReference": "PURCHASE",
"transactionExternalReference": "SHOP-7654321",
"transactionEntityReference": "Liberty_center_store"
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Details required to earn points
OK
Metadata for the Earn points
response
Was this page helpful?
curl --request POST \
--url https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"entityReference": "Company LIBERTY CENTER",
"transactionTypeExternalReference": "Supplements",
"activityTimestamp": "2020-02-08 09:30:26",
"transactionExternalReference": "123321abc",
"transactionGrossAmount": 200,
"checkForDuplicateTransaction": 1,
"fetchUpdatedMemberPointTotals": 0,
"totalAmountPaid": 180,
"discountValue": 20,
"totalTax": 20,
"netAmount": 160,
"issueAuditUser": "Joe",
"cancelAuditUser": "John",
"redemptionCode": [
"67460e74-02e3-11e8-b443-00163e990bdb"
],
"reasonCode": "9393",
"reasonDescription": "earning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"value": 20,
"id": 23
}
],
"transactionItems": [
{
"grossAmount": 200,
"totalAmountPaid": 200,
"taxAmount": 20,
"netAmount": 180,
"itemName": "demo item",
"itemPrice": 90,
"itemQuantity": 2,
"SKU": "1123455",
"UOM": "unit",
"lineNumber": 0,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 0
}
],
"couponCodes": [
"H4B-1000"
]
}
],
"setToPending": false
}'
{
"status": 201,
"message": "earned",
"errors": {},
"data": {
"transactionCode": "78660e74-02e3-11e8-b443-00163e911bd2",
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"transactionNumber": "LOYALTY-54321",
"transactionDateTime": "2020-03-20T14:28:23.382748",
"activityTimestamp": "2020-03-20T14:28:23.382748",
"totalAmountPaid": 180,
"totalTax": 20,
"transactionNetAmount": 160,
"points": 16,
"basePoints": 16,
"bonusPoints": 0,
"promotionalPoints": 0,
"currentPointsBalance": 26,
"reasonCode": "9393",
"reasonDescription": "earning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 20
}
],
"discountValue": 20,
"transactionItems": [
{
"grossAmount": 200,
"totalAmountPaid": 200,
"taxAmount": 20,
"netAmount": 180,
"itemName": "demo item",
"itemPrice": 90,
"itemQuantity": 2,
"SKU": "1123455",
"UOM": "unit",
"lineNumber": 0,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 0
}
],
"couponCodes": [
"H4B-1000"
]
}
],
"rewards": [
{
"reward_id": 111,
"core_rule_id": 2,
"reward_portion": 10
}
],
"issueAuditUser": "Joe",
"cancelAuditUser": "John",
"deviceId": "D10626",
"transactionType": "EARN",
"transactionActivityType": "BASE_POINTS_EARNED",
"transactionTypeExternalReference": "PURCHASE",
"transactionExternalReference": "SHOP-7654321",
"transactionEntityReference": "Liberty_center_store"
}
}
Earns and accumulates points based on core (earn and burn) rules, promotional rules, etc. set at the club level. It is possible, for instance, to set rules that a member will earn 10 points for every 100spentinapurchasetransaction,and10pointsareequivalentto2. Rules are customizable based on the requirement.
Points are categorized as:
1) Base points: Earned in any purchase transaction based on the core rule.
2) Bonus points: Earned as a bonus for example on a large purchase.
3) Promotional Points: Earned as part of promotional events.
4) Restricted Points: Points to be used only on specified stores.
Earn
endpoint uses the following formula for validating Payload:
1) Amount Paid = Gross Amount - Discounts
2) Net Amount = Gross Amount - Taxes - Discounts
3) At the Transaction Item level: Item Price - (Discount/Quantity) = Net Amount / Quantity
4) Total of all Transaction Items' Gross Amount = Total Gross Amount
curl --request POST \
--url https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"entityReference": "Company LIBERTY CENTER",
"transactionTypeExternalReference": "Supplements",
"activityTimestamp": "2020-02-08 09:30:26",
"transactionExternalReference": "123321abc",
"transactionGrossAmount": 200,
"checkForDuplicateTransaction": 1,
"fetchUpdatedMemberPointTotals": 0,
"totalAmountPaid": 180,
"discountValue": 20,
"totalTax": 20,
"netAmount": 160,
"issueAuditUser": "Joe",
"cancelAuditUser": "John",
"redemptionCode": [
"67460e74-02e3-11e8-b443-00163e990bdb"
],
"reasonCode": "9393",
"reasonDescription": "earning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"value": 20,
"id": 23
}
],
"transactionItems": [
{
"grossAmount": 200,
"totalAmountPaid": 200,
"taxAmount": 20,
"netAmount": 180,
"itemName": "demo item",
"itemPrice": 90,
"itemQuantity": 2,
"SKU": "1123455",
"UOM": "unit",
"lineNumber": 0,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 0
}
],
"couponCodes": [
"H4B-1000"
]
}
],
"setToPending": false
}'
{
"status": 201,
"message": "earned",
"errors": {},
"data": {
"transactionCode": "78660e74-02e3-11e8-b443-00163e911bd2",
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"transactionNumber": "LOYALTY-54321",
"transactionDateTime": "2020-03-20T14:28:23.382748",
"activityTimestamp": "2020-03-20T14:28:23.382748",
"totalAmountPaid": 180,
"totalTax": 20,
"transactionNetAmount": 160,
"points": 16,
"basePoints": 16,
"bonusPoints": 0,
"promotionalPoints": 0,
"currentPointsBalance": 26,
"reasonCode": "9393",
"reasonDescription": "earning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 20
}
],
"discountValue": 20,
"transactionItems": [
{
"grossAmount": 200,
"totalAmountPaid": 200,
"taxAmount": 20,
"netAmount": 180,
"itemName": "demo item",
"itemPrice": 90,
"itemQuantity": 2,
"SKU": "1123455",
"UOM": "unit",
"lineNumber": 0,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 0
}
],
"couponCodes": [
"H4B-1000"
]
}
],
"rewards": [
{
"reward_id": 111,
"core_rule_id": 2,
"reward_portion": 10
}
],
"issueAuditUser": "Joe",
"cancelAuditUser": "John",
"deviceId": "D10626",
"transactionType": "EARN",
"transactionActivityType": "BASE_POINTS_EARNED",
"transactionTypeExternalReference": "PURCHASE",
"transactionExternalReference": "SHOP-7654321",
"transactionEntityReference": "Liberty_center_store"
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Details required to earn points
OK
Metadata for the Earn points
response
Was this page helpful?
curl --request POST \
--url https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"entityReference": "Company LIBERTY CENTER",
"transactionTypeExternalReference": "Supplements",
"activityTimestamp": "2020-02-08 09:30:26",
"transactionExternalReference": "123321abc",
"transactionGrossAmount": 200,
"checkForDuplicateTransaction": 1,
"fetchUpdatedMemberPointTotals": 0,
"totalAmountPaid": 180,
"discountValue": 20,
"totalTax": 20,
"netAmount": 160,
"issueAuditUser": "Joe",
"cancelAuditUser": "John",
"redemptionCode": [
"67460e74-02e3-11e8-b443-00163e990bdb"
],
"reasonCode": "9393",
"reasonDescription": "earning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"value": 20,
"id": 23
}
],
"transactionItems": [
{
"grossAmount": 200,
"totalAmountPaid": 200,
"taxAmount": 20,
"netAmount": 180,
"itemName": "demo item",
"itemPrice": 90,
"itemQuantity": 2,
"SKU": "1123455",
"UOM": "unit",
"lineNumber": 0,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 0
}
],
"couponCodes": [
"H4B-1000"
]
}
],
"setToPending": false
}'
{
"status": 201,
"message": "earned",
"errors": {},
"data": {
"transactionCode": "78660e74-02e3-11e8-b443-00163e911bd2",
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"transactionNumber": "LOYALTY-54321",
"transactionDateTime": "2020-03-20T14:28:23.382748",
"activityTimestamp": "2020-03-20T14:28:23.382748",
"totalAmountPaid": 180,
"totalTax": 20,
"transactionNetAmount": 160,
"points": 16,
"basePoints": 16,
"bonusPoints": 0,
"promotionalPoints": 0,
"currentPointsBalance": 26,
"reasonCode": "9393",
"reasonDescription": "earning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 20
}
],
"discountValue": 20,
"transactionItems": [
{
"grossAmount": 200,
"totalAmountPaid": 200,
"taxAmount": 20,
"netAmount": 180,
"itemName": "demo item",
"itemPrice": 90,
"itemQuantity": 2,
"SKU": "1123455",
"UOM": "unit",
"lineNumber": 0,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 0
}
],
"couponCodes": [
"H4B-1000"
]
}
],
"rewards": [
{
"reward_id": 111,
"core_rule_id": 2,
"reward_portion": 10
}
],
"issueAuditUser": "Joe",
"cancelAuditUser": "John",
"deviceId": "D10626",
"transactionType": "EARN",
"transactionActivityType": "BASE_POINTS_EARNED",
"transactionTypeExternalReference": "PURCHASE",
"transactionExternalReference": "SHOP-7654321",
"transactionEntityReference": "Liberty_center_store"
}
}