How endpoints <host>/rest/<store_code>/V1/carts/mine/estimate-shipping-method to get data from a database or mention function or class that helps this API to get data from the database?

Because I am so confused about how this API to get data from the database.


For the specific endpoint you have named you can find this under vendor/magento/module-quote/etc/webapi.xml.

    <route url="/V1/carts/mine/estimate-shipping-methods" method="POST">
        <service class="Magento\Quote\Api\ShipmentEstimationInterface" method="estimateByExtendedAddress"/>
            <resource ref="self" />
            <parameter name="cartId" force="true">%cart_id%</parameter>

Here you see:

  1. The route url which will be matched,
  2. The class that will be called, in this case the interface Magento\Quote\Api\ShipmentEstimationInterface,
  3. The method that will be called, estimateByExtendedAddress

Assuming you do not have any custom modules with a preference for Magento\Quote\Api\ShipmentEstimationInterface this will be using \Magento\Quote\Model\ShippingMethodManagement::estimateByExtendedAddress

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.