earnPoints( )

Adds points to a loyalty account.

The earnPoints() function returns a Promise that resolves to the updated loyalty account.

Only a positive amount can be added using the earnPoints() function, to manually adjust an account's balance for a negative amount, use adjustPoints().

The earnPoints() function allows customers to manually earn points to their loyalty accounts. To use this function you must include an appId and an idempotencyKey. Any string can be set as the appId or idempotencyKey. In contrast to when an account earns points through an action taken on your site, the appId automatically sets to the source app that generates the points. The transaction type is "EARN" for points earned this way.

Note: Only visitors with Manage Loyalty permissions can earn loyalty points.

Admin Method

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Loyalty
Learn more about permission scopes.
Method Declaration
Method Parameters

Loyalty account ID.


Earn points info.

Return Type:Promise<EarnPointsResponse>
Was this helpful?