Extra Fee API Features

Extra Fee API

Info
We have created a public API collection for Extra Fee 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\Extrafee\Api\TotalsInformationManagementInterface - class for managing cart totals for logged-in users:
  1. POST /V1/amasty_extrafee/carts/:cartId/totals-information, method="calculate" - calculate totals of a specific cart;
  2. POST /V1/amasty_extrafee/carts/mine/totals-information, method="calculate" - calculate totals of the current cart.

2. Amasty\Extrafee\Api\GuestTotalsInformationManagementInterface - class for managing cart totals for guest users:
  1. POST /V1/amasty_extrafee/guest-carts/:cartId/totals-information, method="calculate" - calculate cart totals of a guest user.

3. Amasty\Extrafee\Api\FeesInformationManagementInterface - class for managing fees for logged-in users:
  1. POST /V1/amasty_extrafee/carts/:cartId/fees-information, method="collect" - display fees for a specific cart;
  2. POST /V1/amasty_extrafee/carts/mine/fees-information, method="collect" - display fees for the current cart.

4. Amasty\Extrafee\Api\GuestFeesInformationManagementInterface - class for getting fees for guest customers:
  1. POST /V1/amasty_extrafee/guest-carts/:cartId/fees-information, method="collect" - display fees available for guest users.

5. Amasty\Extrafee\Api\FeeRepositoryInterface - class for managing fees in backend:
  1. POST /V1/amasty_extrafee/fee, method="save" - create a fee;
  2. PUT /V1/amasty_extrafee/fee/:feeId, method="save" - edit a fee;
  3. DELETE /V1/amasty_extrafee/fee/:feeId, method="deleteById" - delete a fee;
  4. GET /V1/amasty_extrafee/fee, method="getById" - get information about a fee;
  5. GET /V1/amasty_extrafee/fee/all, method="getList" - get a list with all fees.

FAQ

Q: We would like to get the information about the order and its fees via API. How are fees represented in an order, and how can we get them?

A: Details regarding fees per each order should be received via the /rest/all/V1/orders query:



In case you require to get the details via the Extra Fee name, an additional query should be added as follows: GET /rest/all/V1/amasty_extrafee/fee?feeId={FEE-ID}, where {FEE-ID} is an ID from the /rest/all/V1/orders response.

As a result, the detailed info regarding the fee should be received:

      • 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 ...
      • Extra Fee | GraphQL methods

        Queries getListFeeItems description: get a list of created fees getFeeItemsForQuote(cart_id: String!) description: get a list of fees available in the current cart getFeeOptions(fee_id: Int!, store_id: Int!) description: get a list of fee options ...
      • How to handle taxes for extra fees?

        Enabling taxes for extra fees If you'd like to apply tax to your extra charges, you'll need to prepare your settings first. It needs to be done in two separate places. Default Magento settings Step 1. Navigate to Stores → Taxes → Tax Zones and Rates ...