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.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

Searching for customers by their company_id / Magento 2 B2B REST API

We are trying to search for all customers which belong to a specific Company via the REST API. When we get the customer JSON data, there is a field for the Company ID - company_id - so apparently the ...
0
votes
0answers
8 views

401 unauthorized on sign in after creating customer via REST API

I am having some issues with creating new customers using rest api in magento 2.4 First I sign in with admin and get the token to be used later. Than I register new account using ajax: type: "...
0
votes
0answers
17 views

Overriding function or replacing interface (core)

Magento beginner here. Currently, I am trying to send multiple options for a product attribute via REST API. Since Magento isn't capable of doing this I am trying to override the add function in ...
0
votes
0answers
14 views

How to get an admin token from REST API when 2FA is enabled and using U2F?

Magento 2.4.2-p2 Greetings, I'm interested in to get an admin token from the REST API when 2FA is enabled and as authentication provider U2F is used. I have a small application running on another ...
0
votes
2answers
29 views

Magento 2 REST API on add to cart "quoteId" is required. Enter and try again

When I try to add to card any item via REST API I get this error: "{"message":"\"%fieldName\" is required. Enter and try again.","parameters":{"...
0
votes
1answer
20 views

Not getting a Valid JSON Respon from magento2 custom API

I am trying to return the collection factory from database , it is giving an array now i convert it to json using JSON Encode function but it is returnig a string with backslashes !! Code for Api ...
0
votes
0answers
12 views

Razorpay payment Id missing for payment verification

RazorPay payment issue in REST API. For Paytm, Rest API is working fine. But for razorpay it is showing error. Showing error "message:Razorpay Error: Razorpay Error: Razorpay paymentId missing ...
0
votes
0answers
13 views

Magento 2 how to modify SKU in order rest api response

I have to edit the SKU with some other data. When I use this rest API below http://localhost.com/rest/V1/orders/1 I get SKU in two places like below. Place one at the first like below "items&...
0
votes
1answer
48 views

How to add new fields to M2.4.2 CMS REST API response?

How would I go about adding new custom fields I have created for CMS pages to M2.4.2 CMS REST API responses (and possibly even search/filtering)? For example, if I want to add new fields to retrieving ...
0
votes
1answer
14 views

Magento DOM error XML

I got some errors when I setup:upgrade my file in Magento 2. this is the error : Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/cloudpanel/htdocs/swift/vendor/magento/...
0
votes
1answer
25 views

Unable to Save Configurable Product Options using API

I am using Magento's API to add the Configurable Product Options but I don't see them in Configurable product data. EndPoint Used to add the Configurable Product Options https://example.com/rest/...
0
votes
1answer
37 views

How To Override Extension Attributes/configurable_item_options In Orders Rest API

I am trying to override the "configurable_item_options" of the product_options under the orders API. I want to add a further column between the option_id and option_value. I can see that ...
0
votes
1answer
35 views

Magento 2 Rest API get admin token

I am working on Rest API. I faced problems with the admin token. We are using an admin token with admin user name and password and then generated token use for admin-related API access. Can you please ...
0
votes
0answers
37 views

How to Complete the Customer Order in Magento 2 REST API with Razorpay Payment Method?

How to save the customer order in Magento 2 using Razorpay payment option, Please guide me, how to complete this order with the Razorpay payment method for the android application. Description: I have ...
1
vote
0answers
24 views

Magento 2 Bulk API Response - serialized_data is Null?

Wednesday I began working on an interface for a local application to manage product categorization rather than the Magento console. The documentaiton instructs you to pack multiple request bodies into ...
0
votes
0answers
15 views

How to Save Custom Attribute value While Customer Login through REST API

I have created a custom attribute that is device_token and i want to take some value while customer login like in the below image. So what is the correct way to save that value in Magento 2 customer ...
0
votes
0answers
6 views

Salesforce + Magento Best Plugin

We're a luxury wholesale company who work with leading fashion retailers and are currently looking to integrate Magento and Salesforce. A two-way sync for creating new accounts/leads/editing customer ...
0
votes
0answers
14 views

Class Magento\\Eav\\Model\\Attribute\\Data\\Email does not exist error comes when trying to create a customer using API Magento 2.4.2

The below JSON only I requested in V1/customers API but I am getting the error while trying to create the customer { "customer": { "email": "test@gmail.com", &...
0
votes
0answers
12 views

How to add custom customer attribute in Magento 2 REST API

I am adding a new attribute for the customer login in Magento 2, What is the correct way to add that custom attribute as a payload for customer login in REST API.
0
votes
0answers
15 views

REST API - using not extanceable model

I'm trying to add 'getter' and 'setter' for my custom option value attribute, but '\Magento\Catalog\Model\Product\Option\Value' is not extanceable model. I overrided the following method '\Magento\...
0
votes
0answers
18 views

Searching for Products via searchCriteria endpoints (rest/V1/products?searchCriteria) is obscured, but via SKU (rest/V1/products/SKU) is not obscured?

When I try to ping for all products via a simple searchCriteria (rest/V1/products?searchCriteria[pageSize]=1), the total_count is a fraction of the full number of items in our catalog. Or when I ...
0
votes
1answer
23 views

How do I add Custom Rest API Swagger as per Magento documentation? in Magento 2.3.4

Can anyone please suggest how to add custom Rest API to Swagger documentation in Magento 2.3.4?
1
vote
1answer
30 views

How to manipulate the response when using Web APIs

I wonder, with Magento 2, when writing REST web APIs, how would one change the response sent to the client in terms of status code, headers and cookies? I ask this because in all sample code I've seen,...
0
votes
0answers
10 views

Extend Customer API Functionality

I am trying to extend the customer API functionality, so that as well as being able to get a customer by default using the ID using: http://c4u.local/rest/V1/customers/1 I can also get it by a custom ...
0
votes
0answers
13 views

Status of Bulk Enpoints not updating

I'm using Bulk endpoints to upload product data. Last week, I uploaded 18,000 products, but when I get the status of the bulk operation, it says there' still open items. RabbitMQ doesn't have these, ...
0
votes
0answers
15 views

Extending product API response?

When loading a product's data in the API via https://example.org/index.php/rest/default/V1/products/:sku, I need to make some changes to the returned data. For example, I'd like to rename the existing ...
0
votes
0answers
11 views

Magento2 How can we add bundle option price in product options in Order REST API

I need to add the bundle option price to the list of bundle options data. I need to add this in the Orders REST API After options_qty in the below screenshot
0
votes
2answers
32 views

Do a action before insert products by endpoint magento 2

I wanna make a verification before inserting products on my Magento 2.3 in the default endpoint. Here is a sample: I post a product on rest/default/V1/products endpoint, but I want to check if this ...
1
vote
0answers
70 views

The requested sku is not assigned to given stock...except it is

Let me start by saying I'm completely new to Magento. I also hate Magento with the burning passion of 1000 suns. So if I've misunderstood something, please bear with me. I'm using Magento 2's "...
0
votes
0answers
9 views

Importing HTML code via the the API

Bit of background: I'm using the API to move data from our core database that holds stock information. The DB also holds information for our current site. There is a field that holds the description ...
0
votes
0answers
8 views

Retrieve stock updates from default Magento API

We are looking for a way to get the stock from Magento (2.3/2.4) and sync it to an external application (and keep it up-to-date). Is there a way to do this with the default API, so without the ...
0
votes
1answer
33 views

Magento 2 Order API, updating order status

I'm trying to update the order status via the orders/{id}/comments API. I'm doing it via Python for now and I keep getting an error. putURL = "https://myStore.com/index.php/rest/V1/orders/286660/...
0
votes
0answers
14 views

Getting stockItem before change not working on production server

I need to observe API's changes on stockItems from other sources coming to my store, although the below code is working on my local server, the old stock qty is always 0 on the production server. ...
0
votes
0answers
23 views

Magento 2 : How to Fetch Particular Product Category Name via API

I want to access specified product category information using API.
0
votes
0answers
27 views

Search criteria SortOrders using extension_attributes in API Magento 2

I am using Magento 2 Rest API I made a call and I am trying to set the search criteria SortOrder using the "extension_attributes" value. I am trying to sort by "extension_attributes&...
0
votes
1answer
20 views

Magento Purchase Order Endpoint

I'm searching for Purchase Order endpoint in Magento 2 rest API here https://devdocs.magento.com/redoc/2.2/. it seems that it's not available. There's an order endpoint but I believe it's for the ...
0
votes
1answer
27 views

Bearer token is missing in my postman

I am using Postman to test all Magento API. In one machine I was unable to find the Authentication Type: Bearer
0
votes
0answers
36 views

Add product attribute to items node in magento order api

I have Magento 2.3.5-p1 Magento 2 API orders are not returning product attributes in items. I have to add the custom product attributes "scaffale" in the Orders API result This attribute is ...
0
votes
0answers
11 views

Getting 400 bad request with GuzzleHTTP when trying to POST new product

I'm trying to use the /product endpoint but keep getting `400 Bad Request` response: {"message":"\"%fieldName\" is required. Enter and try again.","parameters":{...
0
votes
3answers
43 views

How to get GuestCartId using rest API?

I'm trying to fetch the estimated shipping method, but I can't find it. How can I get this element for the API code? Api Url {{Base API URL}}/guest-carts/{{GuestCartId}}/estimate-shipping-methods
0
votes
0answers
14 views

how to make rest api consumption using ajax?

I'm trying to get the checkout sending methods on another page in magento 2, and I saw that it would be possible to do it using magento 2 api consumption. However, magento 2 documentation is very bad, ...
0
votes
0answers
29 views

Magento2: Add Dynamic Custom option on add to cart using rest api

Hope you all are doing good!!! I am not creating any custom option for products but need to add custom options to any simple products while adding to cart with rest api so can you please assist me how ...
0
votes
0answers
14 views

Overriding Coupon Code REST API

I would like to send an extra Header argument in the PUT V1/carts/:cartId/coupons/:couponId that is utilized by the REST API (that handles that PUT request). To do this, I would like to override that ...
0
votes
1answer
33 views

How to create multiple product using magento API

How to create/import multiple products via Magento API. I have created a single product using the following API http://127.0.0.1/magento240/rest/V1/products
0
votes
0answers
48 views

Magento 2 API - Adding media gallery video url to product in doesn't save video attributes

I'm trying to add a video-url to a product using the Api, but it doesn't save the url on the video object or any of the related values like video description, metadata etc., though it saves the image/...
0
votes
0answers
15 views

How to manage customer token lifetime for mobile application [REST API ENDPOINT]

I make Magento mobile application I don't know How to manage customer token lifetime. I create a customer token for customer login, The token has a lifetime of 4hr /rest/default/V1/integration/...
2
votes
0answers
100 views

What is protect code used for?

We're working on a project where we're replacing our existing web store with a custom Magento integration. We need a way for a guest customer to retrieve information about their order by following a ...
2
votes
0answers
23 views

Magento 2: Create Invoice or Shipment with REST API with different date

I want to post a shipment and/or invoice into Magento 2 but put a different date than today's date using the HTTP Rest API. Is this possible and how would I accomplish this? When I include the ...
0
votes
0answers
50 views

Magento 2 : REST API for Social Login(Google and Facebook)

I want to create a customer account using social networks via the API. I have used Mageplaza Social Extension for social login. This example not working for me Magento 2 : Social Login via Rest Api
1
vote
1answer
29 views

Preserve the array keys while sending data in json format to custom api endpoint magento2

I hace created a custom api endpoint to receive data from a third party service. These are my modules files etc/webapi.xml <?xml version="1.0" ?> <routes xmlns:xsi="http://www....

1
2 3 4 5
21