Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
0answers
6 views

Magento 2 : Add Params using add to cart API

I want to add a custom parameter in add to cart product api billing_period & subscription_start_date. I have tried with Magento's /V1/carts/mine/items API with below request data. { "cartItem"...
3
votes
0answers
13 views

POST product with REST API doesn't save manufacturer attribute

I'm able to save a product with a POST request to my REST API endpoint. Now I would like to save manufacture attribute,too. I prepare this json structure { "product": { "sku": "code", ...
0
votes
1answer
16 views

Question about shipper carrier codes for orders

I am writing integration code to connect Magento to our ERP system. I need to pass the shipping carrier code to our ERP order creation but the code in the order does not match our internal carrier ...
0
votes
0answers
12 views

Are magento 2 extensions required to have rest endpoints?

Do the extensions have to have a REST API or not? For example, webkul seems to be selling their rest api for the multivendor plugin apart. Is there a plugin which auto generates rest endpoints for ...
0
votes
0answers
5 views

How to implement wallet management for android APP using magento2 rest api

I need to implement wallet system in mobile app using magento2. There are 2 functionalities I need to implement which are given below. 1- Get customer wallet money. 2- Use of wallet money while ...
1
vote
0answers
10 views

REST API - suddenly returning 401 error

Starting this morning, we began receiving a 401 error when sending a request. Nothing we know has changed on our end { "message": "Consumer is not authorized to access %resources", "parameters": {...
0
votes
1answer
17 views

What to replace deprecated Class 'Zend_Rest_Client' with in Magento 2.3?

A module I'm maintaining is not working on Magento 2.3 since Magento apparently deprecated Class 'Zend_Rest_Client' . I don't see any replacement Client listed in their documentation, so I'm a bit ...
0
votes
0answers
20 views

Api /V1/guest-carts/:cartId/items always return excluding tax

I use Magento 2.3 EE only with guest-cart api. And I want the endpoint POST: /V1/guest-carts/:cartId/items to return the price including taxes. In the following screenshot, you can see the ...
0
votes
0answers
13 views

When creating products with POST, images Roles are not enabled (base/small/thumb/swatch), even after a following PUT

When I add a product via the Magento 2 API and then add an image, the image is added and shows up under the "Images and Videos" tab, associated with the correct product. However, none of the Image ...
1
vote
1answer
19 views

Payment information API returns 400 error

Link http://protectcovers.ga/rest/store_view_eu/V1/guest-carts/ddukH6HL2TlFsm9WkJmOkMDSqmkiUfbW/payment-information I tried to send the next json: { "cartId": "ddukH6HL2TlFsm9WkJmOkMDSqmkiUfbW", ...
0
votes
0answers
13 views

Magento2 REST API how to create an invoice and keep order state as open or unpaid?

I am able to use Magento2's REST API to programmatically create an invoice. When I create the invoice, the API also seems to change the associated order to state paid by default. However, my workflow ...
0
votes
1answer
20 views

Magento 2.3.1 - Payment methods api

I have a payment module for Magento 2.2 for one Croatian online payment provider, i tried it to install on Magento 2.3.1 and everything is fine but when i want to go on Checkout it says https://www....
1
vote
1answer
20 views

Magento 2 MSI - How to listen the event of all source item stock update API

Am using the below rest API to update bulk product's Stock information /rest/all/V1/inventory/source-items My requirement is that I need to listen the observer or some file whenever this API is ...
0
votes
0answers
20 views

Custom rest API for magento 2 contact form with react venia storefront

I'm currently setting up a contact form in venia storefront and trying to get it to link to my rest api in magento 2. On button click the forms linking to the actions file and then throwing a not ...
1
vote
0answers
38 views

How to get the an order through rest api?

Get the an order through rest api Here is the script i tried <?php $userData = array("username" => "admin", "password" => "Abcd1234"); $ch = curl_init("http://example.com/index....
1
vote
0answers
15 views

Why quantity_and_stock_status is always 1 in /V1/products?searchCriteria in Magento-2.2.7?

I am using Magento-2.2.7 . If i call this endpoint /V1/products?searchCriteria , it always show each product having same quantity_and_stock_status . Whenever product is in_stock or out_of_stock it ...
2
votes
0answers
21 views

Magento 2 REST API: Show In-stock products first in product listing API

I am looking into a headless magento approach. I am using the following API to list the products in a given category: V1/products?searchCriteria[filter_groups][0][filters][0][field]=category_id&...
2
votes
1answer
36 views

Magento 2 - Get multi-store addresses REST API

I need to fetch the stores addresses using REST API. We already have storeConfigs but this doesn't return the addresses. GET /V1/store/storeConfigs How can we get the address mentioned in the ...
1
vote
0answers
12 views

Problems with newsletter2go Magento 1 extension

we have a problem connecting the newsletter2go extension for Magento 1 properly to our shop. connecting to the n2go service from within the magento admin backend worked. But when goin to the ...
4
votes
0answers
27 views

Reduce time in API product update in Magento 2

I have created an API to update Product Price, Product Cost, and Tier prices. The issue is the API response timing in around 7 to 8 secs every time for a single product update. How can I reduce this? ...
1
vote
1answer
24 views

Magento 2 REST API: extension attribute for saleability not working for some products

I needed product's stock status in the product listing API: V1/products?searchCriteria[filter_groups][0][filters][0][field]=category_id&searchCriteria[filter_groups][0][filters][0][value]=144 ...
1
vote
1answer
26 views

Magento 2.2.2 error when setting order status with API

I am trying to set the order status of orders to "Complete" using the API. I am running Magento Enterprise 2.2.2. Am I missing something in the data? This is the url I am calling https://localhost/...
1
vote
0answers
16 views

Magento2 change Category-Product position to string

I would like to change the category-product position to be a string. Because I have an exploded view for spare parts and they are numbered with strings (1a, 1c, 605,...). The customer should see the ...
1
vote
0answers
35 views

Magento 2 Rest Api - Is this searchCriteria filter correct?

I'm trying to retrieve virtual products, which have been modified before a certain date and which still are in stock I'm using this /rest/V1/products?searchCriteria[filter_groups][0][filters][0]...
0
votes
1answer
17 views

As capture the token that came through the head and send it to a function that I created myself?

I'm trying to customize the Magento API Engine 2. I would like to know if there is any time of the request, before arriving at webapi.xml to capture the token that came through the head and send it to ...
1
vote
0answers
30 views

How to get custom session in rest api calls?

I have created a custom session and it's storage with custom namespace. I have set some data in storage which I am trying to fetch in my api calls but not getting any data in session. I do get the ...
0
votes
0answers
24 views

How to use magento 2 rest api in react js

I am learning react js with magento. I want to use magento rest api in my react js app how can i do that ?
3
votes
1answer
36 views

Retrive Configuration data via API

Is Magento giving any default REST API for retrieving configuration (system.xml) data ?. If yes then share URL. Else share the best approach for retrieving configuration data via REST API.
2
votes
0answers
29 views

Magento 2 REST API: Empty cart or delete multiple items from the cart

I am working on a headless magento solution, but I am facing a bit of a problem. As the official magento 2 docs suggest, cart items can be deleted using these: DELETE /V1/guest-carts/:cartId/...
0
votes
0answers
65 views

Magento 2 REST API copy image from another SKU

I am trying to use an existing image from one SKU and add it to another SKU. For example: SKU0 -> Image uploaded via Admin SKU1 -> Copy image details from SKU0 to SKU1 via API I've tried using ...
0
votes
1answer
35 views

404 error while updating Product inventory by rest API Magento 2.3.1

I am trying to integrate Magento 2.3.1 with Linnworks, All the api calls are working fine expect the CatalogInventory. When we try to update the product inventory using rest PUT https://sitename.com/...
0
votes
0answers
30 views

Restrict access to Customer API Magento 2

My website is getting 300+ spam users for a day, On checking it seems to be from Customer API which Magento provides. How can I stop this users, Is there any way that I can restrict the customer ...
0
votes
0answers
12 views

In Magento 2, using rest api, is there any method that can provide all possible url_keys (in all languages) of a product?

Magento allows a user to select a language of preference. However, by selecting non-default language of preference, the url_key for all (or few) also products change. I am able to retrieve the base ...
2
votes
1answer
285 views

Magento 2.3 - Updating a customer without store_id sets the store_id to default using REST

There are multiple store views in my site. I created a customer and set his store view to some value that is not the default. Use the rest api to change the first name of the customer (Like: put to ...
2
votes
1answer
29 views

Is it possible to add custom data in magento 2 rest API?

I am using rest/all/V1/products/:SKU API for fetching product details. Now issue I am facing is that i wanted to add one custom data in this API response. I wanted to append "SellerID" custom data ...
0
votes
1answer
24 views

Magento 2 Custom API: Need to create an API which gets the data from a table in database

I have a magento store for which I was using the Magestore Bannerslider module to show a simple carousel on the homepage. But now I am experimenting with a headless approach, and there's no API to ...
1
vote
0answers
17 views

Magento2 How to add custom attribute to billing information of order rest api response

I want to add a custom attribute to the billing information section of order rest API response instead of showing in extension attribute section. please anyone can help me in this. Thanks in advance
0
votes
0answers
27 views

How to create order for bundle product with rest api Magento2?

How to create order for bundle product with rest api Magento2 ? I create an order using Rest Api for a simple product, but for a bundle product it does not work, any example can help me, thanks. ...
1
vote
1answer
55 views

Magento 2 REST API: Get list and details of all active coupons

Is there an API to get the list of all active coupon codes from magento 2? /V1/coupons/search this shows me all the coupons, but it doesn't give any information about if the coupon is active or it'...
1
vote
0answers
15 views

The .NET NuGet Package `Magento.NetCore` Has No Sample Code - How to use it?

I want to use C# to call against the Magento 2 REST API. The NuGet package Magento.NetCore seems like it might be a fairly complete C# library, but there is no sample code. Even just to create a ...
1
vote
3answers
37 views

Magento 2 REST API: Create an API to fetch recently viewed products

I need to create an API for fetching all the recently viewed products. Any suggestions on how to do it?
2
votes
0answers
23 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 ...
0
votes
2answers
58 views

How to connect two Magento2 instance by API?

I want to create one one product from backend then it should be automatically created into second M2
1
vote
3answers
30 views

How to create module for Rest Api , Magento2 [closed]

Who can help, how to create a structure in the custom module for Rest Api ?
0
votes
0answers
13 views

how to get purchased product in magento 2 with rest api

My question is how to I can get products that have been purchased with rest API in Magento? I try this rest API rest/V1/invoicesByEmail but I can't get any data. Has the API been replaced?
1
vote
1answer
23 views

Disabling payment method for frontend, but not API

I'm trying to only allow the "checkmo" payment method to be used when an order is placed through the API, but not available for a customer on the frontend to choose. Ive tried creating a plugin that ...
1
vote
1answer
28 views

Escape initial percentage on Product Search Criteria REST API

I'm running the following request to search products by SKU using the Magento 2 REST API: curl -X GET "http://localhost/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=sku&...
1
vote
0answers
16 views

update stripe information into magento 2.3 orders using rest api

I am creating an order using rest API in Magento 2.3, Order created using cash on delivery payment method. In my scenario need to create an order using stripe payment gateway method. Cash on ...
0
votes
0answers
14 views

requested product doesn't exist rest api

I'm creating rest api to add product to cart, it works okay for some users and doesn't for others. what is reason for that? here is the code: $customer = null; $isGuest = true; $quote = ...
0
votes
0answers
29 views

custom_attributes not returning from Magento 2 REST API

Using the Magento 2 REST API, I was able to successfully create a new product attribute sending a PUT request to V1/products/attributes/{attribute_code}. In the request, I added a value in the ...