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,835
questions
1
vote
2
answers
3k
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,
"...
3
votes
5
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-...
4
votes
3
answers
3k
views
Sign out REST API Magento 2
Is there is a built in REST API for sign out in Magento because I looked in the reference and couldn't find?
8
votes
1
answer
2k
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
2
answers
4k
views
Magento 2 REST API delete all products
I want to delete all product using Rest API in Magento 2.
4
votes
2
answers
3k
views
Magento 2: Override for product custom option value Interface and model file
I have added custom product option value to below interface ProductCustomOptionValuesInterface.php and Value.php model file.
File path: magento2/vendor/magento/module-catalog/Api/Data/...
5
votes
2
answers
4k
views
Retrieve all available shipping methods/carriers via REST
We're looking for a way to generate a list of all available shipping method codes and shipping carrier codes via REST API. I'm only seeing this available via the cart but I'd like to be able to ...
1
vote
1
answer
6k
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 ...
0
votes
2
answers
4k
views
Need Help To Connect Magento Rest Api using curl
I would like to use cURL to get all orders using rest API. Can I use cURL instead of Oath.
I tried with cURL but returns 403 Forbidden.
I have tried with below code :
$params = array(
"...
0
votes
1
answer
2k
views
Magento 2: How to run CLI command on admin store (storeId:0)?
I have a multi-store setup with Magento 2.1.7 CE on the domain a, domain b, domain c. I want to apply images to some products programmatically. When I make an API call on any domain with the "all" ...
0
votes
1
answer
22
views
Shipment comment
I am trying to update a comment for an existing shipment, but I keep getting err mssg:
{"message": "Could not save the shipment comment."}
API and example I'm using are :
Method:...
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": "...
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
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
3
answers
9k
views
How to expose a custom field from sales_order table to rest api?
I have a custom field delivery_type in sales_order table. I am accessing order using rest api but this field is not present in response.
Requested api: http://localhost/default/rest/default/V1/orders/...
0
votes
1
answer
31
views
When creating an order via api, the salable quantity does not decrease
I am using the API /rest/V1/orders/create, but when creating an order, the saleable quantity does not decrease. (Magento ver. 2.4.6-p3 community edition)
I am using this payload:
{
"...
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 ...
3
votes
1
answer
1k
views
magento 2 : Place order using REST API and stripe payment method
We are working on mobile which use magento 2 REST API. In which we are facing issue while try to place order using Stripe payment method. For stripe we are using magenest stripe extension.
REST API ...
0
votes
2
answers
1k
views
How to get coupon times used with coupon code using REST Api?
I have no experience with Magento. I was asigned the task to validate a coupon code via magento rest api. I've tried to use /V1/coupons/search GET method. My request url is:
https://example.com/...
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://...
0
votes
1
answer
1k
views
Filter orders using Product Id in Magento 2 Order rest API
I am using this API "http://localhost/test/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=product_id&searchCriteria[filter_groups][0][filters][0][value]=24"
to filter orders by ...
2
votes
4
answers
1k
views
Access Token Expiration settings have no effect
I tried to change the default customer access token expiration from 1 hour to 48 hours and even to 0 to disable expiration, but regardless of what number I enter, the token I receive from the REST API ...
6
votes
3
answers
4k
views
How to Get Customer data by telephone number in Magento2?
I have a telephone number which is given in Default address..by using this telephone number i need to get Customer Full data.Data like customer id, customer full name..etc
2
votes
1
answer
3k
views
How to get all products with pagination using REST API in Magento 2?
Is it possible to get all products with pagination using REST API in Magento 2?
I'm using REST API Get all product with pagination. E.g. in first page show 20 products, second page 20 products, etc...
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 ...
0
votes
2
answers
1k
views
How to add Customer Address Attribute to order API rest/V1/orders - Magento 2
I want to add Custom Address Attribute field in order api,
The field data is saved in sales_order_address table, but it dosen't show in order api
Anyone have idea how to add it to order api?
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
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
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
1
answer
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/...
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 Rest Get Orders C#
I am using C # to search for orders from last month (last 30 days). Magento version 2 using REST, I am using the call as follows:
http://magentoserver/index.php/rest/V1/orders?searchCriteria[...
4
votes
2
answers
2k
views
How to get pdf file in response for Magento 2 rest api?
Currently Magento 2 is providing JSON and XML response in web REST API
I want to include a custom response format PDF.
So if any third-party will call our API then we can sen them PDF in response.
0
votes
0
answers
16
views
Api\SearchCriteriaInterface returning products in anchor categories (or not)
Using a module for a mobile app and this code is retrieving search results. However it's completely ignoring anchor categories and I've spend most of the afternoon trying to figure out why not. There'...
2
votes
2
answers
2k
views
Magento 2 - Set Tracking Info for Order via REST API without specifying items?
Is it possible to add in shipping and tracking information for an order using the Magento 2 REST API without putting in the item information. We always ship the entire order and based on our warehouse ...
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 ...
0
votes
2
answers
3k
views
PUT request on Magento 2 REST API through Postman
I'm trying a PUT on Magento 2 REST API through Postman like this:
https://domain/rest/V1/products/IP_X
With only a price change on the JSON content.
I'm getting the following error message:
{
&...
0
votes
0
answers
18
views
CMS module don't have the getExtensionAttriubtes and setExtensionattributes
I am working on REST API for the cms block and adding some custom fields in the cms_block table. However, I didn't see the methods getExtensionAttriubtes and setExtensionAttriubtes in the CMS Block ...
0
votes
2
answers
8k
views
How to add media gallery entries via REST API - Magento 2
I stored image in pub/media/catalog/product. How to add that images into media gallery entries.
I have tried like http://myhost/rest/V1/products
"media_gallery_entries"=> array(
array(
...
2
votes
3
answers
8k
views
Magento 2 Rest API using basic Auth
I have created a custom admin user and gave access rights to access all the magento modules.
Now when i hit the url to get product info by passing sku in url from postman.
http://local.m2.com/rest/...
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:/...
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 ...
6
votes
1
answer
3k
views
Magento 2 REST api for guest cart - display product in Magento's checkout
I have an Ember app that handles adding to basket via the REST API. I then want to jump back into Magento's front end for the checkout process, however the cart is empty. Is there a way to pass a ...
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 ...
0
votes
0
answers
15
views
Get salable quantities for all products via REST API
For synchronizing inventory levels with the external ERP, I need to know the quantities and booked quantities of all products. I can easily get quantities of all products with one request (rest/all/V1/...
0
votes
0
answers
6
views
Get salable quantities for all products via REST API
For synchronizing inventory levels with the external ERP, I need to know the quantities and booked quantities of all products. I can easily get quantities of all products with one request (rest/all/V1/...
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 ...
2
votes
1
answer
1k
views
Magento 2 REST API: Get the name of child products in bundle_product_options-> product_links
So I am trying to go for a headless magento approach.
I am using the following API to get product details:
V1/products/:sku
If the product is a bundle product, it shows bundle_product_options in ...
5
votes
1
answer
3k
views
Display Out of Stock Configuration not working in magento1.9
I have a configurable product with 3 simple products associated to it that were added via REST.
I have set the "Display Out of Stock Products" option in System->Configuration->Inventory to "Yes"
...
1
vote
1
answer
52
views
The consumer isn't authorized to access %resources. Magento 2.4.5-p1 on staging environment
In the testing environment, it gives below errors,
{
"message": "The consumer isn't authorized to access %resources.",
"parameters": {
"resources&...