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

Questions tagged [rest]

Denotes questions related to the REST API on Magento

4
votes
1answer
21 views

Do I need to add shipping address every time whenever I place a new order in Magento 2 REST API?

STEP 1 - Using REST API I created a customer,And in address data I passed default shipping and billing true "defaultShipping": true, "defaultBilling": true, STEP 2 - In GET customer detail API ...
1
vote
1answer
26 views

Magento 2 REST API ship order tracks error

I can create a shipment for an order via REST API. But when i try to add tracks i get the error: Carrier Code can not be empty. This is my code: Array ( [items] => Array ( ) [...
0
votes
0answers
11 views

Magento 2 Rest API get all products with certain attribute_set_id

I need to elaborate de URL that will bring all products with certain attribute_set_id through Magento 2 Rest api, and then change though the api the attribute_set_id of all those items. My problem ...
0
votes
0answers
29 views

How can i get all products with special price using REST Api?

I need to get all the products in catalog that have special price availability using only REST. How can i achieve this? Thanks
2
votes
1answer
21 views

Magento 2 Curl Rest Endpoints

I'm trying to access the REST Endpoints: POST /V1/products/special-price POST /V1/products/special-price-information POST /V1/products/special-price-delete I want to achieve this through PHP code ...
4
votes
1answer
43 views

Get tax class ID by tax rate with REST API

I'm trying to get a tax class ID with only the tax rate value, all with the API. I found that I need a first request that returns me the tax rate ID : /rest/all/V1/taxRates/search?searchCriteria[...
0
votes
0answers
25 views

Magento 2 Guest and Registered Customer API difference

how to find customer id and cart id for registered customers? we are writing the script in node js on the different server. we are successful in sending the items to guest cart from this server, after ...
1
vote
1answer
37 views

How to specific pass fields in custom rest api for get product Information

I'm creating custom rest API for getting a list of products. In my module, I have just use the getList function of ProductRepository. I need to pass select specific fields in API. so, how can I get ...
1
vote
2answers
26 views

How to setup a rest api for adminhtml only?

Magento 2 version 2.1.10. Admin base url : /admin Site base url : / How can I create a rest api and make it available only under the admin base url, like /admin/testapi ? Furthermore, some day I ...
2
votes
0answers
42 views

Magento 2 REST API, get attribute values instead of ids

When I make a REST call to get product data, any multi-select attribute (in custom_attributes) is return with a numeric id rather than its text value, ie: 24 => {#2105 +"attribute_code": "...
0
votes
0answers
13 views

Product Attribute Options

I am currently utilizing the rest api for Magento 2.2.6 to update product attribute options. I am talking about this API: catalogProductAttributeOptionManagementV1 GET /V1/products/attributes/{...
0
votes
1answer
56 views

Request doesn't match any route

I'm building rest API to get a product using its sku, but it give me this message "Request doesn't match any route" although the url in webapi.xml file is the same in the request. magento version is 2....
0
votes
2answers
68 views

HTTP 401 Basic Authorization error accessing Magento 2 Rest API

I am trying to use the Magento 2 Rest API, using token authorization. I can successfully POST user/password to /rest/V1/integration/admin/token/, and I get a token returned. But when I try to GET ...
0
votes
0answers
17 views

Magento 1.9: Rest Api + _create method return 301 status

I try to create a _create[post] REST api in magento 1.9 but i am getting issue while print or return some data from api. This api work perfect on localhost with 200 status code, But on server it ...
1
vote
1answer
36 views

How to get all oAuth2.0 details for POSTMAN REST API?

How can i get oAuth 2.0 details for magento 1.9.2.3,
0
votes
0answers
25 views

How to get category name in product rest api in M2

I am trying to call rest api with website/rest/V1/products/78 and getting product data. In category field am getting category_id how can I modify this to get category name instead of id. Looking for ...
1
vote
0answers
26 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 ...
2
votes
1answer
31 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
1answer
61 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
21 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
121 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
24 views

Magento2 Shipping Methods rest api

Is There any possibility to fetch all shipping methods using rest api in magento2 Thanks
0
votes
1answer
74 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
164 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
117 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
48 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
46 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
31 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
32 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
77 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
1answer
53 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
35 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
2answers
117 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[...
5
votes
1answer
132 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 ?
5
votes
0answers
74 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
166 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
8 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
36 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
45 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
35 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
114 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
33 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
85 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", "...
2
votes
0answers
69 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 ...
2
votes
0answers
38 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
56 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
224 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
48 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
24 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
34 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 ?