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:
- POST /V1/amasty_extrafee/carts/:cartId/totals-information, method="calculate" - calculate totals of a specific cart;
- 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:
- 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:
- POST /V1/amasty_extrafee/carts/:cartId/fees-information, method="collect" - display fees for a specific cart;
- 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:
- 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:
- POST /V1/amasty_extrafee/fee, method="save" - create a fee;
- PUT /V1/amasty_extrafee/fee/:feeId, method="save" - edit a fee;
- DELETE /V1/amasty_extrafee/fee/:feeId, method="deleteById" - delete a fee;
- GET /V1/amasty_extrafee/fee, method="getById" - get information about a fee;
- 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: