Observer is not working with Magento 2 Rest API

Hi Team,

I’ve created an Android app using Magento 2 Rest API. Everything was looking good but when are assigning a seller to a cart item it is not working because Rest API does not dispatch any event/observer.

We are using a marketplace plugin for seller information. From the web, it is working and dispatching  checkout_cart_product_add_after event but for Rest API it is not.

I have also tried by putting events.xml from frontend to global scope but still no luck.

I have faced same issue. It is not working.

https://magento.stackexchange.com/questions/302614/magento-2-rest-api-checkout-cart-product-add-after-event-is-not-working

@bhupendagwb18 wrote:

Hi Team,

I’ve created an Android app using Magento 2 Rest API. Everything was looking good but when are assigning a seller to a cart item it is not working because Rest API does not dispatch any event/observer.

 

We are using a marketplace plugin for seller information. From the web, it is working and dispatching  checkout_cart_product_add_after event but for Rest API it is not.

I have also tried by putting events.xml from frontend to global scope but still no luck.

 

This is the list of events you can hear add product using rest api

sales_quote_item_set_product
sales_quote_item_qty_set_after
sales_quote_product_add_after
sales_quote_item_save_before
sales_quote_item_save_after

This just on add product, not update qty
sales_quote_add_item