1. Home
  2. Docs
  3. WooRewards
  4. REST API
  5. Add points to a user

Add points to a user

Add the points of a user for a loyalty system

This API route allows you to add points to a user in a point pool used by a loyalty system. It requires the user writing permission.

Note that operation can unlock a reward if the loyalty system is configured to do so and the user sums enough points. In that case, points can be consumed at the same time. The response contains the final point amount.

PUT
/wp-json/woorewards/v1/points/<user_email>/<pool_id>/<points_to_add>

Available parameters

  • user_email (string) : A user email.
  • pool_id (string) : A loyalty system identifier as obtained from a previous API route.
  • points_to_add (int) : The amount of points to add to the user in the point pool. Must be greater or equal to zero.

Response

The JSON response is a status object. That object contains at least the following properties:

  • id : The loyalty system identifier as set in the parameters.
  • points : The identifier of the points pool (since several loyalty system can share the same points pool).
  • value : The new user points amount in this points pool.
  • rewards : The unlocked reward count. Must be zero if no reward was automatically unlocked after point addition.

Error cases

A 404 error is raised if the loyalty system identifier cannot be found.

A 404 error is raised if the user cannot be found by email.

Was this article helpful to you? Yes No

How can we help?