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-api]

Magento REST API defines a set of functions that a developer can use to perform requests and receive responses. These interactions are performed using the HTTP protocol.

1
vote
1answer
32 views

Magento 2 api - How to get layer navigation filters available in rest api?

I have someone issue in api magento 2. I need get layer navigation data available in product collection ( current category , search product ) but I don't know magento 2 api available it or not . I ...
1
vote
0answers
10 views

How to generate encrypted cartid to access the Rest API guest cart - Magento 2

I get quote id from below code it returns 6 as my quote id $id=$this->_checkoutSession->getQuoteId(); I used the quote_id=6 in REST api like rest/default/V1/guest-carts/6/estimate-shipping-...
1
vote
1answer
15 views

Magento 2: Can I response with a redirect on REST API?

I have an API endpoint that expects a GET request. On some scenarios, I want to be able to perform a redirect instead of responding with a result. e.g., If you'll open the API endpoint URL in a ...
3
votes
0answers
46 views

Magento 2.3 V1/Search with sortOrders not working in REST API

Magento 2.3 Search Criteria with REST API, SortOrders not working in V1/Search API. I am trying to fetch Category products using Magento REST API by below request URL. http://127.0.0.1/magento230ee/...
1
vote
0answers
15 views

Read Only Integration Token

I'm looking to setup an integration token for the REST API. I understand the process for this, as well as the ability to specify the tokens access to different resources such as products or customers. ...
0
votes
0answers
12 views

Why /V1/carts/mine/totals [GET] and /V1/carts/mine [GET] give 400 and 404 error after placed order in Magento-2.2.7 using Rest API?

I have one issue in Magento-2.2.7 API.After Placed order, This API /V1/carts/mine/totals [GET] and /V1/carts/mine [GET] give errors 400[Bad Request],404[Not Found] error. Please guide me what is ...
0
votes
0answers
23 views

GET method arabic parameters doesn't work magento 2

I'm building rest api to get products filtered by specific attribute, when I pass parameter for GET method in arabic I get request doesn't match any route and when I send it using POST method it ...
1
vote
2answers
20 views

Custom Customer Attribute not being read from Request

I'm trying to add a new Custom attribute to the Magento customer model, and I think that I've set everything up correctly from what I've been able to scour off of this website & google, but I'm ...
1
vote
0answers
11 views

Magento 2 Rest API Shipping

I am currently trying to integrate Magento with an already existing ERP system. It is going well so far except I have a problem when I am trying to ship an order. I need Magento to ignore quantity ...
0
votes
1answer
40 views

How authorization is managed and handled in magento2

