All Questions
590 questions
30
votes
5
answers
39k
views
How to create order using REST API?
I need to use the Magento REST API to create an order from a mobile client. In my case, the mobile side will implement the payment directly using PayPal SDK. What I need to do is to create an order by ...
18
votes
3
answers
6k
views
How to return a JSON object with a custom REST API in Magento 2?
I'm writing a custom REST API demo; now it can return numbers and strings in my demo, but I want it to return a JSON object like other REST APIs.
In my demo, I call the Magento 2 API (i.e. get ...
17
votes
1
answer
4k
views
Not able to get OAuth token for Magento Rest API Client
I am using Magento version 1.9.1.0 and server running on my mac and trying to use Magento Rest APIs using OAuth Integration.
I have a consumer key and consumer secret.
Now, I want to get OAuth token ...
16
votes
2
answers
18k
views
Magento2 REST Update custom attributes
How can I update the custom attributes such as description?
The following code properly update price and product name, but not custom attributes (unchanged). The new product is created properly with ...
15
votes
3
answers
33k
views
Magento 2 REST API usage with examples
need to call Magento2 rest api in code level how to call default magento REST APIS
14
votes
5
answers
53k
views
Receive Post Parameters In Magento 2 Controller
I am calling HTTP request for controller, I am getting get parameters, but I am not able to receive post parameters in Controller.
Basically I want to call Magento 2 APIs and send customized response ...
13
votes
1
answer
5k
views
Magento2 Rest API Order Flow
I am making REST API calls to magento website for order placement. Below is the sequence of my calls.
Create a cart rest/V1/guest-carts/
Get the cart rest/V1/guest-carts/...
12
votes
3
answers
20k
views
Magento 2 Api Getting Error '%fieldName is a required field'?
I am not getting result (id) while using POST method using url is rest/V1/hello/test/3
Screenshot:
I have followed this link For Reference Please Click Here
1) webapi.xml
<?xml version="1.0"...
11
votes
1
answer
6k
views
Magento 2 rest API - How to Manage API Authentication Lifecycle on Mobile Devices Application?
In Magento [2.2.4] web API when I pass username and password then it generates token for that specific customer (Which is only valid for 1 hour - it is configurable from Magento admin)
http://...
10
votes
3
answers
6k
views
REST API Update Product HTTP Method PUT or POST?
The REST API documentation says that PUT /V1/products/{sku} creates rather than updates.
Is that an error in the docs because I would have assumed that it is an update method and POST being the ...
10
votes
2
answers
2k
views
Magento 2: Creating configurable product using the REST API
In order to create configurable product I need to create configurable product, virtual product and finally connect them.
Example of json request got from here: How do I create a configurable product ...
9
votes
2
answers
9k
views
How to return Associative Array from API in Magento 2
I have created Custom Api which returns associativeArray.
If I use associativeArray it's giving error
If I use string[] it's working
But I want to return associativeArray.
Error: Class "array" ...
9
votes
4
answers
24k
views
How can I get product list with its detail in rest API I'm on magento2
I'm working on native mobile application and want to display product after customer selected a category. I am able to get list of the product by category in rest request but that list don't have much ...
9
votes
2
answers
22k
views
How to integrate magento REST API with third party?
I was just trying to find information about REST API. There are some examples at Magento resource and some private blogs. All are the same!!
As basic info, I found if I want to update products through ...
9
votes
2
answers
5k
views
merge guest quote with customer quote(if custommer log in) magento 2 rest api
if 2 items in cart if customer login both item should need to add cart , Both quote (before login & after login) merge and create final quote which contain all item of customer quote
Refference ...
8
votes
4
answers
31k
views
How do I get a response from REST API in JSON format in Magento 2?
I used the resources in “Creating a New REST Web Service in Magento 2” and “Creating a New REST Web Service in Magento 2” to create a custom API module, but the response is in XML format. I need a ...
8
votes
5
answers
61k
views
Magento 2: How to get order information using REST API?
I want to get order,customer information by using REST API.
Anyone have idea about this?
8
votes
5
answers
10k
views
How to add a new address (shipping or billing or another) via Magento 2 REST API?
There are API's available to fetch and delete address of a customer but not create a new one.
GET /V1/customers/addresses/:addressId
GET /V1/customers/me/billingAddress
GET /V1/customers/:...
8
votes
3
answers
8k
views
Magento 2 - Construct a HTTP Post REST API
I construct a REST api using POST as follow
etc/webapi.xml
<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../...
8
votes
2
answers
2k
views
Add category image with Magento REST API
Has anyone successfully uploaded an image for use with a category? When going through the documentation @ http://devdocs.magento.com/swagger/index.html#/ I don't see any implementation that could ...
8
votes
1
answer
632
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\...
8
votes
1
answer
2k
views
Getting started with Magento REST API
So the official documentation is very terse (bad!), particularly for someone who hasn't worked with REST/Oauth in the past. I'm using Magento 1.8.1 CE.
Can somebody provide a simple PHP example of ...
8
votes
1
answer
2k
views
What is the recommended page size for GETting sales orders through REST API calls?
I am trying to make a GET call to the Magento 2 REST API to get all the sales orders. What is the recommended page size I should be using? Is there any upper limit on the page size?
8
votes
1
answer
1k
views
REST api call for Guest user
Developing android native application using scribe library, and uses Rest based web services from existing Magento based eCommerce platform.
I have got prerequisite requirement like 'Key' and 'Secret'...
8
votes
0
answers
1k
views
Magento REST without oAuth
I have an Android and an iOS app that connect to Magento through SOAP and perform various actions.
I have to switch to REST, but the users of the apps must not notice this change. They do not know ...
7
votes
3
answers
13k
views
Magento2 How to set expiration time for token
I Have generated a token for API calls by using following code :
curl -X POST "http://magento2.ce/rest/V1/integration/customer/token"\
-H "Content-Type:application/json"\
-d '{"username":"john@...
7
votes
5
answers
7k
views
error oauth_problem=signature_invalid for POST
i am using magento rest api for get data and it work very well but when i wanna send data return this error
"messages": {
"error": [
{
"code": 401,
...
7
votes
3
answers
12k
views
Get Token Authentication For Customer Logged With Facebook & Twitter : Magento 2
Dears, I created a custom REST API, So customer can login Via facebook and twitter through mobile app. The API consists of one service which take some parameters and email parameter and check if this ...
7
votes
2
answers
10k
views
Magento 2 REST API checkout payment gateway redirect
I am creating a Magento 2 store that sells virtual products, this site have its checkout directly at the product page. The customers will never buy more than 1 product at a time.
This checkout uses ...
7
votes
2
answers
6k
views
Magento 2 Update a product name using Rest API
I got to update weight, qty, price and others field, but when I update the product name, on catalog list (admin) the product change the name, but when I enter on edit view, the product continue with ...
7
votes
2
answers
9k
views
Using searchCriteria while searching attributes in magento 2.0
Fetching attribute info, if I apply multiple filters in a single search criteria, it does not work. But in case of single filter it works perfectly.
Multiple filters HTTP request:
http://192.168.1....
7
votes
1
answer
4k
views
How do I consume the REST API in Magento 2, using AJAX with session-based authentication?
I am having issues successfully making an AJAX call to Magento 2 REST API endpoints, using session-based authentication.
When I run the following javascript, I always receive a 401 (Not Authorized) ...
6
votes
5
answers
26k
views
Magento 2: get product through api using id?
I want to get product information using API call. I have product id of that product is it possible to do that.
6
votes
2
answers
14k
views
How can I generate a full swagger doc for Magento 2 REST API?
I have a fresh Magento 2.1.5 install, and I'd like to access the full swagger spec, like the one published on http://devdocs.magento.com/swagger, but with the Try it Out! buttons enabled.
I've ...
6
votes
3
answers
13k
views
Develop a mobile app with Magento 2 REST API.?
I couldn't find some needed API functions in Magento 2 REST API Document . I am very doubted. Is it possible to develop a mobile application with current Magento REST API.?
I couldn't find methods to ...
6
votes
8
answers
24k
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',
'...
6
votes
4
answers
18k
views
How to add product in Magento using REST API?
I want to add a product using the REST API in Magento 2.
How can I achieve this?
6
votes
2
answers
651
views
I have to make an API where I can return orders (product name) placed by a customer using customer Id?
In sales_order table product name field is not there but i have to fetch that too. How to fetch the product name ordered by a customer using customer ID?
6
votes
1
answer
8k
views
Magento 2: How to authorize REST API call of customer after login?
I am using rest API to login in customer account usig the below URL and details:
URL: https://magento.host/index.php/rest/V1/integration/customer/token
Header: "Content-Type:application/json"
Data: "{...
6
votes
1
answer
6k
views
Get multiple product images using REST API
I'm requesting products list using the following API call GET /V1/products
http://127.0.0.1/magento2github/index.php/rest/default/V1/products?searchCriteria%5BpageSize%5D=100000&searchCriteria%...
6
votes
2
answers
10k
views
Create Custom Rest Api in Magento2 and solution for "InvalidArgumentException" error
I started on Magento2 Custom rest API module creation
for that i follow the below post
API Module for Magneto2
url:- http://localhost/magento2a/rest/V1/calculator/add/1/2
app/code/AlanKent/...
6
votes
1
answer
5k
views
Magento 2 rest api - get orders with products' custom attributes
I would like to have the proper cURL command for getting all pending orders with the products' custom attributes in Magento 2 REST API.
I use this, but there are no custom attributes on the products ...
6
votes
1
answer
2k
views
Process Payment Using Rest API In Magento 2
I working on an APIs to create mobile application, everything worked ok,
now I need to pay for the mobile application using Magento 2 rest API.
how can I pay using rest API?
Is there any API ...
6
votes
3
answers
5k
views
Magento rest API configurable product and category list
I am having a project using Magento rest API V1, I have read through the documentation and looking for the answer around the web but cannot find the solution.
** First: **
I want to show list of ...
6
votes
1
answer
3k
views
How to implement create, update, delete in magento rest api?
How to set methods in api2.xml
I create _create(), _retrieve() , _update(), _delete(), _retrieveCollection() functions in Module/Model/Api2/Test/Rest/Guest/V1.php
I think its manage in /app/code/...
6
votes
0
answers
2k
views
Magento2 How to get Custom order attributes value in response in rest api v1
down vote
favorite
I have installed Amasty order attributes extension
I followed http://magehit.com/blog/how-to-get-value-of-custom-attribute-on-magento-2-rest-api/
and created
app/code/Amasty/...
6
votes
1
answer
507
views
How to use REST API for mobile App?
I have found on dev docs that REST API is recommended for mobile application.
I have created integration from magento admin panel and tried to access resources with passing access token in header. ...
6
votes
1
answer
1k
views
Magento SOAP API call limit?
Is there a limit on API calls using Magento's SOAP API (V1)? The product page for a store I'm working on requires several calls to the "cataloginventory_stock_item.list" method, once for every "simple ...
5
votes
2
answers
22k
views
Update product using rest api in magento 2
First thing I would like to share is that I am very new to magento. I am working on addition of products using rest api. I tried one product and it was created.
$headers = array('Authorization=> ...
5
votes
3
answers
14k
views
How do I create a shipment via REST API?
I'm trying to create a shipment via the REST API. I'm able to edit existing shipments via /rest/V1/shipment, but I can't seem to figure out how to add one. I consistently get a "Could not save ...