Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

1

Magento has a single Rest API which provides some system.xml field value <route url="/V1/store/storeConfigs" method="GET"> This only provides below system config fields value: [ { "id": 1, "code": "default", "website_id": 1, "locale": "en_US", "base_currency_code": "USD", "...


1

I may be wrong but I don't think you can declare a specific parameter as optional from within the xml file, though you can declare your routes in such a way that the parameter becomes optional. For example if you changed your xml to: <route url="/V1/product/:productId" method="GET"> <service class="Vendor\Sample\Api\SampleInterface" method="...


0

It seems that you are not testing if the $item_id matches with the $item->getId() : so, you are deleting all the items. Try to replace if ($item && $item->getId()) { with if ($item && $item->getId() && $item_id == $item->getId()) { .


0

public function setQuestionStatus($question, $status) { //this allows you to pass an id or a question object to the method //if the id is not found in the db, a NoSuchEntity exception will be twrown. if (is_int($question)) { $question = $this->questionRepository->getById($question); } $question->setIsActive($status); // ...


1

Try following way to enable/disable. Guess, question enable/disable column name is status. <?php namespace Vendor\Module\Model; use Vendor\Module\Api\QuestionManagementInterface; use Vendor\Module\Api\QuestionRepositoryInterface; class QuestionManagement implements QuestionManagementInterface { protected $questionRepository; public function ...


0

As magento official documentation they are separately giving prices API which is as below : Manage Special Prices https://devdocs.magento.com/guides/v2.3/rest/modules/catalog-pricing.html#manage-special-prices Manage Tier Prices https://devdocs.magento.com/guides/v2.3/rest/modules/catalog-pricing.html#manage-tier-prices Manage Base Prices https://devdocs....


1

I'm guessing this is because the API is considered frontend. That's not correct, but close. The frontend uses the API a lot in the checkout and that's the case here. Unfortunately you can't use the area-code to solve this problem. Your best bet is excluding the payment method from being rendered in the template.


0

I'm using Magento 2.2, PUT and POST both do not work for adding a new address to an existing account. I get the following error: "A customer with the same email already exists in an associated website" Is adding an address to an existing Magento customer only supported in version 2.3 and later?


0

In URL you have passed wrong searchCritseria spelling, Replace it with searchCriteria http://domain.com/index.php/rest/V1/search?searchCriteria[requestName]=quick_search_container&searchCriteria[filterGroups][0][filters][0][field]=search_term&searchCriteria[filterGroups][0][filters][0][value]=%25life%25&searchCritseria[sortOrders][1][field]=...


0

Using the Firebase console. This is useful if you're creating promo links to share on social media. This way you can select a custom suffix and a name for the link in the Firebase console. You can track the performance of these Dynamic Links in the Firebase console or via the Analytics REST API. API Method : POST https://firebasedynamiclinks.googleapis.com/...


0

The ENS error response is normal if you are directly accessing the address, as there isn't an XML or JSON call attaxhed to it. You may want to ensure that the ENS response URL is publically accessable, and ensure that the URL is listening on port 80 and/or port 443. (Check your firewall setting for that). That is the best I can offer.


1

Magento is trying to load the product by SKU but you didn't send it in your Json. Even though you are passing the SKU on your URL, SKU is still a required field. , try with: { "product": { "price": 1, "sku": 12345, "extension_attributes": { "stock_item": {"qty": 2} } } } Here in swagger is showing that SKU is required. Follow swagger for your ...


0

Maybe here you can find the answer https://docs.magento.com/m1/ce/user_guide/configuration/shipping-settings-basic.html


0

The token is NOT encoded user-information. There is no way to extract information from it on the client side. The token is a key in a DB table (oauth_token) where you can look up the customer_id tied to the token. Or you make a second request (/customer/me) with that token to get all user info.


0

Following code is working in magento2.3 to get token: $userData = array("username" => "<username>", "password" => "<password>"); $ch = curl_init("http://<website>/rest/V1/integration/admin/token"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData)); curl_setopt($ch, ...


0

I think you can actually use a simple json_encode with print_r. Like below: print_r(json_encode(['items' => $orderInfo]));


1

Update Gateway Url of UPS from http to https From “http://www.ups.com/using/services/rave/qcostcgi.cgi” to “https://www.ups.com/using/services/rave/qcostcgi.cgi”. Refer this link What is the current UPS shipping gateway? (outage 2019-01-06)


Top 50 recent answers are included