curl --request POST \
--url https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn/reverse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"entityReference": "LIBERTY_STORE",
"reverseTransactionExternalRef": "LOYALTY-12345",
"transactionTypeExternalReference": "RETURN",
"activityTimestamp": "2020-02-08 09:30:26",
"transactionExternalReference": "LOYALTY-8675",
"checkForDuplicateTransaction": 1,
"fetchUpdatedMemberPointTotals": 1,
"transactionGrossAmount": -100,
"discountValue": -20,
"totalAmountPaid": -80,
"totalTax": -10,
"netAmount": -70,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 20
}
],
"issueAuditUser": "Joe",
"cancelAuditUser": "Mia",
"redemptionCode": [],
"setToPending": true,
"reasonCode": "9393",
"reasonDescription": "returning item",
"transactionItems": [
{
"grossAmount": 100,
"taxAmount": 10,
"discounts": [],
"totalAmountPaid": 100,
"netAmount": 90,
"categories": [
"Supplements"
],
"itemName": "demo item",
"itemPrice": 45,
"itemQuantity": 2,
"SKU": "12345",
"lineNumber": 1,
"UOM": "unit",
"couponCodes": []
}
],
"isCompanyUser": false
}'
{
"status": 201,
"message": "earn reversed",
"errors": {},
"data": {
"transactionCode": "62660e74-02e3-11e8-b443-00163e990abc",
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"transactionNumber": "LOYALTY-8675",
"transactionDateTime": "2020-03-20T14:28:23.382748",
"activityTimestamp": "2020-03-20T14:28:23.382748",
"totalAmountPaid": -80,
"totalTax": -10,
"transactionNetAmount": -70,
"points": -70,
"basePoints": 70,
"bonusPoints": 0,
"promotionalPoints": 0,
"currentPointsBalance": 500,
"reasonCode": "9393",
"reasonDescription": "returning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 20
}
],
"discountValue": 20,
"transactionItems": [
{
"grossAmount": 100,
"taxAmount": 10,
"discounts": [],
"netAmount": 90,
"categories": [
"Supplements"
],
"itemName": "demo item",
"itemPrice": 45,
"itemQuantity": 2,
"SKU": "12345",
"lineNumber": 1,
"UOM": "unit",
"couponCodes": []
}
],
"rewards": [],
"issueAuditUser": "Joe",
"cancelAuditUser": "Mia",
"deviceId": "D10626",
"transactionType": "EARN_REVERSE",
"transactionActivityType": "TRANS_CANCEL",
"transactionTypeExternalReference": "RETURN",
"transactionExternalReference": "LOYALTY-8675",
"transactionEntityReference": "LIBERTY_STORE"
}
}
When a member cancels a purchase transaction or returns an order, this endpoint cancels all the points earned in that transaction.
curl --request POST \
--url https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn/reverse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"entityReference": "LIBERTY_STORE",
"reverseTransactionExternalRef": "LOYALTY-12345",
"transactionTypeExternalReference": "RETURN",
"activityTimestamp": "2020-02-08 09:30:26",
"transactionExternalReference": "LOYALTY-8675",
"checkForDuplicateTransaction": 1,
"fetchUpdatedMemberPointTotals": 1,
"transactionGrossAmount": -100,
"discountValue": -20,
"totalAmountPaid": -80,
"totalTax": -10,
"netAmount": -70,
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 20
}
],
"issueAuditUser": "Joe",
"cancelAuditUser": "Mia",
"redemptionCode": [],
"setToPending": true,
"reasonCode": "9393",
"reasonDescription": "returning item",
"transactionItems": [
{
"grossAmount": 100,
"taxAmount": 10,
"discounts": [],
"totalAmountPaid": 100,
"netAmount": 90,
"categories": [
"Supplements"
],
"itemName": "demo item",
"itemPrice": 45,
"itemQuantity": 2,
"SKU": "12345",
"lineNumber": 1,
"UOM": "unit",
"couponCodes": []
}
],
"isCompanyUser": false
}'
{
"status": 201,
"message": "earn reversed",
"errors": {},
"data": {
"transactionCode": "62660e74-02e3-11e8-b443-00163e990abc",
"profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
"transactionNumber": "LOYALTY-8675",
"transactionDateTime": "2020-03-20T14:28:23.382748",
"activityTimestamp": "2020-03-20T14:28:23.382748",
"totalAmountPaid": -80,
"totalTax": -10,
"transactionNetAmount": -70,
"points": -70,
"basePoints": 70,
"bonusPoints": 0,
"promotionalPoints": 0,
"currentPointsBalance": 500,
"reasonCode": "9393",
"reasonDescription": "returning item",
"discounts": [
{
"type": "promotion",
"description": "Black Friday discount",
"id": 2345,
"value": 20
}
],
"discountValue": 20,
"transactionItems": [
{
"grossAmount": 100,
"taxAmount": 10,
"discounts": [],
"netAmount": 90,
"categories": [
"Supplements"
],
"itemName": "demo item",
"itemPrice": 45,
"itemQuantity": 2,
"SKU": "12345",
"lineNumber": 1,
"UOM": "unit",
"couponCodes": []
}
],
"rewards": [],
"issueAuditUser": "Joe",
"cancelAuditUser": "Mia",
"deviceId": "D10626",
"transactionType": "EARN_REVERSE",
"transactionActivityType": "TRANS_CANCEL",
"transactionTypeExternalReference": "RETURN",
"transactionExternalReference": "LOYALTY-8675",
"transactionEntityReference": "LIBERTY_STORE"
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Transaction details to reverse the earned points
OK
Metadata for the Earn Reverse
response
Was this page helpful?