Add/Subtract Points
Add/Subtract Points
Knowledge Base
-
WooRewards
0
- MyRewards (Free Version) 5
- Getting Started 2
- Tutorials 4
- Features 12
-
Actions
23
- Spend Money
- Place an order
- Place a first order
- Buy Specific Products
- Buy in categories
- Product Review
- User registration
- Birthday
- Visit a post, page or url
- Send a referral email
- Referee registration
- Referee spends money
- Referee Orders
- Referee buys products
- Referee buys in categories
- Share on social networks
- Visitor clicks a social share
- Receive Badges
- Registration Anniversary
- Post a comment
- Click an image
- Publish a post
- Recurrent Visit
- Rewards 11
- WooCommerce Display 4
- Emails 7
- Shortcodes 7
- API 8
- Developer Resources 2
-
Add-Ons
12
- The Newsletter Plugin Subscription
- MC4WP Mailchimp subscription
- Points and Rewards System Limitation
- Referrals Information
- Points History Excel Export
- Points for Coupon
- Settings Migration
- Subscription Coupon Reward
- Partial Refund Reward
- The Scheduler
- Delayed and Recurring Points
- Points Synchronization
- Play Together 2
- Translations and WPML 2
- Changelog 1
- Knowledge Base
- WooRewards
- API
- Add/Subtract Points
This documentation is for the WooRewards plugin
Use this API route to add/subtract points to a user in a points reserve used by a points and rewards system. It requires only the user writing permission.
That operation can unlock a reward if the points and rewards 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_or_subtract>/<reason>
Available parameters
- user_email : (string) – A user email.
- pool_id : (string) – A points and rewards system identifier as obtained from a previous API route.
- points_to_add_or_subtract : (int) – The amount of points to add to the user in the points reserve. Set a minus sign before the value to remove points.
- reason : (string) – The description of why the points are added/subtracted
Response
The JSON response is a status object. That object contains at least the following properties:
- id : The points and rewards system identifier as set in the parameters.
- points : The identifier of the points reserve (since several points and rewards systems can share the same points pool).
- value : The new user points amount in this points reserve.
- rewards : The unlocked reward count. Will be 0 if no reward was unlocked after point addition.
Error cases
A 404 error is raised if the points and rewards system identifier cannot be found.
A 404 error is raised if the user cannot be found by email.
Continue reading
Previous: Badges
Next: Unlock a reward
In this article