Stack Exchange Network

Stack Exchange network consists of 174 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

Denotes questions related to the REST API on Magento

1
vote
0answers
16 views

Auto Add Product Attribute Options when Creating a new Product by Rest API

Is there a way to tell Magento 2 to: Send custom_attribute Label instead of Value; Auto create option in case the Label doesn't exist yet. I was able to do it with Magento 1 API, but I can't find a ...
0
votes
0answers
9 views

0 item price in cart when add to cart after place order

I'm building Mobile Magento 2 application with REST API. I'm using the following endpoint to add an item to cart /V1/carts/mine/items Then I'm placing an order with /V1/carts/mine/order After ...
2
votes
0answers
21 views

Create a multi-language REST API's in Magento 2

I have multi-language store in Magento v 2.2.5 English French Now,I have created multiple REST API's, like Custom Home Page REST API's GET Products, Categories Add to cart Checkout Place an Order (...
0
votes
0answers
17 views

API catalogProductAttributeOptionManagementV1 return different result than doc

When I'm using catalogProductAttributeOptionManagementV1 API (get All options of attributes), with the URL https://local.dev/rest/V1/products/attributes/color/options, I get this result : [ { ...
2
votes
1answer
89 views

Magento 2 Api/Data, When To Create It?

I have fairly simple REST API request to get guest country code by his ip. In my block file this works perfectly fine when using curl: $url = "http://........./".$guestIp."?access_key=".$...
0
votes
2answers
12 views

Magento2 Shipping Methods rest api

Is There any possibility to fetch all shipping methods using rest api in magento2 Thanks
0
votes
1answer
23 views

Create REST API with post params

I have below JSON Data for rest API {"region_id":"475","city":"city","item":[{"qty":"1","weight":"","price":"10.0000","sku":"test"}]} and i wann to create api class I do like this /** * @api * @...
1
vote
1answer
40 views

View all REST API routes of my Magento 2

I am looking for the url which will show all the available API REST routes. I have seen it before, which outputted some json. I just can't recall the url nor can't I find the right information. Anyone ...
2
votes
2answers
46 views

Consumer is not authorized to access %resources Magento_Sales::sales

I have this basic API script: <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(-1); $usr = [ 'username' => 'username', '...
1
vote
2answers
29 views

How to edit cart item in Mageto 2 REST API?

How to edit cart item in Mageto 2 REST API ? I am adding product in cart using below API. http://magento.host/index.php/rest/default/V1/carts/mine/items method : POST Authorization Bearer <...
1
vote
0answers
25 views

Magento 2 - How to add custom order item field on order export API

I added a new field on table sales_order_item. I need to display it on REST API order export, in the "items" node. Is it possible to do that ?
0
votes
0answers
18 views

Request an Admin Token using Guzzle RestAPI

I am hoping someone can help me figure out what I am doing wrong. I am just trying to get the Authentication Token Response from Magento. I can get it without issue using CURL and I am getting a 200 ...
1
vote
0answers
26 views

Magento 2 API - crud for all tables

Is it possible to create a new REST API to update or create data in all magento tables from a xml added in POST : <data> <row table="Nom_Table_1" key="Nom_Champ_Key_1"> <...
4
votes
2answers
31 views

Get customer details by using Authentication Token

I use this Magento 2 rest api to get customer token: curl -X POST "https://my.project/rest/V1/integration/customer/token" \ -H "Content-Type:application/json" \ -d "{"username":"me@awesome....
2
votes
0answers
39 views

Magento 2 for logged In customer need to add shipping address every time i place a new order?

This is what i am following... 1. Add Configurable product in cart. http://magento-host/index.php/rest/default/V1/carts/mine/items method : POST Authorization : Bearer <customer token> body ...
2
votes
1answer
26 views

Export custom option via REST interface

We have created a product with a custom option (free text field). The customer enters data, now this data should be exported via curl -X GET --header "Accept: application/xml" --header "Authorization:...
1
vote
1answer
34 views

Fetch all specific customer's order using Customer token in magento 2 REST API?

I am aware about method using admin token Request type :: GET URL http://<host>/rest/V1/orders ?searchCriteria[filterGroups][][filters][][field]=customer_email &searchCriteria[...
4
votes
1answer
52 views

How to capture the User ID using magento's customer Token?

How do I make a call to that URL that captures the User ID, using Magento customer Token in magento 2 rest API? How Magento 2 makes calls in-between for the APIs ?
4
votes
0answers
47 views

What are the use of ExtensionAttribute JoinProcessorInterface and CollectionProcessorInterface at magento 2.2.3

I built Magento 2 Module which has a model and Service contracts/API. During this implementation, I have followed vinai Kopp article and also magento2 module Magento_Quote. On this Magento\Quote\...
3
votes
2answers
79 views

Magento2 REST API - Cannot create cart/quote for customer

I am building a shoppingcart using the Magento2 Rest API and I want to create a cart for a customer and (if not logged in) for a guest. For guest carts is it working: Create a guestcart: POST ...
0
votes
0answers
7 views

Export Integration Settings

I have an external service that needs to be able to access the rest api of the Magento installation. I have added a new integration and generated the needed consumer and access tokens. The extension ...
2
votes
0answers
22 views

Magento2 Rest Api to Delete an item after place order

Can anyone help me how to remove an item from an order after order completion using resti api in magento2 Thanks
1
vote
0answers
35 views

How to fetch eligible Payment and Shipping method in REST API magento 2?

Fetch eligible shipping methods and Payment methods in Magento 2 Rest API. In case of if i have a customer id. In case of if it is a guest user.
1
vote
0answers
30 views

Magento 2 REST API - Encrypted Authentication

I would know if it is possible to use the REST API of Magento using a Basic Auth approch. The idea of the token authentication, as described in the doc is very simple and good for my purpose but for ...
3
votes
1answer
57 views

Magento2: Module Vault rest api help

I create a webapi.xml in module vault: <route url="/V1/vault/items" method="GET"> <service class="Magento\Vault\Api\PaymentTokenManagementInterface" method="getListByCustomerId"/> ...
2
votes
0answers
31 views

Magento 2 : Rest APi Management payment methods

I need a solution to manage payment methods. Ex. Credit cards. in the web version we have the option to list the cards already used in purchases. (html: // vault / cards / listaction /).   Is it ...
1
vote
0answers
48 views

WebAPI gives error: Class “array” does not exist

I want to send a list of statuses to my API. I send an array because it may be a lot of statuses. So my JSON looks like: { "statuses":[ "status_ok", "status_failed", "...
1
vote
0answers
53 views

How to get window.checkoutConfig data via REST API?

I am building a custom frontend for Magento 2 Checkout. Sometimes the checkout uses window.checkoutConfigin the built-in frontend. My frontend uses the REST API provided by Magento 2, but how can I ...
1
vote
0answers
25 views

event sales_order_invoice_save_commit_after is not being dispatch over REST API

May I know how can I dispatch event sales_order_invoice_save_commit_after when I create invoice via REST api? I noticed there are quite a number of extensions is observing this particular event but ...
1
vote
0answers
38 views

GET products for my cart with customer token

I want to insert items in a cart using a customer token. I already found how to insert the products but it needs the SKU of the products. The problem is I can't find a way to get the product's SKU ...
2
votes
1answer
106 views

How to override webapi.xml in custom module?

I want to override /vendor/magento/module-catalog/etc/webapi.xml file in my custom module. <route url="/V1/categories" method="GET"> <service class="Magento\Catalog\Api\...
3
votes
1answer
30 views

I can't use Paypal with REST request

I've set up a test store with Magento 2.2. I use one test paypal account for the store and one for the customer. I've set up Paypal in the configuration panel and managed to buy a product using the ...
2
votes
0answers
19 views

Custom REST API returns duplicate “response” tag

I am struggling because I get an invalid response from my custom API module for Magento 2 (2.2.5). When I send a request to my endpoint via GET with the header "Accept application/xml" (which is ...
0
votes
1answer
30 views

How to manage Banners for Mobile API?

How to manage Banner module for Web and Mobile Application as per service contact standards and REST API ? Should i make different modules for mobile and web ? Or it can be manageable by common ?
1
vote
1answer
112 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
2answers
256 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
181 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/...
0
votes
1answer
91 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
64 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
61 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
24 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
36 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\...
0
votes
0answers
33 views

Is it possible get product url_key through Magento 2 REST API

I want to get product's url from my shop. I expect make rest api request and get url_key in reponse json format. Is it possible.?
2
votes
0answers
50 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
14 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
57 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
30 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
242 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
0answers
27 views

Magento2 - REST API Add Custom Fee

I've looked at similar examples on how to add a custom fee from this question: how to add fee to order totals in magento2 Though I am confused on how to implement this with just an API method. I feel ...
0
votes
1answer
82 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?