Authentication v1
- Identity APIs
- User
- Address
- Auth
User Self Service APIs
- Introduction
- User Self Service APIs
- Authentication APIs
Experiences v2 (XM v2)
- XM
- Pages
- Global Components
- Menu
Experiences v1 (XM v1)
- XM
- Pages
- Global Components
- Menu
Product Catalog
- Product Catalog
- Category
- Product
- Attributes
- Bulk Import
Orders v2 (OMS v2)
- Order Management System
- Order
- Order Attribute
- Developer Guide
- Order Return
- Payment Status
- Package Tracking
- Cross Border
- Order Cancellation
- Appeasement
- Allocation
- Configuration
- Fraud Configuration
- Target Configuration
- Location
- Location Attribute
- Inventory Network
- Inventory
- Inventory Counter
- Inventory Bulk Operation
- Inventory Attribute
- Inventory Upload Log
- Shipment
- Shipping Method
- Webhook
- Notification
- Export
- Invoice
- Fraud
- Backorder Preorder Reservation
- List
Orders v1 (OMS v1)
- Order Management System
- Cart
- Bill To
- Ship To
- Wishlist
- Cart Decoupled
- Warehouse
- Inventory
- Attributes
- List
- Tax/Address Validate
- Shipping
- Payments
- Order
Offers v2
- Offers
- Developer Guide
- Promotion
- Price Kind
- Dynamic Pricing Engine
- Segment
- Coupon
- Coupon Codes
- Product
- Price List
- Attributes
- Item
- Price Guard
- Global Exclusion
- Upload Price CSV
- Pricing
- Redemption
- Exports
Offers v1
- Offers
- Login API
- Promotions
- Pricing
Subscriptions (SMT API)
- Subscriptions API
- Cancellation Reasons
- Subscription Discounts
- Subscriptions
- Subscribers
- Orders
Loyalty (Member)
- Member APIs
- Inquire
- Discounts
- Redeem
- Earn
- Members
Dropship
- Dropship API
- Shipments
- Products
- Invoices
- Connections
- Inventory
- Developer Guide
- Returns
- Orders
Cart API
- Cart
- Order Draft
- Attribute
- Adjustments
- Shipping
- Cart
Checkout API
- Checkout
- Checkout
Customer
- Core Concepts
- Customer Service
- Organization
- User Party
- Organization Group Addresses
- User Internal Party
- Organization Contracts
- Party
- Party Contracts
- Contracts
- User
- Search
- User Trait
- Organization Users
- Address
- User Address
- Trait
- Party Address
- Party Trait
- Organization Group Users
- Internal Party
- Contract Pricelist
- Internal Parties Party
- Account
- Party Account
- Organization Addresses
- Organization Groups
- Individual Addresses
- Users Organization
- Individual
Earn Points
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"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Details required to earn points
Response
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"
}
}