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
17 views

Not able to upload category image in magento 2 rest api

How to upload image for category through magento 2 rest api. below is my code but image is not getting uploaded. <?php $categoryUrl=$url."rest/V1/categories"; $CI = "/var/www/html/pradeep/apistest/...
0
votes
1answer
32 views

Magento 2 Get all Orders sort by latest orders

I am using the below Rest api to fetch all orders in desc i.e the latest on top but its not working index.php/rest/V1/orders?searchCriteria=all&searchCriteria[sortOrders][0][field]=order_id&...
0
votes
0answers
12 views

How to save custom field in cart item rest api rest/V1/carts/mine/items/item_id

i have created custom column in qoute_item and order_item table in magento 2 called "ss_item" and i am trying to save this field in the webservice called rest/V1/carts/mine/items/item_id but it is ...
0
votes
1answer
28 views

Magento 2 How to apply filters for layered navigation Using REST API

I want to apply filters for layered navigation using REST API. If I send color=5 then in category page it is displaying 2 products so how to get that data in API response?
0
votes
0answers
16 views

How do I setup VueStorefront with Magento 2 Backend?

I have been trying to setup VueStorefront with Magento 2 as the backend but even after following the documentation on [Here][1] I keep getting this error. I've installed the magento2-rest-client ...
1
vote
0answers
44 views

Error while getting the access token(oAuth based authentication) through postman in magento v2.2

I must include oauth_verifier request parameter in the Authorization header in the postman call to get access token from request token through postman in magento v2.2, I could generate the access ...
0
votes
0answers
19 views

How to get customer details from REST API customer Login Token?

I am getting customer token after hitting login rest API. I have a requirement in which I want to login the customer in web by using the Token got from rest API. Is there any possible way to do ...
2
votes
1answer
52 views

Extension attribute error “Call to undefined method Magento\Catalog\Api\Data\ProductExtension: : setDummyAttribute() on ProductExtension”

Error : Uncaught Error: Call to undefined method Magento\Catalog\Api\Data\ProductExtension: : setDummyAttribute() on ProductExtension in MyCompany\MyModule\Plugin\DummyAttribute" This is how I have ...
0
votes
0answers
21 views

Magento 2: Get customer collection along with the custom attribute values using Rest API

I had created a custom customer text field in Magento 2.3 using custom module. When I fill the customer details in the customer form to create new customer. The whole data is stored in the database ...
0
votes
0answers
42 views

Magento 2: Rest API “Checkout Cart Product Add After” event is not working

I have faced issue in checkout_cart_product_add_after event using add to cart rest API. Same add to cart event is working in website. But it is not working in Add to cart rest API. Add to cart API ...
0
votes
4answers
41 views

Magento 2: Type Error occurred when creating object

I had created a custom API for adding new customer in Magento 2.3. I had injected dependency injection and passed the method to create the customer account. But it gives me below error: main....
0
votes
0answers
12 views

View Magento's Rest API generated guest-cart in Store Website using URL with guest-cart id

I have a requirement to show guest-cart items(created and items added using Magento rest API) on the Magento store website to initiate checkout from the website. I tried http://storeurl.com/checkout/...
1
vote
1answer
36 views

Magento 2: Fatal Error: 'Uncaught Error: Call to undefined method setWebsiteId()

