As of May 31, 2023, we have updated our Code of Conduct.

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
1 answer
256 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&...
Ramesh KR's user avatar
  • 826
0 votes
1 answer
199 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 ...
drgandynt's user avatar
0 votes
1 answer
149 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/...
Jackie Chandra's user avatar
1 vote
1 answer
389 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/...
PRABHAT MISHRA's user avatar
0 votes
1 answer
217 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 ...
theSeeker's user avatar
  • 429
0 votes
1 answer
458 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 ...
Joy's user avatar
  • 15
2 votes
0 answers
130 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 ...
That1Guy's user avatar
  • 121
1 vote
1 answer
285 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?
Shubhanshu's user avatar
1 vote
1 answer
47 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,...
Paulo Phagula's user avatar
0 votes
0 answers
46 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 ...
Louis B.'s user avatar
  • 1,082
0 votes
1 answer
94 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
Arjun's user avatar
  • 3,504
0 votes
2 answers
48 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 ...
Raphael Cordeiro's user avatar
1 vote
0 answers
579 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 "...
GodIHateMagento's user avatar
0 votes
1 answer
303 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/...
Raymond Luna's user avatar
0 votes
0 answers
47 views

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

I want to access specified product category information using API.
Namita's user avatar
  • 1
0 votes
1 answer
154 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 ...
enrico domingo's user avatar
0 votes
2 answers
807 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 ...
Jonas Høft's user avatar
0 votes
1 answer
148 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
Pratik Kamani's user avatar
0 votes
1 answer
385 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":{...
Dave Hon's user avatar
0 votes
3 answers
63 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
lucas's user avatar
  • 197
0 votes
1 answer
404 views

Magento2.3.4 different hours in REST API call GET Orders and the real order hour timezone

I have selected Timezone (Configuration->General->Locale Options) Central European Standard Time (Europe/Warsaw) Order 10004 has been created at: Sep 21, 2021, 5:59:34 PM When I send API ...
maya5510's user avatar
0 votes
1 answer
431 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
user100396's user avatar
3 votes
0 answers
362 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 ...
Daniel Perván's user avatar
2 votes
1 answer
82 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 ...
MrPeanutbutter's user avatar
0 votes
1 answer
35 views

Magento2 Order Number different in REST API orders

I've changed my order number to 2000. INSERT INTO magento.sequence_order_1 (sequence_value) VALUES ('2000'); Then change lenght of order number <?xml version="1.0"?> <config xmlns:...
maya5510's user avatar
1 vote
1 answer
177 views

How to do online refund using REST

Accoring to Magento documentation, endpoint for online refund is: POST /V1/invoice/<invoice_ID>/refund So to my understanding, the following call should make an online refund: curl --...
Tero Lahtinen's user avatar
1 vote
1 answer
644 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....
Rajeev Singh's user avatar
2 votes
1 answer
666 views

How to send token for an API request along with custom post data

I have created a custom API endpoint and I have defined ACL for it. My API is working fine without ACL and I am able to post the data through API. But after defining the ACL now I need to receive the ...
Rajeev Singh's user avatar
1 vote
0 answers
77 views

Get json response through custom api endpoint

I am creating a custom api endpoint to receive some data in json format. This is my module's code webapi.xml <?xml version="1.0" ?> <routes xmlns:xsi="http://www.w3.org/2001/...
Rajeev Singh's user avatar
1 vote
0 answers
422 views

Getting an error while trying to create an order using Rest API magento 2

I am trying to create an order using REST API in magento 2. This is the link that I am following for the process https://github.com/acolono/php-magento-api-sandbox I have created the files on my ...
Rajeev Singh's user avatar
1 vote
0 answers
250 views

Magento 2 Add/Remove Extra info in API(carts/mine/items/) payload

I'm trying to add product via API call https://testdomain.com/rest/V1/carts/mine/items/ my payload is { "cartItem": { "sku": "444375", "qty": 1, &...
Ghulam.M's user avatar
  • 923
0 votes
1 answer
49 views

While overriding customer createaccount() apis iam getting below errors magento2 rest api

I have Overrrided the v1/customers rest api and added in my custom module the method CreateAccount() in my model file and the file is working fine when checking postman But while creating a customer ...
dev456's user avatar
  • 1
0 votes
1 answer
227 views

override customer registration rest api in magento2 and block the domains of a specific emails like @163.com

Can any one help me to override the customer registration api and restrict the @163.com emails while registering magento2 rest api Help me great. Thanks
dev456's user avatar
  • 1
0 votes
1 answer
473 views

Why my module API communication is blocked by my Magento 2.4?

