Reward Points API Overview

Reward Points API

Info
We have created a public API collection for Reward Points module with all available queries and sample data that you can both test via our demo endpoints and copy to run local tests in your Magento environment. More details about using public collections can be found in the following FAQ post.

1. Amasty\Rewards\Api\CheckoutRewardsManagementInterface - class responsible for applying reward points on checkout:
  1. PUT /V1/carts/mine/points/:points, method="set" - apply points;
  2. DELETE /V1/carts/mine/points/delete, method="remove" - remove applied points.

2. Amasty\Rewards\Api\GuestHighlightManagementInterface - class responsible for highlighting points for guest users:
  1. POST /V1/rewards/mine/highlight/product, method="getHighlight" - show points for registration to guest users.

3. Amasty\Rewards\Api\CatalogHighlightManagementInterface - class for managing highlights in the catalog:
  1. POST /V1/rewards/mine/highlight/product, method="getHighlightForProduct" - display highlights on product pages;
  2. POST /V1/rewards/mine/highlight/category, method="getHighlightForCategory" - display highlights for category pages.

4. Amasty\Rewards\Api\CheckoutHighlightManagementInterface - class for managing highlights on checkout for logged-in users:
  1. GET /V1/rewards/mine/highlight/checkout, method="getHighlightByCustomerId" - calculate and display highlights on checkout for registered customers.

5. Amasty\Rewards\Api\RewardsRepositoryInterface - class for managing reward points:
  1. GET /V1/rewards/mine/balance, method="getBalanceByCustomerId" - show reward points balance on the fontend;
  2. GET /V1/rewards/mine/history, method="getByCustomerId" - show reward points history on the frontend;
  3. POST /V1/rewards/management/history, method="getById" - show reward points history in the backend;
  4. POST /V1/rewards/management/history/:customerId, method="getByCustomerId" - show reward points history for a specific customer in the backend.

6. Amasty\Rewards\Api\ExpirationDateRepositoryInterface - class for managing reward points expiration:
  1. GET /V1/rewards/mine/expiration, method="getItemsByCustomerId" - show points expiration date on the frontend;
  2. POST /V1/rewards/management/expiration, method="getById" - show points expiration date in the backend;
  3. POST /V1/rewards/management/expiration/:customerId, method="getItemsByCustomerId" - show points expiration date for a specific customer in the backend.

7. Amasty\Rewards\Api\RewardsProviderInterface - class for editing reward points balance:
  1. POST /V1/rewards/management/points/rule, method="addPointsByRule" - add reward points to a specific rule;
  2. POST /V1/rewards/management/points/add, method="addPoints" - add reward points;
  3. POST /V1/rewards/management/points/deduct, method="deductPoints" - deduct reward points.

8. Amasty\Rewards\Api\RuleRepositoryInterface - class for managing reward points rules:
  1. POST /V1/rewards/management/rule, method="save" - create a rule;
  2. PUT /V1/rewards/management/rule/:ruleId, method="save" - edit a rule;
  3. DELETE /V1/rewards/management/rule/:ruleId, method="deleteById" - delete a rule;
  4. GET /V1/rewards/management/rule, method="get" - get information about a rule;
  5. POST /V1/rewards/management/rule/all, method="getRulesByAction" - get rules by action.

      • Related Articles

      • Advanced Conditions API (+Reward Points, Extra Fee, Free Gift, Shipping Rules, Shipping Restrictions)

        We have created a public API collection for Advanced Conditions module with all available queries and sample data, you can copy it to run local tests in your Magento environment. More details about using public collections can be found in the ...
      • What Amasty extensions support API?

        Each Amasty extension that has API support, includes the etc/webapi.xml file. The webapi.xml file contains API configurations with the list of available API requests. For example, a request from the Custom Form module interface: 1 - endpoint URL; 2 - ...
      • Can I test how your modules work with API?

        Our team have created a public Postman workspace where we provide access to API collections from our modules. You can copy these API collections to test them in your own Magento installation together with our modules, and some collections can be ...
      • Reward Points | GraphQL methods

        Queries rewards description: get information about customer reward points guestRewards (page: Int!) description: get information about highlight points available for guest getRewardsStatistic description: get report about reward points statistics ...
      • How to award points as percentage of the product price?

        Starting v.2.6.0 of the Reward Points Pro module two new actions are available when creating the reward rules: Get X Points as Percentage of the Order Subtotal - allows customers to earn points based on a percentage of order total after discounts are ...