I had created a custom API for customer registration in Magento 2.3. I am checking that the weather the customer is already registered or not with below code. $email = $this->request->getParam('...
0
votes
0answers
11 views

Magento 2.3.0 : How can I add a Custom Payment API in CREATE ORDER REST API?

I have a scenario in which, after adding items into cart, and getting shipping estimated costs and payment info, I have to use a custom Payment API that deducts the total amount right after create ...
1
vote
0answers
17 views

Getting Error for asynchronous API call (v2.3) through postman

I get valid response when I try Synchronous API call. E.g. curl --location --request POST 'http://10.xx.xx.xxxx/rest/V1/customers' \ --header 'Authorization: Bearer jz62fwxwkdyyat8qeuxl1XXXXX97lpz'...
0
votes
0answers
13 views

Not getting products back with API call

I am making this application using the Magento 2 REST API where the user can select multiple search filters and then it will return the products doing an AND search, so the product must match all ...
0
votes
0answers
18 views

SQLSTATE[42000] while creating categories using REST API?

I created categories using REST api by below code. <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $directory = $objectManager->get('\Magento\Framework\Filesystem\...
0
votes
0answers
10 views

How to reload order summary section on payment page?

I have custom input on payment page: URL..checkout/#payment and submit button. When click on button - we call the function which should add another field to order summary .js file: return storage....
0
votes
1answer
28 views

Magento 2.2.2 Plugin how to add custom field in request api

I've create a plugin to listen to api POST /V1/order/:orderId/refund and I would like to receive custom field. I've added a field for testing like: name:['test'] Body E.G: { "items": [ ...
0
votes
0answers
24 views

M2 Rest api returning bad request for Sku's with # symbol

I have an issue with the rest api. I'm correctly formatting the rest request using c# & restsharp but I am getting a bad request returned as a response. In swagger I can send a test request and ...
0
votes
0answers
37 views

is Magento 2 : How to show data of external REst api rest using custom module in Magento2

I want to create a custom module in which, I want to fetch some external data using REST API ( https://reqres.in/api/unknown) and show them at home page. I have never worked with API in magento 2. ...
0
votes
1answer
12 views

Magento 2.2.2 Custom Api

I have created a custom api and add some getters and setter, I'm looking to find out if it's possible to pass key pair values in the post without having to set the setters. When I call the api I get ...
0
votes
0answers
27 views

How do I assign an attribute to a group using the REST api?

I know how to create a configurable product based off an existing attribute from this tutorial on the dev docs, and I know how to create a new attribute from this answer on another question. When I ...
0
votes
1answer
57 views

Magento 2: how to extend core function only for REST API

I want to extend some core function via the plugin and it should work in only when function call via REST API so in short my override things are only for REST API scope not for the web. is this ...
0
votes
1answer
48 views

Magento 2 - How to create invoice using custom rest API?

I am trying to create invoice using customer token. But getting following error. No such entity with orderId = 31 This error is generated after execution of following code. $transactionSave = $this-...
0
votes
1answer
40 views

Product Extension attributes is not return when request from rest api

I have created an extension attribute for a product. <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface"> <attribute code="product_options" type="Sample\Module\Api\Data\...
1
vote
1answer
27 views

what type of authentication i need to use laravel to magento

I want to use Laravel as frontend for Magento 2 . And I want to use Rest API for that. I have seen below authentication types are there. 1.Session based 2.Token based 3.Oauth based. Which one I ...
0
votes
0answers
20 views

Invoice Increment ID adjustment for API in Magento 2

I would like to change the increment_id for invoices. I tried this by running the following query: ALTER TABLE sequence_invoice_1 AUTO_INCREMENT = 504; This works for the invoice id but it does not ...
1
vote
0answers
20 views

Magento 2 API cart item does not show price for single product

I am trying to get the item after adding it in my cart. But the response always shows price ZERO. This is only happening for single product in cart. Endpoint: carts/mine/items
2
votes
0answers
17 views

Logical “NOT” in SearchCriteria

I found how to use logical "AND" & "OR" in search criteria: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/searching-with-repositories.html https://devdocs.magento.com/guides/v2.3/...
1
vote
0answers
17 views

Magento 2 Tracking shipment with carrier URL

I would like to know how to show the URL of a carrier to redirect the customer to carrier's tracking site, if it's possible with the tracking number in the URL. This pal did it but for Magento 1 How ...
1
vote
1answer
64 views

Magento 2: how to get CMS Pages using REST API

i want to get all cms pages using REST api i am trying to get via http://localhost/rest/V1/cmsPage/searchs but getting error The "searchs" value's type is invalid. The "int" type was expected. ...
0
votes
0answers
5 views

M2.2.4 CE - Add custom fields to Sales Order REST API Order Export

We have an extension that allows our customer to fill in some custom fields within checkout. Once that is done, we ideally would like to include those fields within our REST api order export that we ...
3
votes
1answer
45 views

Magento 2.3 - How to send associative as a response using custom rest API?

I need to send associative array in response. Keys can be dynamic like { 'a':'1', 'b':'2' } I already tried mixed[], mixed, string, string[], array and array[]. But I always get following result. ...
0
votes
0answers
32 views

Deprecation of REST APIs?

We are exploring different approaches for Magento integration (V2.3.3) with a storefront hosted on a third party CMS. We've come across 2 different approaches for this; REST based APIs GraphQL As ...
1
vote
1answer
41 views

Magento 2 REST API get all enabled categories

Wanted to use REST API to get all categories where is_active attribute is true. Here is endpoint I am calling https://www.domain.com/rest/default/V1/categories Which giving me all the categories ...
0
votes
0answers
19 views

Magento 2 add customer custom attribute into sales order api

I am using Magento 2.3.2 I have created one custom attribute for a customer using the setup file. After that I was able to add that attribute into customer rest API same attribute I want to add in to ...
0
votes
1answer
30 views

What is the use of 'all' in Magento 2.3 Rest API URLs?

For getting customer token following URL works. https://localhost/magento/rest/V1/integration/customer/token But following URL do not. https://localhost/magento/rest/all/V1/integration/customer/...
0
votes
0answers
14 views

REST api multistore

I have created multiple store views, pattern lang_country. It is my understanding that the REST API url syntax is as follows <host>/rest/<store_code>/V1/<action> where <...
0
votes
0answers
16 views

Need to get multiple column details through API

I wanted to get position and department of given email id. I am able to get one of them. What is the way to get it both. Service class:- public function getInfo($email) { $CustomerModel = $this->...
0
votes
1answer
25 views

Error while running API :Undefined Property

Magento 2.3, here is the stack trace: rk/App/ErrorHandler.php:61)"} [] var//log/exception.log:[2019-12-12 07:26:41] main.CRITICAL: Report ID: webapi-5df1ebb139956; Message: Notice: Undefined ...
0
votes
0answers
64 views

Magento 2 . API: want to fetch only order ID but every order details are coming

webapi.xml: <route url="/V1/orders/" method="GET"> <service class="SimplifiedMagento\Custom2\Api\OrderedRepositoryInterface" method="getOrderDetails"/> <resources> ...
6
votes
2answers
625 views

I have to make an API where I can return orders (product name) placed by a customer using customer Id?

In sales_order table product name field is not there but i have to fetch that too. How to fetch the product name ordered by a customer using customer ID?
1
vote
2answers
67 views

Custom Rest API for custom table not wroking

My webapi.xml is below. <?xml version="1.0"?> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"&...
1
vote
0answers
31 views

Cannot instantiate service class interface while running API in magento 2.3

THIS IS THE ERROR: "Fatal Error: 'Uncaught Error: Cannot instantiate interface SimplifiedMagento\\Custom2\\Api\\PositionRepositoryInterface in \/Applications\/MAMP\/htdocs\/Magento2_3\/vendor\/...
2
votes
2answers
43 views

Not able to get data through API…!

Error is "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-5dee36e254394". When you run http://localhost:8888/magento/rest/V1/position/1 Need to get result ...
1
vote
0answers
27 views

Magento2: How to get invoice pdf as response through magento rest api?

I want to get the pdf invoice as response using magento rest api for mobile application. I got the invoice order history data My code: public function printInvoicePdf(Request $request) { echo "...
1
vote
0answers
16 views

SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)

I've created Custom Rest API endpoint which works fine on my local Magento instance but I'm getting an exception on the production server "#0 [internal function]: MMA\CustomApi\Model\PayPal\...
1
vote
0answers
16 views

async rest api product can't set `enable_qty_increments`

I would set up enable_qty_increments in my store. I've edit store settings cart options to manage this but when I try to use rest api to update my product always this request can't set options relate ...
1
vote
0answers
15 views

quoteCartRepositoryV1 serach by nested field

I would apply searchCriteria to /V1/carts/search in order to get all carts which contain specific sku. I've performed this query https://shop.dicanio.it/rest/all/V1/carts/search?[filterGroups][0][...

1 2 3 4 5 16