Questions tagged [rest]

Denotes questions related to the REST API on Magento

1
vote
1answer
440 views

%fieldname is a required field for entry in post media gallery

I'm pretty new to Magento and I was trying to add a media to a existing product. From code I am able to do that as the following: $entry = ['entry' => [ 'media_type' => ---, ...
6
votes
3answers
1k views

How to get CustomerId in API in magento 2? and how magento gets customerId for the same?

Magento didn't load the customer session in API as used in web session based authentications. and i am aware about the API <magento.host>/rest/V1/customers/me My question is, how do I make ...
2
votes
3answers
1k views

How to expose a custom field from sales_order table to rest api?

I have a custom field delivery_type in sales_order table. I am accessing order using rest api but this field is not present in response. Requested api: http://localhost/default/rest/default/V1/orders/...
1
vote
1answer
1k views

Error Consumer is not authorized to access %resources

It seems that similar questions have been asked but none seem to solve my specific problems. We have developed a routine to automatically update and create product information using the REST API. This ...
1
vote
1answer
112 views

Magento 2, how to get list of product by item_id?

Using Magento 2.2, REST API. What URI of api for get list of product by item_id? This below get all item without defined item_id GET /index.php/rest/V1/carts/mine/items HTTP/1.1 Content-Type: ...
0
votes
0answers
155 views

How to filter Multiselect in Magento 2 search Rest API?

I am using magento search rest api. Now i can filter attributes like neck, sleeve, etc.., but i need to give multiple values for same attribute (like mulitple select) My Request: rest/V1/search?...
0
votes
0answers
38 views

Telling simple from configurable products using the REST API

I'm working on an integration between our companies order system and the Magento 1 store that we are setting up for it. I've used the Magento 2 API before and in the 'items' array that is returned ...
0
votes
0answers
169 views

Magento 2 Rest api get model data in response

We are using Magento 2 rest api to load the model data. WE have created model in Company/Module/Model/Module.php namespace Company\Module\Model\Api; use Magento\Framework\Exception\...
2
votes
0answers
62 views

REST API: One Magento refuses to accept tokens

I have a weird problem- I am trying to use the REST API in Magento 2. I am using exactly the same method with two other Magento installations successfully, and I was looking for some help debugging ...
2
votes
0answers
21 views

How to develop a SOAP API as a guest user

I am trying to developing a SOAP API. For first I created a module like this app\code\MyVendor\MyModule in which I created etc\module.xml, etc\webapi.xml and etc\di.xml. Then I created my API ...
1
vote
1answer
182 views

unable to set store ID in place order REST API - Magento2