I found below code on custom API file : public function orderDetails($params) { $customerID = $this->userContext->getUserId(); if(empty($customerID)){ return[[ '...
0
votes
0answers
35 views

How to Solve Response to preflight request doesn't pass access control check error in Magento-2.2.7?

I have some issue in magento-2.2.7. I am using Magento API's in Angular frontend. When we used api's it show CORE Policy Error. How to solve this error ? Access to XMLHttpRequest at 'https://stg....
0
votes
0answers
14 views

Magento 2 coupon generate api exceptions

I'm having a hard time understanding why the v1/coupons/generate is throwing a {"message":"One or more input exceptions have occurred."} (status_code 400) error I'm using this call to batch generate ...
-1
votes
0answers
23 views

Load image from external url magento 2

I'm using Magento 2.3. I imported some products through api, images reside in another server for reasons of ownership .. I would like to be able to hook the images to the external url to get the ...
0
votes
0answers
18 views

After Editing/Activate “Integration” getting “Internal error. Check exception log for details.” problem

I've added "Test" and "Test2" "New Integration" and when I'm "Editing/Activate" then getting "Internal error. Check the exception log for details." problem. And when I'm a checking exception log, ...
0
votes
0answers
28 views

Magento2: How to stop sending customer welcome email when order created using magento rest api?

Actually i'm creating orders using magento2 rest v1 api http://example.com/index.php/rest/V1/orders/create and order successfully created by calling api. But when customer order created then there ...
0
votes
0answers
16 views

Search products by attribute set

I'm using the M2 REST API and hoping to be able to filter products by Attribute Set. I've been referencing this documentation to try and craft the proper query to the API, here is what I've come up ...
0
votes
1answer
18 views

Add Custom Field in Order and Quote Table To be Used in REST API

Using UpgradeSchema, I've successfully added two fields to the table quote and sales_order The two fields are called delivery_note_doc_due_date and remarks My question is: how can I add the ...
0
votes
0answers
31 views

Magento 2.3 EE Bulk Asynchronous API Operations using RabbitMQ

We are currently testing the Bulk Asynchronous API Operations in Magento 2.3 EE (clean installation) with RabbitMQ. The issue we are finding is whilst creating configurable and simple products. It ...
1
vote
1answer
21 views

Translated text in API response

Is it possible to get translated text in API response while testing the API in postman? I have already added required csv i18n folder in the path: app/code folder. I am passing store code into the ...
0
votes
2answers
22 views

Error while calling an API through ajax

I have added a code inside the script tag for an on-change function. But i am m getting error like this Server cannot understand Content-Type HTTP header media type application/x-www-form-...
1
vote
0answers
25 views

How to create REST API for customer profile update?

Since, I have worked with magento get method api calls but yet didn't work on post or put method. I am trying to update customers to update their profile in mobile app. public function update($id){ ...
0
votes
1answer
16 views

How to change the status value in orders api?

In the orders api of Magento 2, I'm sending status parameter as completed. But I have custom status as "ProdCompleted. So everytime I get status="completed" That's why I want that if api get ...
1
vote
0answers
18 views

Why Magento is not giving final price in rest api?

I have recently try to get product final price via rest api. You can check special_price is already active and it will 20 but of price are coming 45 it will be 20. API URL : http://magento.local/...
0
votes
1answer
16 views

rest api invoice capture does not save entry to transaction log

Magento faithfully logs the transaction detail when I manually capture an invoice within the Magento store interface. I assume that Magento would likewise generate the same transaction detail entry ...
0
votes
1answer
25 views

Magento 2.2.6 - Attributes Issue with Store View and product created by REST

I have a product created in M2 and I create a new product attributes, and when we make an update with c# app using REST Call. In this case the new added attributes are empty in edit product page with ...
0
votes
1answer
15 views

How to get all product image with its sku using Rest API in Magento 2

Using this api /rest/V1/products/?searchCriteria=[] I get all product details any option to get only product images with sku
0
votes
1answer
23 views

Handling REST API exceptions

I have an extension that has some code to save a custom object via REST API service. I have a try and catch (\Exception $e) around the save method, but for some reason I get the following message: {...
0
votes
1answer
45 views

Create/Update Attribute Option Custom api issue

I have created custom rest api to create/update attribute options by attribute_id. Here is my webapi.xml file code. <route url="/V1/attribute/AttributeOption" method="POST"> <service ...
-1
votes
1answer
79 views

Implement Custom REST API end point returns list of best selling products

I have an assignment from clients to implement Custom REST API end point returns list of best selling products. Which I have done here Supports pagination, sort and filter can be filtered by date ...
0
votes
1answer
22 views

Can't read from file “http://<SITE_URL>/rest/default/schema?services=all” in Magento 2.2.6

And Error response is {"schemaValidationMessages":[{"level":"error","message":"Can't read from file http://<SITE_URL>/rest/default/schema?services=all"}]}
1
vote
2answers
81 views

Update Customer data with REST API

SO I am not sure if this is a bug or not, when using the API to update a product in magento 2.3.0 a PUT request like such: curl -X PUT "https://example.com/index.php/rest/all/V1/products/24-MB01" -H ...
0
votes
2answers
34 views

Calling M2 REST API from browser for anonymous users

I'm trying to call REST endpoints from the browser. Initially, I'd like to be able to fetch product information. It looks like session-based authorization is what I'm after. I started by grabbing a ...
1
vote
1answer
45 views

Magento 2 default Rest API not working?

I am working on a default Magento setup and facing the default rest API not responding on checkout and throwing 401 error. {"message":"Consumer is not authorized to access %resources"...} For ...
1
vote
1answer
47 views

Grabbing invoice pdf file through API

Hoping someone can point me in the right direction on how to generate an invoice pdf for an already invoiced order through the rest api. It looks like in the admin, Magento is creating it on the fly ...
0
votes
0answers
10 views

Preventing recursion in custom Magento API

I'm having some issues dealing with recursion in a custom API endpoint I have written for Magento 2. I have an endpoint that returns an entity which contains a number of fields, one of these fields ...
1
vote
0answers
20 views

Magento 2: Is there a way to return custom json response from REST API without building a data interface?

I have a few custom REST API interfaces on my module & they all need to return a standard json response (different on each). After a little research, I realized that I can't do something like @...
0
votes
1answer
28 views

Category Custom Attribute in rest API in Magento 2

I am using magento 2.2.7 and I am creating rest API for Category. From swagger I am getting value like: { "id": 28, "parent_id": 2, "name": "Smart Phones", "is_active": true, "position": 1, "level": ...
0
votes
1answer
28 views

How to create custom API for company and customer creation in Magento 2

I want to create a company/company admin-user in Magento 2 (as what it does from the front-end/back-end panel) via a single API call. Right now am doing with two API calls First is creating a ...
0
votes
2answers
54 views

How to convert this object data into array?

I have this Data Object value. Magento\Customer\Model\Data\AttributeMetadata Object ( [_data:protected] => Array ( [frontend_input] => boolean [input_filter] ...
0
votes
0answers
14 views

Magento1 API - Configurable product option issue

I am creating an app using ionic as frontend and magento as backend. I have created product page API but facing issue in managing configurable product option. On change of each action, ajax is called ...
0
votes
0answers
12 views

How to show stock_status of product in response of /V1/products?serachCriteria in Magento-2.1.12?

I want to show extension_attributes[stock_items[is_in_stock]] in response of /V1/products?serachCriteria in magento-2.1.12. Please guide me.
0
votes
1answer
178 views

Create product attribute with options in magento2 through rest API

I have created a custom module to create product attribute with option thruogh rest Api. Here is my code samples. etc/webapi.xml <route url="/V1/attribute/attributeCreate" method="POST"> &...
5
votes
1answer
54 views

Magento 2 REST - SKU to items on cart totals API response is not available, How to get SKU in response API

Magento 2 Rest API of cart totals doesn't provide SKU, Which is necessary for any operation like extension_attributes /rest/V1/carts/mine/totals The return array of Items is array (size=21) ...
0
votes
2answers
49 views

First steps of creating API integration with Magento2.3

background: I'm new to Magento as I haven't used it before, but I've read through most of the API documentation now. I have an online dashboard application with various widgets that are different API ...
0
votes
1answer
45 views

Magento2 REST API get all customers details

public function __construct(\Magento\Framework\App\RequestInterface $request, \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerFactory ) { $this->...
0
votes
2answers
53 views

Magento 2 REST API Add Single Customer Address

Can anyone mention the Jason payload to add new address in existing customer. yes its a shipping address How to add new Address using REST API, While placing an order.
0
votes
0answers
18 views

undefined rest api checkout cart

We've multiple websites in Magento (magento2.2.4) and we've got an issue at checkout cart and checkout page. We have also enable guest checkout. "/checkout/undefinedrest/buy/V1/guest-carts/.../buy/V1/...
0
votes
1answer
26 views

how to trigger observer by rest api

I need to trigger observer whenever I call specific rest api I've created module/Observer/ObserverClass, module/etc/events.xml and module/etc/webapi-rest/events.xml but I don't know How to trigger it ...
2
votes
1answer
44 views

Magento 2 GET API request to external api

In magento 1 you can make get request like this: First Authorizing object- public function authorize($url) { $cookie = $this->getCookieDir(); $user = $this->getApiUser(); $curl = ...
0
votes
0answers
51 views

Magento 1.9 REST API not working with index.php in URL

I've my vhost as following <VirtualHost *:80> DocumentRoot "E:/projects/m1/m1924c/project" ServerName m1924c.local ServerAlias /test4 "E:/projects/m1/m1924c/project" ErrorLog "...