Questions tagged [rest]

Denotes questions related to the REST API on Magento

Filter by
Sorted by
Tagged with
2
votes
1answer
108 views

Magento 2 Oauth Integration Error

I followed Magento Doc and created checklogin.php, endpoint.php, login.php and OauthClient.php. As the doc says in checklogin.php, there is $credentials = new \OAuth\Common\Consumer\Credentials($...
1
vote
0answers
101 views

Magento2 Rest Api for social login

Create a new api for social login, we send access token to Facebook, based on the token read the customer details from Facebook and create a customer account. In response should be a username and ...
0
votes
1answer
784 views

Magento 2 REST API Add product to cart with custom option type file

I'm trying to add a product to cart using the REST API. I'm using a custom option to add an image, but it doesn't seem to work. This is my json object that I'm sending. The option 7819 which is text ...
0
votes
2answers
468 views

Integrating 3rd party Shipping API in Magento

I was working on integrating a 3rd party REST API with our Magento installation. The 3rd party is a shipping company and the API they gave requirements to collect various shipment info (i.e shipper ...
1
vote
0answers
369 views

Magento 2: How to place order using REST api url via ajax

I want to create a order in Magento 2 using REST api url i.e. http://localhost/taleb_check/rest/default/V1/carts/mine/payment-information. When we click place order button then this url get calls ...
0
votes
1answer
616 views

Magento 2.2 - Cannot update attribute values

I've created some custom product attributes with REST API, correctly populated them and assigned values to products. Everything works fine in dev environment whereas I got difficulties in staging ...
0
votes
2answers
747 views

How can I get the HEX code in Visual Swatch via Rest API

Could anyone help me to find the rest api to get hex or image of visual swatch attribute? I need the api to return the following, Label Value HEX or Image of the swatch. Thanks
1
vote
1answer
181 views

Knowing “simple” products are related via REST API

I am doing a search via the REST API, looking for products with a certain color and a certain name: http://127.0.0.1/index.php/rest/V1/products/?searchCriteria[filter_groups][0][filters][0][field]=...
1
vote
0answers
713 views

Create Product with image using REST API

I'm trying to create a product with an image using the REST API in Magento 2 but I get always 400 Error Code saying it's a bad request. Trying it without an image works but if I put the entry "...
0
votes
2answers
191 views

Can i get all customers, along with their address information, using the REST api?

I'm using Magento version 1.9, and i'm trying to get all my customers, via the REST API. That is working fine. But i also need the phone number for each customer, and then have to make a seperate ...
0
votes
1answer
29 views

How to use the rest api without body data

I have rest API URL but how to run the in rest API. $service_url='http://testing.com/data/rest/Masters/CheckPartnerId?Key=121&Type=CREATE&PartnerId=13&BrandId=67&StoreId=...
1
vote
1answer
533 views

Customer Token by Customer Session

I am trying to add items to my cart by using the magento 2 Rest API. Is it possible to get the Customer token by using the customer session? I have looked into this and tried to implement a mix of a ...
1
vote
0answers
95 views

Property “0” does not have corresponding setter in class “Magento\Sales\Api\Data\OrderPaymentInterface”

I am trying to update the sales_order_item table in Magento 2.1.9 using REST API /V1/orders/create PUT, but it gives the error 'Internal Error. Details are available in Magento log file.'. In the log ...
0
votes
1answer
70 views

Pass the values to rest api from magento2 checkout page

Get the values from magento2 checkout page but I need to pass into the rest api. How to pass the values. *$params = array( 'OrderLineId'=>$orderLineId, 'MaterialNo'=>$...
1
vote
0answers
363 views

MAGENTO 2 REST API

I' m trying to create a node.js client for the Magento REST API. I use the community edition running on my own centOS server. The steps I follow to use the api: Create user with Administrator role ...
1
vote
0answers
268 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
36 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
1k 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
321 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
247 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
668 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
312 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
443 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
654 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
679 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
716 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
534 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
341 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
453 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
196 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
0answers
121 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
59 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
141 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
114 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
684 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
406 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
671 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
104 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
757 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
156 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
395 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
171 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
1k 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": { ...