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

Questions tagged [rest]

Denotes questions related to the REST API on Magento

1
vote
0answers
251 views

Search all products with attributes color & size REST API : Magento 2

How can I filter and get all products which has specific color or size REST API ?
1
vote
0answers
34 views

Unable to get salesorders and Customers From Magento 2.2 using REST API

We have Magento Store having Version 2.2.0 Store URL:- https://www.sehrawatbrother.com Token get through REST API:- 7mrn16lrsi51exjp563c13fdi10c0b1e We also have created API Username and Password and ...
1
vote
1answer
888 views

Check products in cart if they are out of stock before place order REST API : Magento 2

I am building mobile application using Magento 2, I had an old defined cart which had a product and when checking out it gives an error saying the item is out of stock, that happened after payment and ...
0
votes
1answer
295 views

REST API vs JSON

I've found lots of questions and answers on REST API vs SOAP API. Some of them like this one mention JSON. Could you explain what is the difference between REST API vs JSON. (aka create custom ...
2
votes
0answers
238 views

Magento 2 rest api: Ignore out of stock products in get products search criteria

I am using the following api call to get products. {{base_url}}/rest/V1/products?searchCriteria[filter_groups][0][filters][0][condition_type]=like&searchCriteria[filter_groups][0][filters][0][...
2
votes
1answer
592 views

Magento 2 - Really need help “Server can´t understand Content-Type HTTP header…”

I´m a newbie with Magento 2 and the REST API so I need a little help with this code because I tried many things and the result is always the same. $adminUrl='http://mylink.com/index.php/rest/V1/...
1
vote
1answer
281 views

Does the REST API still accept XML?

quick broad question. Does the REST API in Magento 2 still accept XML input? According to the introduction, it does. But further on in the documentation, there is no mention. I have been able to ...
1
vote
1answer
356 views

Configurable Product is returning Price Zero magento 2.x rest Api

Why Price is zero in response. I am hitting Url: https://example.com/index.php/rest/V1/products/sku Response: { "id": 176, "sku": "8544501", "name": "BATA-8544501", "...
1
vote
1answer
610 views

Estimate shipping methods by address id Error REST API : Magento 2

I am trying to call this magento 2 built in API : POST http://domain.com/rest/V1/carts/mine/estimate-shipping-methods-by-address-id In Body : {"addressId": 194} But I got this error: { "...
2
votes
0answers
637 views

magento 2 override Magento\Sales\Model\Order.php get method for REST api

magento 2 override Magento\Sales\Model\Order.php get method for REST api to add some details. i am getting an error in di compile Fatal Error: 'Uncaught TypeError: Argument 1 passed to Custom\\Sales\...
0
votes
0answers
673 views

Uncaught TypeError: Argument 1 passed to Magento\Framework\App\Config\ScopePool::__construct()

After installing elasticsearch module, I am getting an error while accessing search api. Same module is working fine in a fresh magento. But it produces error in my existing project. I tried by ...
2
votes
0answers
507 views

Get available filters of category by category ID

I have been trying to write rest api to retrieve available filters of particular category by its ID. I have a category which has two filters price and brands. Both price and brands are visible in ...
1
vote
1answer
319 views

Create order with REST API, without cart

I'm using REST API with token authentication to export data from a M1 to a fresh installation of M2.2.0 installation. Everything works fine with customers and products, but I cannot manage to ...
1
vote
0answers
32 views

Associating two related models

So I'm creating a plugin wherein a customer can have grocery lists. I have two created models - GroceryList and GroceryListItem. A grocery list contains one or many grocery list items. I can fetch ...
1
vote
1answer
418 views

Adding custom column data to extension attribute in magento's default V1/orders API

I have a custom delivery_date column in quote table which I want to pass to V1/orders , I have passed this in extension_attribute.xml as following ; <?xml version="1.0"?> <config xmlns:xsi="...
2
votes
2answers
2k views

how to get product list of specified category using rest API?

I want to access specified product list. for example access all the products in Jacket's category.
0
votes
1answer
179 views

How to get Product via API right after product created?

Case : When product is created, I need to send SKU to 3rd party, and then they immediately call magento REST API to get product by SKU. So far I'm using catalog_product_save_after event. And for ...
1
vote
1answer
108 views

Multiple Products in one Cart magento 2.1 REST Api

i am sending POST request and its not working, i am hitting url "www.sample.com/index.php/rest/V1/guest-carts/c62700b7e525b82c0e96607e11ec0942/items" { "cartItem": [ { "quote_id": "...
2
votes
0answers
57 views

Placing Multiple Orders in Magento 2.1 using REST API

How to post multiple cart items through one request on server using magento2.1 REST API?
1
vote
1answer
1k views

Magento 2 REST API -> PUT example (PHP)

I'm new to the Magento 2 REST API (this is also my first post in this forum, hi all), but during the past day have been able to retrieve information using it to my backend system. GET -requests are ...
1
vote
0answers
133 views

Magento 2 API want to implement product details based on custom format?

Magento 2 how to implement configurable product collection formate as shown blow can you please suggest me. Required format:- { "id": 10, "name": "Hello", "sku": "hello" "...
1
vote
0answers
109 views

Magento 2.2 Rest API not working for Sales Orders and Customers

We are trying to get Customers and Sales Orders from Magento 2.2 Store using token.After creating API Username and Roles, with the same request we can retrieve products but not sales orders and ...
2
votes
1answer
1k views

How to use Magento 1.9.2.3 REST or SOAP API to get list of products - working example required

I'm a new to Magento API. Tried this: https://stackoverflow.com/questions/40734545/how-to-get-product-info-using-rest-api-in-magento but all I'm getting is a blank page. Can anyone help or advice what ...
2
votes
1answer
635 views

Getting Products by category id! Magento 2.1 REST

How can I get products of specific category? For Example If I hit https://www.example.com/index.php/rest/V1/categories/[category_id]/products it should return all products of same Category [...
2
votes
2answers
1k views

How to list groups of an attribute set using REST API in Magento 2

I am trying to use the Magento 2 rest API to list the groups of an attribute set: GET /V1/products/attribute-sets/groups/list But the request fails with the following error: { "message": "%...
1
vote
1answer
386 views

Place Order Magento 2.1 REST API as a guest for Android app

I want to place order on Magento 2.1 using REST API, Please provide me all steps from creating cart to Place order, Actually i need parameters to pass for guest, How i'll set Customer_id etc for guest?...
2
votes
1answer
629 views

Magento 2 How to get rest API response as an object?

I am getting rest API response as like below, [{ "field1" : "val1", "field1" : "val2", .... }] How do I get API response as object, without braces []. It will return only one object every time, so ...
4
votes
1answer
2k views

REST API and setting the quotes Billing & Shipping addresses

In Magento 2.2 there is an API endpoint of: /V1/carts/mine/billing-address And this accepts JSON in a POST request like this: { "address": { "region": "somewhere", "country_id": "GB", ...
4
votes
0answers
100 views

magento 2 REST API for cutom collection based on store code [closed]

magento 2 REST API for custom collection based on store code how to pass store id rest/store_code/V1/banners rest/ar/V1/banners different store having different banners so how to get the banners ...
1
vote
1answer
712 views

Error on image upload with REST api

Referring to MIME type not valid when uploading image using REST API I am trying to upload image for a product through REST api. Request Code: API: http://192.168.0.133/index.php/rest/V1/products/...
2
votes
0answers
155 views

how to add cutom price via rest api - Magento 2

I'm following this answer to create guest order. I'm trying to add product to cart with my custom price, but the order will take the actual product price. POST /V1/guest-carts/{cartId}/items Rest ...
1
vote
1answer
2k views

Connecting to Magento Rest API by python

I'm new to Magento API and actually a python programmer, there are some APIs I should connect to them through Rest and I stick to the first step of authentication with OAuth for getting access tokens ...
1
vote
1answer
367 views

How to get products list with details by category_id from rest api of magento 2.0?

https://www.example.com/index.php/rest/V1/categories/[category_id]/products it is only returning me a list of SKU. I need all products with details by categry_id
1
vote
1answer
164 views

How to structured data in custom WebAPI?

I have created custom webapi using https://www.demacmedia.com/extending-magento-2-rest-web-api/ This is the code that I am using: <?php namespace Panda\WebService\Model\Resource; use Panda\...
4
votes
1answer
969 views

Add multiple products to cart using Magento2 REST API using custom method

Add multiple products to cart using Magento2 REST API using custom method Their is no default magento api this is single product add to cart json code in rest api body section. { "cartItem": { ...
9
votes
0answers
926 views

merge guest quote with customer quote(if custommer log in) magento 2 rest api

if 2 items in cart if customer login both item should need to add cart , Both quote (before login & after login) merge and create final quote which contain all item of customer quote Refference ...
0
votes
1answer
1k views

How to use access Magento 2 API from C# with REST and Token-based authentication

I create an Integration -> Activate -> Obtained the Access Token Like is described here: http://devdocs.magento.com/guides/v2.2/get-started/authentication/gs-authentication-token.html And in my test ...
0
votes
0answers
292 views

Magento 2 and REST API with Nginx config not working

We're using a 3rd party software to get data from our Magento 2.1.9 store. If I click on "get Listings" in this software, it's supposed to download our products from Magento 2. In our Nginx server ...
1
vote
2answers
903 views

Magento 2 REST API Get TaxRate by Tax Class ID

i'm using RestSharp in C# to connect with Magento2 REST API. Everythings fine, except one simple thing: lets say i've got a product, in its JSON-DATA there is a tax_class_id "4". Inside of this ...
0
votes
0answers
289 views

Magento : How to show data of external api using custom module

I want to create a custom module in which, I want to fetch some external data using API and show them at home page or any location. I have API's ready , now i want to fetch data in my custom module ...
1
vote
0answers
148 views

custom REST Api - access denied - programmatically solution

I'm trying to create an extension with a custom REST Api and I created the api2.xml and the model that will retrive my data. The only problem is that in order to access my endpoint I need to go to the ...
0
votes
1answer
484 views

Magento 2 rest API returns false when trying to get a token

I am trying to create a web app that gets data from a Magento 2 website thanks to the API, following this tutorial but it returns bool(false) when I do var_dump($token) I have read other threads on ...
1
vote
0answers
180 views

Override default model webapi output magento2

I've began creating a module for a rest api for creditmemos - which I intend on using as an alternative to the built in version. At the moment I've started the normal way for creating a webapi module,...
1
vote
0answers
22 views

Autentication in Rest

I have a local installation of Magento 2 where everything is configured and all the API works fine I'm doing an app for a client also with Magento 2 Done the same confugurations And the site always ...
2
votes
1answer
473 views

Get Configurable Products Under Specific Category REST API Magento 2

I am trying to get configurable products only under specific category using http://domain.com/index.php/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=type_id&...
1
vote
0answers
442 views

Magento 2 rest API not working in online server

I'm trying to integrate Magento REST API web service, but it answers me always: {"message":"Consumer is not authorized to access %resources","parameters":{"resources":"Magento_Backend::store"}} I'...
1
vote
0answers
861 views

PHP Notice: Undefined index: state

I am trying to use rest api on magento 1.9 from here. My code is as follows. <?php /** * Example of simple product POST using Admin account via Magento REST API. OAuth authorization is used */...
0
votes
1answer
227 views

Magento 2 : Get image file from custom_option folder

I have a custom option of type file where I am allowing user to upload photo while adding a product to cart. I am using the REST api to get the cart items. Below is the response for the same. [ {...
1
vote
2answers
537 views

How to send email from custom API

I created a custom API that collects information from a form. How can I send that information to the admin's email ? The API is working fine, but I don't know how to combine it with the email ...
3
votes
0answers
416 views

Magento 2.1 Rest API - Adding to Extension Attributes for VI/Orders/?searchcriteria

I have some custom data that I gather on checkout. Using etc/extension_attributes.xml, I was able to add this data to the extension_attributes output on VI/Order/#id, but when I use VI/Order?...