All Questions
590 questions
3
votes
1
answer
1k
views
Magento 2 How to get rest API response as an object?
I am getting rest API response as like below,
[{
"field1" : "val1",
"field1" : "val2",
....
}]
How do I get API response as object, without braces []. It will return only one object every time, so ...
0
votes
1
answer
29
views
How to save products in bulk using API?
I am new bee in API development and need to save bulk products in my Magento using API.
Do I need to create custom API module or is there any default API to save the products in magneto2?
What are the ...
4
votes
3
answers
8k
views
where to find Magento 2 API docs?
Finally I found out the magento 2 api endpoint for all products as below
rest/V1/products?searchCriteria[pageSize]=20
but I need more detailed docs about api endpoints which I coudn't find out yet. ...
2
votes
2
answers
1k
views
Magento 2 : How to clear cache using REST?
How can I clear the Magento 2 page cache using REST API after updating the product quantity from 0 to 10?
3
votes
4
answers
1k
views
Magento 2 - Between "Rest" and "Soap", Which is better then one?
Between "Rest" and "Soap" API, Which is better then one ?
I have some cases below:
1) Apply for mobile app call web-service.
2) Apply for desktop app call web-service.
3) Apply for web app call web-...
1
vote
2
answers
2k
views
Login into Magento 2 site from external site
I have a site outside Magento's domain and I should allow Magento customer to login into Magento Store from this external site. Being completely new to Magento , I don't know how to implement this ...
4
votes
1
answer
2k
views
Sign Up With Avatar REST API Validation Error : Magento 2
I have this code for image attribute (avatar).
app/code/Ibnab/CustomerPut/Setup/InstallData.php :
<?php
namespace Ibnab\CustomerPut\Setup;
use Magento\Framework\Module\Setup\Migration;
use ...
0
votes
1
answer
1k
views
Rest Api service for shipping information Post -
V1/carts/mine/shipping-information for this service which parameter are required..
I had given below parameters
{
"addressInformation": {
"shippingAddress": {
"id": 0,
"region": "...
0
votes
2
answers
3k
views
Magento 2.3.5 - API error The "array" class doesn't exist and the namespace must be specified
We get the following API error on our Magento 2.3.5 store;
The "array" class doesn't exist and the namespace must be specified. Verify and try again.
More info;
<![CDATA[#0 /vendor/...
2
votes
2
answers
2k
views
Magento2 REST API products list and out of stock
In the api call V1/products i get also out of stock products, even though I've set in Stores->configuration->catalog->inventory "Display out of stock products" to No.
there's a way to get rid of this ...
0
votes
0
answers
11
views
Add To Cart API and Read From Cart API, unable to retrieve configurable product variant - Magento 2.4.4-p4
So I was creating an add to cart API and read from cart API
The problem that I encounter is unable to retrieve variant of configurable product
Below are my addToCart API code
/**
* POST add to ...
1
vote
1
answer
2k
views
Magento 2 API get product price
I'm building an iOS application for my store, and I'm looking for a way to get the correct price of an actual product.
Looking at the API I only find requests to get raw product information.
http://...
5
votes
1
answer
1k
views
Magento 2 : Wrong order created and updated date in rest api response
I am fetching the orders using Magento 2 REST api services. I am using IST timezone the dates saved in the database are in correct timezone. I have set timezone to "Asia/Kolkata". On customer ...
1
vote
1
answer
2k
views
Injecting Guzzle with Parameters Magento 2
Writing some REST API bits and going to use Guzzle, which I have used many times before.
The issue I am coming across is, I know Guzzle has to take the configuration via parameters when constructing ...
0
votes
3
answers
2k
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
3
answers
2k
views
custom "sales_order_item" attribute to API response
I followed this guide to add a custom product attribute to quote and sales order item throughout the order process and this works fine.
My custom attribute is added to the sales_order_item table ...
0
votes
1
answer
2k
views
Magento 2 set order extension attributes via API
Is it possible to set an order's extension attribute value when creating the order via the API or is there an appropriate API endpoint to update an existing order with this information?
For example ...
0
votes
0
answers
17
views
API with price filter and configurable products
I'm working with the Magento 2 API and can't work out why when using a price filter configurable products are being filtered out completely from the results. I remove the price filter and the products ...
1
vote
1
answer
5k
views
Magento 2 How to add custom attribute to Quote Item Rest API
I want to add custom attribute to >http://{{magento2}}/rest/V1/carts/mine/totals
API response.
I have done follwing way but it not working.
>extension_attributes.xml
<config xmlns:xsi="http:/...
3
votes
2
answers
2k
views
Get Countries and related Cities REST API
I have a form in my mobile app for shipping information. I am looking for REST API to get countries and its related cities.
I found only an API:
V1/directory/countries
How can I get cities for ...
1
vote
1
answer
2k
views
Magento 2 Tier Price using API
it looks like is not possible to use "Tier Price" when creating an order with API in Magento 2.x
Can you confirm that?
Is there a solution to create an order and get the price based on tier price ...
0
votes
1
answer
2k
views
Magento 2 rest API returns false when trying to get a token
I am trying to create a web app that gets data from a Magento 2 website thanks to the API, following this tutorial but it returns bool(false) when I do var_dump($token)
I have read other threads on ...
2
votes
2
answers
2k
views
Magento 2 API - Update Product Custom Attribute to Blank/Null
I am trying to update a product via the Magento 2 Rest API.
If an attribute already has a value I can update that value with another value with no problems.
However if I want to delete the value and ...
0
votes
2
answers
2k
views
Magento 1.9 Order Rest API Order Data
Using magento rest API i can see the data of product, category etc using
https://magentohost/api/rest/products, Here is can see list of products but when i access
https://magentohost/api/rest/orders ...
0
votes
2
answers
3k
views
Magento 2.3 Custom Rest Api get size limit
I have made custom API which returns the categories with the products in them like this:
array(
key: Category name
values:product1,product2,...productX
(
where product is an array:
array(id,price,...
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) ...
2
votes
1
answer
5k
views
Consumer is not authorized to access %resources REST API
I use MAGENTO 2 REST API in MobileFIrst project (Worcklight)
in my adapter :
function _retrieve(token) {
if (!token)
return { 'isSuccessful': false, 'errorMsg' : 'params is ' + params};
...
0
votes
3
answers
2k
views
Magento 2: How to add a tracking number to an order using REST API
I use the following code to add a tracking number to an order:
$url = 'https://xxxxx/rest/V1/order/514/ship';
$authorization = "Authorization: Bearer ".$json; //I get $json ...
-1
votes
2
answers
1k
views
Magento 2 send data to an API
I would like to have data from Magento 2 dashboard shown in some visualization software and have found documentation from the other site about their API, but I can't find any information from Magento ...
0
votes
1
answer
1k
views
When creating an order via the Magento2 Rest V1 API, can I disable customer emails?
I'm working through integration of orders from external sources into our Magento store. We sell directly through our Magento instance as well as through some other carts (cartLoom). When an order is ...
1
vote
1
answer
1k
views
REST API Access Token Issues
I am trying to use the Magento REST API for a client to get details of customers, and orders, etc. I have setup a REST Consumer and I am trying to obtain an oauth access token and having issues. I ...
1
vote
1
answer
1k
views
Magento2 How to get parent product(configurable) by child product using REST API
How to get parent product(Configurable) by child product(Simple) sku or id using REST API?
I can't find in this list:
https://devdocs.magento.com/swagger/index_22.html
plz help me..
0
votes
1
answer
1k
views
Magento 2 : Change default REST API response
I have an order collection get out via API
How can I change some value in API response via custom module
3
votes
1
answer
1k
views
Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect) magento rest api error
Error message below
Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a
redirect)
{"messages":{"error":[{"code":401,"message":"oauth_problem=internal_error&message=Mage
...
1
vote
1
answer
7k
views
Connecting to Magento Rest API by python
I'm new to Magento API and actually a python programmer, there are some APIs I should connect to them through Rest and I stick to the first step of authentication with OAuth for getting access tokens ...
2
votes
1
answer
1k
views
How can I get user information from JWT tocken?
I'm react-native developer, I'm new to Magento, REST and OAuth. I want to use the Magento 2.0 OAuth REST API to login into my app
I am getting this token as shown in the image, how can I use this ...
0
votes
1
answer
2k
views
Create a REST API to get the data from the custom table in magento 2
I create a database table 'computergames' . Now the table display in postman by get request
1
vote
1
answer
2k
views
Estimate shipping methods by address id Error REST API : Magento 2
I am trying to call this magento 2 built in API :
POST http://domain.com/rest/V1/carts/mine/estimate-shipping-methods-by-address-id
In Body :
{"addressId": 194}
But I got this error:
{
"...
0
votes
1
answer
4k
views
How to use access Magento 2 API from C# with REST and Token-based authentication
I create an Integration -> Activate -> Obtained the Access Token
Like is described here: http://devdocs.magento.com/guides/v2.2/get-started/authentication/gs-authentication-token.html
And in my test ...
0
votes
0
answers
21
views
How to upload a new attribute via API?
I want to create an attribute from my android app written in Kotlin. For the explanation I am going to use Postman. Following is the code I use to create an attribute:
Post method:
https://mydomain....
0
votes
0
answers
31
views
How to add custom content to products endpoint?
In magento 2.4.6 I have a custom module that adds some configuration in the admin panel. I also have a Helper/Data.php with methods to collect the value of each field of this configuration.
On the ...
0
votes
1
answer
38
views
Setting Custom Property in customer using APi in Magento
I'm passing a custom property value using an API. The problem is that I am sending "Device Registration" as the origin ( custom property ) but the value that is being set in as "D365FO&...
2
votes
2
answers
3k
views
Sort Products REST API : Magento 2
I did a sort for product by price through API:
http://domain.com/index.php/rest/V1/search?searchCriteria[requestName]=quick_search_container&searchCriteria[filterGroups][0][filters][0][field]=...
0
votes
1
answer
62
views
How to create REST API endpoints for core_config_data table?
I am working on an integration extension for Magento 2. I would like to create API endpoints for core_config_data table, because I would like to insert a html script to header of each specific store ...
1
vote
0
answers
59
views
Magento2.4.4p4 REST API Error 'Class string does not exist'
I had this issue during when I create a custom Rest API in fresh magento 2.4.4p4
As you can see the error I get is Class string does not exist
Below are my code folder structure, which I found to be ...
0
votes
1
answer
79
views
Magento2.4.4p4 REST API Error 'Class array does not exist'
I had this issue during when I create a custom Rest API in fresh magento 2.4.4p4
As you can see the error I get is "Class array does not exist"
Below are my code folder structure, which I ...
0
votes
0
answers
17
views
Magento 2.4.4p4 Rest API Trouble to Confirm Customer Registration
I am having trouble to activate this API to confirm user email upon registration
Request :
{
"confirmationKey": "nVU3KFeGFg3Zn6L1oZlUbFaPclx3BOWN"
}
Response :
{
"...
0
votes
1
answer
68
views
The "oauth/consumer/enable_integration_as_bearer" path doesn't exist
I am trying to reset API but when I going to the path
Stores > Configuration > Services > OAuth > Consumer Settings > Allow OAuth Access Tokens to be used as standalone Bearer tokens
I ...
0
votes
0
answers
24
views
Not getting the difference changes on comparing two git branches in same repo using Github API
I am able to get difference between two branches stage and master under same repo on web version via below web URL.
https://github.com/:username/:repo/compare/master...staging
but not getting the ...
0
votes
0
answers
26
views
Update REST API Payload using before Plugin
Can I use before plugin in Magento 2 to update Customer Creation Payload?
Reason: In Magento, we have one custom customer attribute of dropdown type as you can see below.
Now the API is working fine ...