Description
Followed below steps,
-
Create cart for guest user URL: http://devsite.com/magento2.2/rest/all/V1/guest-carts
Content-Type: application/json
Method: POST
Authorization Bearer Key: yfna0bkjnj3j8jcr42rk7a1f3391yy0cRequest Parameters: NIL
Response :
adf748e2e78b4cd4d7d3795a127bed97 (Generates Cart ID in response)
create coupon in backend and also by API
Apply this coupon to cartId
URL: http://devsite.com/magento2.2/rest/all/V1/guest-carts/adf748e2e78b4cd4d7d3795a127bed97/coupons/782OYX2VOEINUF08Content-Type: application/json
Method: PUT
Authorization Bearer Key: yfna0bkjnj3j8jcr42rk7a1f3391yy0cRequest Parameters: NIL
Response :
{
"message": "Coupon code is not valid"
}
For check I have applied this coupon in front-end of website as a guest user its work. In API only its not working