All Questions
47 questions
0
votes
1
answer
2k
views
Magento 2 - Custom REST api POST method not working
I have created a custom rest api module. When i am using GET method it's working fine. But when i am trying to use POST method it giving below error
Request does not match any route.
Does anyone ...
3
votes
1
answer
223
views
invalid date when adding product with custom options(datetime) using REST API
I have a product with a custom option DateTime filed in product options
When I try to place an order using rest API. My order array is given below
$order = array (
'cartItem' =>
array (
...
0
votes
0
answers
692
views
Magento 2 Rest API return multiple interface class
On the Magento 2, I want to custom return object on my custom rest API, I have code like this on the Hz\Clients\Api\TransactionInterface.php
<?php
namespace Hz\Clients\Api;
interface ...
2
votes
0
answers
205
views
Magento2 Mobile SSO - OAuth-based authentication
I have been asked by a mobile dev to provide Magento 2 API to create a single sign-on application for my store. I have provided this info:
• curl -X POST "https://example.com/rest/V1/integration/...
1
vote
2
answers
4k
views
Rest API import product Magento2
I want to add a product using REST API but don't know how should I do.
could you please help me what should I do? Magento 2.1 I use. this is the code that i used:
{
"id": 989898989989989898,
"...
2
votes
0
answers
231
views
Get and Add like(Favourite or Unfavourite) product in Magento 2 Rest API With URL?
Get Favourite product in Magento 2 REST API with URL?
And Add to Favourite in Magento 2 REST API with URL?
0
votes
1
answer
262
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
2
answers
5k
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 ...
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
0
answers
485
views
"Unable to save Stock Item issue" when I try to create multi-able simple products via RESTful API
I m using Magento2 API to create a configurable product, So I need to create numbers of the simple products first, but wired thing happened, some of the products have successfully created, but most of ...
1
vote
1
answer
698
views
Magento 2 Customer Rest Api Token error for some users [weird problem]
We have a mobile app for magento 2 which we communicate with magento 2 server using Rest api.
Our intent is to get customer access token by below request
https://magento.host/index.php/rest/V1/...
0
votes
1
answer
704
views
Access token expires after 1 day
I am using the Quickbooks API for my application and I have used
https://intuit.github.io/QuickBooks-V3-PHP-SDK/authorization.html
generate-oauth-2-0-tokens for token generation.
The token is created ...
1
vote
1
answer
697
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"
},
"...
2
votes
1
answer
4k
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
1
answer
191
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?
0
votes
1
answer
3k
views
How to get qty of a product using rest api
I want to get product info including the product qty how can i achieve it.
Currently i am using
rest/default/V1/products?searchCriteria
To get all the product but it is missing qty attribute in it....
2
votes
1
answer
1k
views
Get all simple product with REST API
I want to fetch all the simple product. The result should not include any configurable products.
Currently i am fetching using this http://host/rest/default/V1/products?searchCriteria
0
votes
2
answers
1k
views
Magento 2 - Class int[] does not exist
Scratching my head with this issue, and I just do not understand why this is happening in the first place. Made a custom REST API call to remove multiple items from the cart with one single API call ...
2
votes
2
answers
6k
views
401 Unauthorized for accessing customer api
I was able to get the admin token using the below url against the created admin user
http://username:[email protected]/index.php/rest/V1/integration/admin/token
The username and password is for ...
2
votes
1
answer
1k
views
What is the usage of itemId inside Update inventory REST API?
According to the swagger, the REST API PUT /V1/products/{productSku}/stockItems/{itemId} is used to update the product inventory.
However, for the attribute value itemId, I found no differences no ...
1
vote
1
answer
479
views
Magento2 customer register event for rest call
I am sending sms on customer registration using customer_register_success, fired in
app/code/Magento/Customer/Controller/Account/CreatePost.php
But as this is from controller, and not fired when ...
1
vote
1
answer
2k
views
Overwrite magento 2 default customer rest api
I use magento 2 rest /V1/customers/me it get response like this
{
"id": 2,
"group_id": 1,
"default_billing": "2",
"default_shipping": "2",
"created_at": "2018-03-30 07:53:13",
...
0
votes
1
answer
2k
views
Magento 2 REST API Add product to cart with custom option type file
I'm trying to add a product to cart using the REST API. I'm using a custom option to add an image, but it doesn't seem to work. This is my json object that I'm sending. The option 7819 which is text ...
0
votes
1
answer
556
views
shipment rest API not working in Magento 2
Endpoint
POST http://<host>/rest/default/V1/order/3/ship
where 3 is the order id.
Headers
Content-Type application/json
Authorization Bearer <administrator token>
Request Body:
{
"...
1
vote
0
answers
259
views
Magento 2 - Error with custom plugin when adding bundle product
My requirement is that certain kind of bundle products are not allowed to be added more than once in an order. I am trying to do so by intercepting the Add To Cart API method using a Plugin.
Here's ...
1
vote
0
answers
561
views
Magento 2.2 Creating Configurable Product With API
I want to create configurable product and its related simple products at the same time via API.
For example: shoes; with different sizes(attribute=shoesize).. as like:
Prada's new shoe (...
2
votes
0
answers
84
views
Adding custom options in to cart through API in magento2.1
I have custom options like 'booking_from' and 'booking_till' in my custom module, everything works in the backend is fine. But how can I add those options in a cart through REST API in magento2.1.7? ...
2
votes
0
answers
176
views
how to add cutom price via rest api - Magento 2
I'm following this answer to create guest order. I'm trying to add product to cart with my custom price, but the order will take the actual product price.
POST /V1/guest-carts/{cartId}/items
Rest ...
2
votes
0
answers
721
views
Add options to Visual Swatch by Rest API
Can options be entered into a Visual Swatch attribute by API Rest?
0
votes
1
answer
1k
views
Order creation not working through rest api in Magento 2.1
I am using Magento 2.1.6 CE and also am using default rest api's for create mobile app. In that I follow below steps to create an order, But order is not created.
Step 1:- Create an empty cart for ...
1
vote
0
answers
363
views
oauth_problem=Consumer+key+has+expired
Hello Magento Community,
I am trying to integrate the Magento Rest API in my App. But while doing the OAuth authentication for request token I am getting error as Consumer Key has Expired. I have ...
2
votes
4
answers
10k
views
Magento 2 REST API returns only default category and its children
I am using "rest/V1/categories/" (Magento 2 Rest API). In documentation(devdocs.magento.com/swagger/#) it says "Retrieve list of categories" but it only returns default category(and its all children) ...
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
3
answers
3k
views
magento 2 rest api accessing products based on store code giving same products
I'm using below url to access products which are specific to store
http://<magento_host>/rest/<store_code>/V1/products/product_name
but in output, i can see all other products as well. ...
0
votes
1
answer
942
views
pulling order IDs via REST API in magento 2.0
we are seeing a big dependency between the order ID that we are getting from Magento via REST and the order ID that we see in the order confirmation email. for example REST returns 45, the email has ...
2
votes
2
answers
6k
views
Adding regions in addresses other than US in Magento 2
We are running Magento 2.1.6.
We want to set predefined regions and areas as drop down lists in addresses, just like when you select country us, you have the states pre selected, etc..
For example, ...
1
vote
0
answers
195
views
Some SKUs not returning the product details through REST API using get / update method in Magento2.1.3
Am trying to update the product details from third party machine to magento 2.1.3 using REST API.
here some of the SKUs not returning the details while get/update and then i logged that SKUs and ...
2
votes
2
answers
3k
views
Magento 2 Rest API - how do I add values to dropdown product attribute
I have problems in adding values to an existing product attribute, using the API POST /products/attributes/:attribute_id/options.
The corresponding GET API is working fine, as explained below.
I have ...
5
votes
2
answers
5k
views
Getting value through javascript and REST api
The problem actually is defined in two steps:
1. How to define a REST Api which returns an array?
2. How to use that REST Api through javascript?
Description:
What I have done but not achieved ...
1
vote
1
answer
692
views
Magento2: creating custom search REST API
I have created many Api's (both GET and POST) but now I want to create the custom search API with different URL Structure (all the params after ?).
I can create the search API in below URL formate..
...
5
votes
5
answers
8k
views
magento 2 rest api : get cart items with images
In rest api, I am using "/rest/V1/guest-carts/e3e1fd447e0e315dd761942cf949ce5d/items" method to get the magento cart items. It works well and the result is
[
{
"item_id": 100,
"sku":...
2
votes
1
answer
4k
views
How to disable the customer frontend in Magento 2?
My app only uses the Magento 2 REST API and the admin backend. How can I disable the frontend the customer interacts with?
PS:
Seen this post, but it is an older one: Disable admin or frontend route
3
votes
2
answers
2k
views
How to use token base Rest API?
I have created custom module and also implemented API in that but I want to
know other two ways Auth base and Token base access.
My webapi.xml file:-
<?xml version="1.0"?>
<routes xmlns:xsi=...
2
votes
1
answer
864
views
Magento 2.1 : How can I save a shipping address using the REST V1 API
I'm trying to save just the shipping address using the REST V1 API of Magento 2. I know there is an endpoint to save the billing-address, but there seems to be lack of a way to save the shipping ...
4
votes
1
answer
5k
views
Swagger UI not working in Magento2: json schema not found
I'm trying to view the cool interactive Swagger UI on my own running Magento 2.1 instance.
When I go to https://example.com/swagger it shows the swagger header, but under it is an error message:
Can'...
2
votes
1
answer
3k
views
How to get same products from rest api as are visible on frontend?
We would like to use REST API for mobile application where should be the same products as we have on frontend.
There are this conditions (params)
website ID (or store ID) we have multisite
show ...
5
votes
1
answer
989
views
Magento2 REST auth help needed
I'm hanging on this issues for nearly a week and cannot find any sollution. I'm trying to send a REST request to my new Magento2 store. It worked allready, but then the oauth/token forced ...