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
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user's permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Loyalty
Manage Restaurants - all permissions
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?