New answers tagged

0

In this link you have all the information: https://devdocs.magento.com/swagger/#/salesOrderRepositoryV1/salesOrderRepositoryV1GetListGet This is an example working on Postman, if you need any help to make it work in php let me know ;) http://yoursite.com/index.php/rest/V1/orders?searchCriteria[filterGroups][0][filters][0][field]=customer_id&...


1

You can try with the below code. You need to pass customer id in API Below are the module details with file. Step-1: Vendor/Module/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_Module', __DIR__ ); Step-2: Create a module file Vendor/Module/etc/...


0

API do returns fixed response. If your worry is about optimisation or readability, you can add a custom API point that queries the same repository and then you can parse the response so that only what you need is sent. Also, you may be interested in GraphQl which by design can return any subset of the possible returned data.


1

Please find a script that is standolone and can be placed anywhere within your magento files, on my environment it is in the folder <magento-root>/app/code/Mbs/OrderRepositoryExtension/shell/getlistordersbycustomerid.php <?php $path = __DIR__ . '/../'; while (!file_exists($path. '/vendor/autoload.php') && $i++ < 15) { ...


0

Ok sorry figured it out already, I think both were trying however use_config_manage_stock was still set to true. Changing post data to include this being set to false did the trick: $post_data = array( "stock_item" => array( "qty" => $qty, "is_in_stock" => $is_in_stock, ...


0

Magento 2 Provide the rest API to get the product attributes value and its option you can try this API catalogProductAttributeRepositoryV1 and you can pass the attribute_id instead of the attribute_code. I hope this is helpful to you!!


-1

It should be app/code/Vendor/Module/etc/webapi_rest/di.xml


0

Thanks but I found the answer it, was Mirasvit extension di.xml file, which was causing the issue. Below is the code which was causing the issue so, I've commented it for now and my website is working fine. <type name="Magento\Authorization\Model\CompositeUserContext"> <arguments> <argument name="...


1

Please use this , I have verified it and it's working. https://yourdomain.com/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=increment_id&searchCriteria[filter_groups][0][filters][0][value]=2506100006387135&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[pageSize]=2&searchCriteria[sortOrders][...


0

The event checkout_cart_save_before is only fire maegnto frontent. You can use sales_quote_product_add_after event which is for all area Frontend,Admin,Rest Api,Rest Soap. $this->_eventManager->dispatch('sales_quote_product_add_after', ['items' => $items]); See the class \Magento\Quote\Model\Quote::addProduct


1

The syntax for Magento rest endpoint is http://<magento_host>/rest/<store_code>/<api_url> Possible values for <store_code> could be one of the following: Actual assigned store code default: The default value get assigned when store_code is not mentioned. all : This specifies that to access all the merchant's stores. Hope it helps, ...


0

You can fix this issue by 2 method:- Disable manage stock here admim>stores>configuration>catalog>inventory>Product stock option>manage stock-->NO or Correct solution: (Using phpmyadmin, run this sql query) 2. You need to change sales Order Prefix or Sufix ID as following:- UPDATE sales_sequence_profile SET suffix= X WHERE meta_id = 5; ...


0

To send that kind of cert we just need to set adatper to CURL and set below options: $adapter = new ZendClient\Adapter\Curl(); $adapter->setCurlOption( CURLOPT_SSLCERTTYPE, 'P12'); $adapter->setCurlOption( CURLOPT_SSL_VERIFYHOST, false); $adapter->setCurlOption( CURLOPT_SSL_VERIFYPEER, false);


0

The database catalog_category_product_index_store0 table does not create that why you getting error. This table is created when indexing for Category Product will run properly . Might be in your system Indexing Category Product is not working. So, you have to do indexing again .


0

If you append the searchCriteria to the url, the API tries to us the api call <route url="/V1/orders/:id" method="GET"> <service class="Magento\Sales\Api\OrderRepositoryInterface" method="get"/> <resources> <resource ref="Magento_Sales::actions_view" /> ...


0

Try to disable magento Catalog Flat for Category from Admin>Store>Catalog>Catalog>Use Flat Catalog Category make it NO.


0

first of all your need to create a module in the app directory of your root directory of Magento installation create a file etc/module.xml Create registration file for the module registation.php etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=&...


0

Please follow link create module and still you face any problem let me know https://meetanshi.com/blog/create-custom-rest-api-in-magento-2/


1

Check this api {{your url}}rest/V1/orders and apply following params to update status { "entity": { "entity_id": orderid, "state":"processing", "status": "processing" } }


1

You can use the rest webservice: http://yoursite.com/index.php/rest/V1/orders On the body you just have to pass: { "entity": { "entity_id": your order id, "state": your state, "status": your status } } Don't forget to also include in the http header the following fields: Content-...


1

Try this params. It is working. { "entity": { "entity_id": 1, "state":"processing", "status": "processing" } } Check mapping in sales_order_status_state. Happy Coding.


0

Add a module with webapi.xml file like below: <?xml version="1.0"?> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/getorderwithnewapi" method="GET"> <...


1

I'd advise to use the original order API initially as per Magento recommendations: that would be http://<magento_root>/index.php/rest/V1/orders/<orderId> and then I imagine you customisation consists in adding custom data to what this call returns? If this is the case, you can then add an extension attributes <?xml version="1.0"?> ...


0

Email ID is missing. Update function as: public function getLogin() { $email = $this->request->getParam('email'); $password = $this->request->getParam('password'); try { /* @var $customer \Magento\Customer\Api\Data\CustomerInterface */ $customer = $this->accountManagementInterface->authenticate($email, $...


0

Following code is wrong: $customer = $this->accountManagementInterface->authenticate($newLoginValue, $password); Should be: $customer = $this->accountManagementInterface->authenticate($email, $password);


0

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"/> <resources> <resource ref="...


0

change in xml code with this <route url="/V1/vendor/module/id/:Id/store_id/:storeId" method="GET"> <service class="Vendor\Module\Api\ModuleRepositoryInterface" method="get"/> <resources> <resource ref="anonymous"/> </resources> </route>


2

Your class should have an instance of \Magento\Store\Model\StoreManagerInterface as a dependency that will give you the current store and id. private $storeManager; public function __construct( ... \Magento\Store\Model\StoreManagerInterface $storeManager, ... ) { ... $this->storeManager = $storeManager; .... } public function ...


0

In case of anyone wondering, I've had the exact same issue in my Magento 2.3.5 multisite setup when calling the /rest/V1/customers REST endpoint. I've solved the issue by specifying the store_id parameter in my customer object: { "customer": { "firstname": "test", "lastname": "test", "email": "test@test.com", "store_id": ...


0

We need to pass the instance of ProductSearchResultsInterface, not the interface. \Magento\Framework\Api\SearchResults is the instance of the interface. Changes plugin: public function afterGetList(\Magento\Catalog\Api\ProductRepositoryInterface $subject, \Magento\Framework\Api\SearchResults $searchResults) { ...... }


0

I think your issue is with ; $seller = [ 'id' => (int) 10, 'name' => 'seller name', 'image' => null ]; I don't think there is any attribute type that will let you assign an array. If you do have to key value pairs, please json encode the values to a json string and assign to the extension attributes like $...


Top 50 recent answers are included