Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
219 views

How to modify custom attribute of a product with JSON (Postman) Magento 2

thank you for reading me. Is there a way to modify a product´s custom attribute? I´m using postman, i use JSON POST for price and stock but i can´t find the way to update a custom attribute of a ...
Javier's user avatar
  • 1
2 votes
1 answer
267 views

Why are so many numerical parameters in JSON are of string type?

I've been looking at the examples in the documentation and also issuing GET requests via REST to get various information about products and categories. One thing that I find unusual is that there are ...
Захар Joe's user avatar
3 votes
1 answer
2k views

Magento 2 How to return JSON object in rest response

I want to return the JSON response suggested by the mobile app developer. My custom rest API currently returning responses in the below format. [{ "status": true, "data": [ { ...
savita nagdev's user avatar
0 votes
1 answer
237 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 ...
Syed Hassan Zamir's user avatar
0 votes
1 answer
119 views

First product added to new cart returned with no JSON "price"

This is my first time currently working with Magento. I am developing a custom web shop solution for a machine shop with React.js. My issue is the following: After having completed a purchase and ...
Nikolaj Hem's user avatar
2 votes
1 answer
2k views

rest api magento 2 get attribute code by attribute id

I need to get the attribute code by attribute id with rest api. This is needed for configurable product. I get the configurable product data: "extension_attributes": { "...
blob's user avatar
  • 455
0 votes
1 answer
522 views

Magento 2.3 How to convert JSON response array to array of same type object REST API

I have created a custom api to get review and rating summary: public function getRatingSummary($productId) { $result =[]; $product = $this->_productRepository->getById($productId)...
Adrian Joseph's user avatar
0 votes
2 answers
2k views

Magento 2 WebAPI json encode

I'm returning JSON via an endpoint in Magento 2 this bit of JSON looks like the following: $new_json = [ 'component_1' => '[{....}]', 'component_2' => '[{...}]' ]; ...
andy jones's user avatar
  • 1,383
1 vote
1 answer
149 views

Custom API POST JSON

I created a custom API REST : https://domain/rest/V1/action This is a POST request, with JSON in the body. Example : { "my_test_here": [ { "first_field": "value1", "...
Kozame's user avatar
  • 964
0 votes
1 answer
1k views

Magento 2.3 REST API Json response format issue

How I can change the json format from [ [ { "success": [ { "code": 200, "response": { "...
Vishal Bansal's user avatar
3 votes
0 answers
408 views

Magento 2: Is there a way to return custom json response from REST API without building a data interface?

I have a few custom REST API interfaces on my module & they all need to return a standard json response (different on each). After a little research, I realized that I can't do something like @...
Pini's user avatar
  • 917
1 vote
0 answers
280 views

How to add a new attribute in order response json in get order api

I have added a new column "old_order_id" in sales_order table using upgradeSchema. Now, I need to set that "old_order_id" through API. So, how to add that attribute(old_order_id) in request json ...
Harshith S's user avatar
1 vote
1 answer
3k views

Magento 2.2. Get error with ''@param string[] $types' in REST API

Using magento 2.2. I create rest api for edit address which need pass param in 'array of string' but i get an error: Doc: Magento Configure services as web APIs Used array of string for pass param ...
Bong Channarith's user avatar
0 votes
1 answer
427 views

REST API vs JSON

I've found lots of questions and answers on REST API vs SOAP API. Some of them like this one mention JSON. Could you explain what is the difference between REST API vs JSON. (aka create custom ...
MployBy's user avatar
  • 125
0 votes
1 answer
2k views

Show "You need to choose options for your item" message in magento2.2 when I hit API for add to cart configrable product

This is on Magento official document http://devdocs.magento.com/guides/v2.2/get-started/order-tutorial/order-add-items.html magento-host/rest/default/V1/carts/mine/items parameters { "...
Yuvraj Singh Shekhawat's user avatar
1 vote
1 answer
921 views

Magento 2: How can I store my original REST request in a file on the server?

I need to store my REST request within the file system - I have tried serializing the request object, but obviously the file size is quite a lot larger than the original. I have run a test that ...
BAF's user avatar
  • 719
2 votes
1 answer
404 views

Move HTTP GET request into a JSON array in Magento 2 REST API (V1/customers/search)

Is it possible to put the content of this rest api in a json array to put in GET parameters instead ? And if yes, what should the code look like ? curl_init("http://my.website.com/index.php/rest/V1/...
DevonDahon's user avatar
0 votes
1 answer
1k views

When creating an order via the Magento2 Rest V1 API, can I disable customer emails?

I'm working through integration of orders from external sources into our Magento store. We sell directly through our Magento instance as well as through some other carts (cartLoom). When an order is ...
Kimball's user avatar
  • 103
0 votes
1 answer
298 views

Setting multiple checkbox option selections on cart item

I have a product in my store with radio and checkbox custom options. using below JSON encoded string to add that item with it's options to shopping cart within my mobile app. { "cartItem": { "...
Grig's user avatar
  • 3
1 vote
0 answers
164 views

Magento 2: How to get JSON API Variable in Model

Below is the REST API called on Checkout Page, when you have multiple address & u click on "Ship here" magento/rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id It passes ...
Jackson's user avatar
  • 9,969
2 votes
0 answers
145 views

curl and json approve conversion Rest API

i'm currently coding a little api for extole approve conversion api. It's only suppose to send data on declined orders which is equal to cancelled in the magento admin. Here is what i have written ...
thismethod's user avatar
8 votes
4 answers
31k views

How do I get a response from REST API in JSON format in Magento 2?

I used the resources in “Creating a New REST Web Service in Magento 2” and “Creating a New REST Web Service in Magento 2” to create a custom API module, but the response is in XML format. I need a ...
Pradeep Kumar's user avatar
4 votes
3 answers
4k views

No response from POST to custom REST Api route

I set up a working custom route for Magento's REST Api. It works fine for GET requests, as the _retrieve() function of the corresponding V1.php class is being called as expected and returns the data. ...
Rouzbeh's user avatar
  • 265