POST
/
v2
/
earn

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Details required to earn points

entityReference
string
required

Name or ID for the store (or entity) where the transaction took place.

Required string length: 1 - 100
transactionTypeExternalReference
string
required

External reference for the transaction type such as purchase, return, or exchange (Configurable as per requirement).

Required string length: 1 - 100
activityTimestamp
string
required

Activity date (in UTC format). An activity could be enrolling a member, making a transaction, etc.

transactionExternalReference
string
required

Order ID or receipt ID for a transaction (received from the store). It is needed to cancel or return an order.

Required string length: 1 - 100
transactionGrossAmount
number
required

Gross transaction amount (in currency unit) of the total items earn. For example the gross amount of item1 is 50.00 and gross amount of item2 is 100.00. The transactionGrossAmount is 150.00.

Required range: x > 0
checkForDuplicateTransaction
integer
required

0 indicates the system allows duplicates and 1 indicates there is a validation in place to identity duplicate.

fetchUpdatedMemberPointTotals
integer
required

1 indicates the total points are calculated and shown to the member. 0 indicates the total points are not calculated and the member is only notified the earn is successful. Note: The response is faster when the value is 0 because the total points are not calculated on the fly.

totalAmountPaid
number
required

Total amount paid for the items. For example, the amount paid for item1 is 100.00 and the amount of item2 is 200.00 so the total amount paid is 300.00.

discountValue
integer
required

Discount value on the transaction, if applicable

totalTax
number
required

Total tax based on the number of items in the transaction. For example, the tax amount of item1 is 2.00 and tax amount of item2 is 1.00. The totalTax is 3.00.

netAmount
number
required

Net transaction amount based on the total items in the transaction, after subtracting taxes and discounts.

Required range: x > 0
profileId
string

Profile ID of the member. In an ecosystem, it acts as a primary ID to keep the various systems (apps, websites, etc.) in sync.

issueAuditUser
string | null

Representative who issued the earn transaction

Required string length: 1 - 200
cancelAuditUser
string | null

Representative who cancelled the earn transaction

Required string length: 1 - 200
redemptionCode
string[] | null

Redemption code to identify and link the rewards used in a specific transaction. This is generated in the response of the Issue Variable Rewards endpoint - POST /api/v1/redeem/reward/issue.

reasonCode
string

Reason code to categorize transactions. A parent company can configure custom codes for their stores as required.

Required string length: 1 - 30
reasonDescription
string

When reason codes are not configured, store can make use of the reason description to add notes on the transaction.

Required string length: 1 - 300
discounts
object[]

Represents the discounts on the item.

transactionItems
object[]

Details of the items in the transaction.

setToPending
boolean
default: false

true: Points in Pending status <br /> false: Points in Active status. <br />Note:The time period for Pending state is configurable.

Response

200 - application/json

Metadata for the Earn points response

status
integer

Status code of call

message
string
default: Exception message

Message corresponding to status code.

Minimum length: 1
errors
object

In a successful response, this is always a blank object.

data
object

Earn details