
Custom Magento API endpoint and Plugin
- or -
Post a project like this739
£330(approx. $444)
- Posted:
- Proposals: 5
- Remote
- #3987748
- OPPORTUNITY
- Awarded
Description
Experience Level: Expert
Estimated project duration: less than 1 week
Background
Within our solution architecture, we only use magento APIs only (headless approach) - we do not use magento frontend
We need a plugin making to deliver a new API which will validate stock information for active carts / quotes when called
We will call this API at different points in our own checkout
Details
When we send a request with the cartID the plugin should loop the cart line items and check the requested quantity vs the saleable quantity
If the requested qty for the line item is > saleable quantity, it should reduce the qty of the line item to the saleable quantity amount or 1
If the item is not saleable and is now out of stock, the line item should be deleted from the cart
If an item is disabled or no longer exists it should also be deleted from the cart
The API response should be either true or false
True meaning all of the stock was available and the cart was not altered
False meaning the cart was altered due to one of the above steps
Delivery
The API endpoint can be either GET or POST and we will send the cartID as a parameter
The API endpoint should be such as /custom_api/checkvalidcart
For now this will be for guest checkouts but once the work is completed we will need to do the same for logged in checkouts and for this we would also send the authentication token however this would be scoped after.
This plugin will be used across multiple magento instances and should be delivered as a folder we can drop into the app/code area
You must use your own local magento to create this and then share the code with us for testing. We cannot provide access to our magento.
You must consider multi-source inventory as we utilise this in magento backend
The stock quantity checked should be the stock ID assigned to the storeCode that the cart is open within (see printscreen - this is an example of how we get the totals using the standard Magento APIs). The storeCode can be sent to this new custom API for you to assign the correct stock source.
Magento compatibility: 2.4 and above
Information: https://developer.adobe.com/commerce/php/tutorials/backend/create-custom-rest-api/
Please confirm your approach and cost. This is an urgent task so please confirm when it can be done by.

Tom B.
100% (12)Projects Completed
5
Freelancers worked with
5
Projects awarded
23%
Last project
21 Dec 2023
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies