I am trying to call Magento 2 Quote rest api,

 <route url="/V1/carts/mine/coupons/:couponCode" method="PUT">
        <service class="Magento\Quote\Api\CouponManagementInterface" method="set"/>
            <resource ref="self" />
            <parameter name="cartId" force="true">%cart_id%</parameter>

but i get issue like "\"%fieldName\" is required. Enter and try again.",

here is the screenshot. enter image description here

Can any one help me to resolve this. Thanks

1 Answer 1


If using PUT /V1/carts/mine/coupons/:couponCode or GET /V1/carts/mine/coupons, we don't need to pass cart_id.

cart_id will be overridden by vendor/magento/module-quote/etc/di.xml

<type name="Magento\Webapi\Controller\Rest\ParamsOverrider">
        <argument name="paramOverriders" xsi:type="array">
            <item name="%cart_id%" xsi:type="object">Magento\Quote\Model\Webapi\ParamOverriderCartId\Proxy</item>

Note: try to change GET to PUT. You're using wrong method?

  • yes, right. but still result is same. i have remove the cart_id from param. but no result. any other suggestion. Feb 6, 2020 at 3:54
  • Did you try to change GET to PUT? Feb 6, 2020 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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