There is no option to set store ID in place order API: rest/default/V1/carts/1/order Payload has below data only: { "paymentMethod": { "method": "banktransfer" }, "...
0
votes
1answer
33 views

magento 2 adding product to catagory using rest

i am trying to add products to a specific category but i have two issues. when adding it to category it overrides the previous category but i would like to keep it in both categories and not removing ...
1
vote
1answer
1k views

magento 2 Rest APi How to use default methods

Magento 2 Rest API have many default methods. I want to use those method and display data. For that i have create one new user and assigned full admin access. Trying to get the product information ...
0
votes
1answer
132 views

Magento 2 add an attribute to product using rest

I want to add an attribute to a product using rest api. I have created the attribute but not added to the product. How can i add it to respective product using rest api?
0
votes
1answer
59 views

Magento 2 Rest auth for different website ids

I'm getting customer auth token with following REST request http://mage.local/rest/default/V1/integration/customer/token It is working fine for customers with website_id = 1, but not works for ...
0
votes
1answer
1k views

How to get qty of a product using rest api

I want to get product info including the product qty how can i achieve it. Currently i am using rest/default/V1/products?searchCriteria To get all the product but it is missing qty attribute in it....
2
votes
1answer
445 views

Get all simple product with REST API

I want to fetch all the simple product. The result should not include any configurable products. Currently i am fetching using this http://host/rest/default/V1/products?searchCriteria
0
votes
1answer
254 views

Magento 2 rest api get params returns empty array

Magento 2 rest api get params returns empty array can any one tell me where I am going wrong. i/p: in postman body => raw => json { "orderids":[1,2,3] } (or) { "orderids":"1" } (or) ...
1
vote
1answer
49 views

Magento 2 : Unable to create product on magento 2 store using rest api

{message: "Consumer is not authorized to access %resources",…} message : "Consumer is not authorized to access %resources" parameters : {resources: "Magento_Catalog::products"} resources : "...
1
vote
0answers
92 views

Magento 2 REST API Order Management

I am using Magento 2 and want to manage orders using REST API from a third party portal. I am facing two problems: Paypal orders when placed go to status of Complete instead of Processing and then i ...
0
votes
0answers
55 views

What is the best way to import/create products , customers and orders in magento 2.x

I have a third party Soap API, I have to create products, customers, orders and other related data in Magento 2.x. periodically like every 24 hours. There are around 15k products and orders. What i ...
1
vote
0answers
32 views

API Error - Token is not the correct length

We have two Magento 2.1 stores, one store i can connect to the REST API fine the other i get "Token is not the correct length" which is being classed as a 400 error in Postman. The API has been ...
0
votes
0answers
112 views

oauth/token/request not getting parameter from thirdparty application

I tried to authorize Magento web api using OAuth. Its successfully completed in local machine. I have used OAuth extenstion. I implemented magento2 and code-igniter on different hosts. So I want to ...
0
votes
1answer
331 views

Magento 2 Rest Api customer associated with the email or not?

I am checking the rest api regarding customer has been existed or not with the email. I found an API in the swagger tool i.e POST /V1/customers/isEmailAvailable At Swagger Tool:- At ...
1
vote
1answer
244 views

Talk to Magento 2 REST API using Order Increment ID

Is it possible to use the Order Increment on REST Endpoints in Magento 2 or do I have to call https://example.com/rest/storeview/V1/orders?searchCriteria%5BfilterGroups%5D%5B0%5D%5Bfilters%5D%5B0%5D%...
3
votes
1answer
320 views

Section reload not working on specific REST request

I have created my custom section which reloads when cart data are updated. For this I have created sections.xml file with below code. <action name="rest/*/V1/carts/*/payment-information"> &...
0
votes
1answer
336 views

Why Magento 2.2.3 returns empty collection?

I don't have any prior experience in this. I want to fetch the products from Database. I am trying from past few hours.But not working. I am using following code. protected $...
0
votes
1answer
453 views

Magento 2 REST API get categories names by list of ids

If you use Magento's REST APIs to get product, you use this endpoint: GET /V1/products/{sku} This endpoint returns response with category_ids in it. What I want to do is to get the product with ...
0
votes
1answer
1k views

Guide for API to third party application from inside Magento 2

The important questions i would like to know are: Can I call a CURL from inside a Model or ResourceModel? Is there any standardized way to handle API's to third party apps? Please keep in mind that, ...
0
votes
0answers
309 views

Magento 2 REST API search in Product Media

I try to find all media IDs of one product with the position number 1 in HOST/rest/all/V1/products/SKU/media Everthing I can read tells me to use this: GET HOST/rest/V1/products/SKU/media?...
1
vote
1answer
970 views

How to use dynamic parameter in custom rest api module?

Here is the url I want to to access the custom rest api. http://127.0.0.1/index.php/rest/V1/customapi/filter1/sku_gt_2/filter2/price_gt_10 How do I define webapi.xml & the method parameters in ...
0
votes
1answer
788 views

Magento 2 REST Api POST Picture / Media

I am trying to POST to 192.168.2.153/rest/V1/products/{MYSKU}/media I used several online picture to BASE64 converter to convert to BASE64. The first line looks like data:image/jpeg;base64,/9j/...
0
votes
0answers
85 views

Magento 2 create invoice for igst rest api

I am trying to add IGST and SGST and CGST in invoice rest api , please help me ,in Magento2.
1
vote
0answers
230 views

Magento 2 add customer address attribute to REST APIs response?

I have created customer address attribute "city_id" with setup script. I am able to save the value. but want to display the city_id field to the below apis json response. how we can we add city_id in ...
0
votes
2answers
1k views

Magento 2 how to use PUT rest/V1/customers/me?

Magento 2 how to pass data for the api PUT rest/V1/customers/me/ since we are getting issue below { "message": "Please enter a customer email.", "trace": "#0 /var/www/html/magento2/vendor/...
1
vote
1answer
237 views

Overwrite magento 2 default customer rest api

I use magento 2 rest /V1/customers/me it get response like this { "id": 2, "group_id": 1, "default_billing": "2", "default_shipping": "2", "created_at": "2018-03-30 07:53:13", ...
0
votes
0answers
56 views

Through the API endpoint /categories/{categoryId}/products I cannot retrieve products of the specified category, returns empty array

I'm working with Magento 2 REST API and trying to retrieve products of a specific category, but I'm running into an issue: on my Magento dashboard i can see that in a specific category there are some ...
2
votes
1answer
99 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
99 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
742 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
403 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
351 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
559 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
1answer
665 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
156 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
651 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
180 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
504 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
94 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 ...