My ERP module connects via API and sends 1k of the product's data when there are changes from my ERP side. In the logs, I just see the message below and my stock hasn't been updated. Web API is unable ...
Rafael Corrêa Gomes's user avatar
0 votes
1 answer
2k views

Call to undefined method Magento\Sales\Api\Data\OrderItemExtension

Error: Call to undefined method Magento\Sales\Api\Data\OrderItemExtension::setGuid() di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&...
HuanTH's user avatar
  • 115
0 votes
1 answer
141 views

Magento API to use to integrate ERP System

An ERP company asks you for recommendations which Magento API to use to integrate a client It is expected that at times large amount of product and category changes will need to be pushed from the ERP ...
Ibsam Bin Shahzad's user avatar
0 votes
1 answer
131 views

Magento2: Get Category list by using admin Authentication Token?

I want to get Category list by authorization bearer key by helper function. I have created custom api module and created helper Data.php and created function for getting generated bearer key. public ...
Ravi Varma's user avatar
1 vote
3 answers
1k views

Magento 2.4.2 rest api issue with get current customer details using customer token

I am using latest magento version 2.4.2 I have created customer token using postman eg. https://<magento.host>/rest/V1/integration/customer/token sending in body { "username" : "...
Chander Shekhar's user avatar
1 vote
0 answers
326 views

Magento 2 Customer API Token refresh

I am developing an APP based on magento 2 ecommerce. As any APP, the user should never logged out. I can get with magento 2 a token for any customer by that token have an expery time. I know that I ...
martin's user avatar
  • 39
1 vote
0 answers
262 views

How to upload image/file using custom customer attribute with Rest API Magento 2?

I have create one custom customer attribute with file type. I want to upload file using rest API and want to store it to custom media path. How to upload file is with customer registration API?
Rutvee Sojitra's user avatar
0 votes
0 answers
125 views

Magento 2 - How to upload image and some post data to REST API (POST)

I'm working with a Magento 2 project that need to upload image and post data using a POST endpoint How can I send image with post array data.If post request sample available then share. Thank you very ...
Vikas kalal's user avatar
  • 1,132
0 votes
2 answers
1k views

magento 2 error - "Fatal Error: 'Uncaught Error: Cannot instantiate interface

I have a custom module to expose an API to get the best selling products & most viewed products separately. This module is working fine in my localhost and staging server. When i moved the same ...
Mujahidh's user avatar
  • 2,651
0 votes
1 answer
503 views

Magento 2: How to get Token via Rest API?

Magento 2: I want to get admin or customer token via Rest API. Early I used: End point POST / rest / <store_code> / V1 / integration / admin(or customer) / token Headings Content-Type / json app ...
Ihor Radzyil's user avatar
0 votes
0 answers
70 views

Can I use a PUT request when required fields aren't filled in?

I'm trying to run about 10,000 put requests to update pricing via the API. A lot of the products have fields that are required, but aren't filled in. Everything works when I update the pricing with a ...
web master's user avatar
0 votes
1 answer
4k views

Magento 2: How to get Admin Token via Rest API in Postman?

Magento 2: I want to get admin token via Rest API. Early I used: End point POST / rest / <store_code> / V1 / integration / admin / token Headings Content-Type / json app Payload { "...
Ihor Radzyil's user avatar
0 votes
1 answer
69 views

How to add only one product using Magento 2 REST API?

I am using REST API for Magento 2. I want to add 1 product only in Cart using REST API. Like if cart is empty one product is added is cart and if one product is in cart then remove that existing ...
Prits's user avatar
  • 626
0 votes
1 answer
154 views

magento 1.9, "Resource 'custom_restapi' not found"

i am trying to create a custom REST API i use this guide https://inchoo.net/magento/configure-magento-rest-and-oauth-settings/ api2.xml file <?xml version="1.0"?> <config> &...
Denys Maksiura's user avatar
0 votes
0 answers
179 views

How to implement Custom online shipping method with shipping API?

I have created one shipping module.I need to integrate flash express API's in that. How to integrate the APIs?
Sonali Ghule's user avatar
0 votes
1 answer
437 views

Magento 2 REST API bulk update product attributes

I am trying to update an attribute for about a thousand products using REST API. I'm using async/bulk/V1/products/bySku. It works perfectly, but it takes forever as it saves one product at a time. ...
krybbio's user avatar
  • 1,258
0 votes
1 answer
86 views

Magento 2 RestAPI shows wrong stockid

I ran the Magento Rest API to get the stock id for a particular product but it's showing me the wrong stock id. We have three websites and each website has a separate stock, but when we call Magento ...
Ashish Nair's user avatar

1 2 3
4
5
37