earnPoints( )


Adds points to a loyalty account.

Only a positive amount can be added using this method. To adjust an account's balance for a negative amount, use Adjust Points.

This method allows customers to manually earn points to their loyalty accounts. To use this method 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, then, the appId automatically sets to the source app that generates the points. In both cases, the transaction type is "EARN".

Authentication

This method may require higher-level permissions than the caller has, based on their identity and roles and permissions. In these cases, you can ensure the method is called with the required level of authorization by using one of the following:

Permissions
Manage Loyalty
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
accountIdstringRequired

Loyalty account ID.


optionsEarnPointsOptions

Earn points info.

Returns
Return Type:Promise<EarnPointsResponse>
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?