Questions tagged [api]

An application programming interface (API) specifies how some software components should interact with each other.

4
votes
0answers
86 views

HELP - How to convert Default SOAP-v2 API Magento Objects into XML Values?

By Default return values as Magento Objects using soap v2, how can i change into XML, <?php ini_set('display_errors','On'); $proxy = new SoapClient('abc.com/api/v2_soap/?wsdl', array('trace' => ...
2
votes
1answer
54 views

customer not logged

I'm building rest api to get data based on customer session, but it always returns false when I call isLoggedIn() function that's my module.xml: <?xml version="1.0"?> <config xmlns:xsi="...
0
votes
1answer
112 views

How to add my own Magento 2 WSDL file

Magento 1.9 I used the WSDL https://github.com/marouanbmm/magento-Apis/blob/master/code/local/Tecnifibre/SerienFlow/etc/wsdl.xml file as part of my development Delphi win 32 to have access to the ...
0
votes
1answer
235 views

Magento 2: Rest api for getting cart items is returns empty array

I need tho get current customer cart items using rest api, so I've created Cart module and Here is my interface: <?php namespace Bit68\Cart\Api\Cart; interface MyCartInterface{ /** * @api * @...
1
vote
1answer
30 views

How to download Invoice without login Magento Admin?

I need to get invoice without login Magento admin, is it possible using any CRM or API Services?
0
votes
1answer
30 views

Magento API error while creating gost account

When i'm pasing $customerObject->newsletter = $wantToSubscribe; in magento API in log there is error LogicException: Property "Newsletter" does not have corresponding setter in class public ...
1
vote
1answer
549 views

Magento 2.2: How to add a custom attribute in to Order?

I have created a custom attribute of type customer_address and I would like to have the API to return me the value as an attribute when I call the API to receive an order. Attribute: private ...
2
votes
1answer
238 views

How to solve Soap_V2 - Uncaught SoapFault exception looks like we got no XML document - SoapClient->__call('login', Array)?

After configuration SOAP_v2 for getting products info, Magento version : 1.9.2.3 Code: <?php $proxy = new SoapClient('abc.com/api/v2_soap/?wsdl'); $sessionId = $proxy->login((object)array('...
2
votes
1answer
353 views

how can I get an image to be used in mobile app by rest api

I've written the following function public function getImg($sku){ $product=$this->productRepository->get($sku); $image=$product->getImage(); return $image; } as an api method ...
0
votes
0answers
87 views

What is the type of 'Magento\Sales\Model\ResourceModel\Report\Bestsellers\Collection'

What is the return type of the following function public function getBestseller(){ $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $productCollection = $objectManager-&...
0
votes
0answers
16 views

Why to build api

While I'm building rest APIs to build a mobile app, like for example getting product by its sku and find its stock status. I see that APIs are already build by Magento. So why I need to build it? Can ...
3
votes
0answers
345 views

Magento 2 Add to cart api Item price set zero in Quote Item table

I am trying to add product to cart with Magento 2 default API. POST : http://{{magento2}}/rest/V1/carts/mine/items Request : { "cartItem": { "sku": "p2", "qty": 1, "price"...
4
votes
1answer
57 views

How to create Mobile Application of Magento 2 Native?

How to create Mobile Application of Magento Native ? Using Magento 2 default REST API's how to create Front-end Magento 2 application ?
0
votes
1answer
136 views

How do I correctly access WSDL for SOAP connection?

When running this, I only get an "HTTP ERROR 500" page. As I've seen in other solutions I've added the 'index.php' before the /api section. I've also enabled WSI-Compliance mode as I've seen suggested....
2
votes
1answer
66 views

PHP Online refund in Firstdata payment gateway (Payeezy)

I have implemented the Firstdata payment gateway for online payment. It is working fine. Now I want to implement the online refund functionality. If anyone provide me the sample script for Firstdata ...
0
votes
1answer
37 views

How to check is valid token or not. Magento 2 API

I need to do API method, which return data from db table just for admin. There is my method: /** * @return array * @throws \Magento\Framework\Exception\LocalizedException */ ...
2
votes
0answers
35 views

What is the correct way to create Mock input interface in Web-Api functional test?

I've already write successfully a Web-Api unit test for a Custom API. But I'm wondering if there is a way to automatically create a Mock for input data for the API? For example, AccountManagement ...
3
votes
2answers
435 views

Rest API - magento 1.9 - Return 403 Access denied - Magento\Framework\Webapi\Exception::HTTP_FORBIDDEN - format - https://abc.in/api/rest/customers

Error : Rest API for customer return 403 access denied error. Format : website/rest/api/customer -> 403 access denied error Magento\Framework\Webapi\Exception::HTTP_FORBIDDEN
0
votes
0answers
27 views

API catalogProductAttributeOptionManagementV1 return different result than doc

When I'm using catalogProductAttributeOptionManagementV1 API (get All options of attributes), with the URL https://local.dev/rest/V1/products/attributes/color/options, I get this result : [ { ...
0
votes
1answer
54 views

REST API routes for blog-module

I can't seem to find the API routes for this module, while the module is available by API. How can I translate the code to API routes? https://github.com/mirasvit/module-blog
2
votes
1answer
335 views

Magento 2 Api/Data, When To Create It?

I have fairly simple REST API request to get guest country code by his ip. In my block file this works perfectly fine when using curl: $url = "http://........./".$guestIp."?access_key=".$...
0
votes
2answers
494 views

Magento2 Shipping Methods rest api

Is There any possibility to fetch all shipping methods using rest api in magento2 Thanks
1
vote
1answer
610 views

Create REST API with post params

I have below JSON Data for rest API {"region_id":"475","city":"city","item":[{"qty":"1","weight":"","price":"10.0000","sku":"test"}]} and i wann to create api class I do like this /** * @api * @...
0
votes
0answers
52 views

Customize the API error response

I need to customize the JSON response of the Magento REST services when an exception is thrown. Examples: { "message": "Request does not match any route.", "trace": null } { "messages": ...
1
vote
0answers
75 views

Magento get product link using V1 API

$storeUrl."/index.php/rest/V1/products?searchCriteria[page_size]=200&searchCriteria[currentPage]=1" It returns products list but I want to get each product link. How it is possible?
0
votes
1answer
238 views

Add No-Required params to custom REST API

I made a custom REST API on Magento 2. I want some params to be required and other to be no required or accept null. I have the next code: Api/Order/ShippingInterface /** * API00004. Envío de ...
2
votes
2answers
1k views

Consumer is not authorized to access %resources Magento_Sales::sales

I have this basic API script: <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(-1); $usr = [ 'username' => 'username', '...
2
votes
1answer
90 views

I am trying to override core interface in Vendor\magento\sales\Api\Data\OrderItemInterface.php

My di.xml code is here, is there any alternative way to override an interface for core file. <preference for="Magento\Sales\Api\Data\OrderItemInterface" type="Vendor\Name\Api\Data\...
2
votes
1answer
94 views

Duplicate sales order grid to custom admin page

I need to copy the sales_order_grid table to a custom admin page. Is there a way to do so using Magento's API?
1
vote
0answers
119 views

Magento 2 - How to add custom order item field on order export API

I added a new field on table sales_order_item. I need to display it on REST API order export, in the "items" node. Is it possible to do that ?
1
vote
2answers
338 views

Magento 2 - Update multiple products programmatically

I'm trying to update products programmatically but I got only first product from array updated. All of products in array have status "2" (disabled) in DB. I'm using $this->...
1
vote
0answers
75 views

Magento 2 API - crud for all tables

Is it possible to create a new REST API to update or create data in all magento tables from a xml added in POST : <data> <row table="Nom_Table_1" key="Nom_Champ_Key_1"> <...
1
vote
1answer
37 views

Problem with importing from Cludes ERP System to Magento backend

I am importing products from Cludes ERP System, but Product base image is not set in Magento backend:
1
vote
0answers
25 views

Can we implement Alexa Skill to use with our Amazon pay Account in magento 1

In Magento 1 websites, we want to implement Alexa Skills to use our amazon payment account. Can anybody please share knowledge/steps/guide, how we can implement alexa skill to use our amazon pay ...
3
votes
1answer
127 views

Magento 2 for logged In customer need to add shipping address every time i place a new order?

This is what i am following... 1. Add Configurable product in cart. http://magento-host/index.php/rest/default/V1/carts/mine/items method : POST Authorization : Bearer <customer token> body ...
3
votes
1answer
233 views

How to return search API response from controller in magento 2?

I have an API(ukvehicledata) for search using registration id. I want to integrate with magento 2.2 I am getting response in controller as JSON format. I have converted it into an array. Now I ...
2
votes
1answer
39 views

Magento cancel onhold orders

Is there any possibility to cancel the on hold orders magento1.9 soap API.
5
votes
1answer
532 views

How to capture the User ID using magento's customer Token?

How do I make a call to that URL that captures the User ID, using Magento customer Token in magento 2 rest API? How Magento 2 makes calls in-between for the APIs ?
6
votes
1answer
153 views

What are the use of ExtensionAttribute JoinProcessorInterface and CollectionProcessorInterface at magento 2.2.3

I built Magento 2 Module which has a model and Service contracts/API. During this implementation, I have followed vinai Kopp article and also magento2 module Magento_Quote. On this Magento\Quote\...
3
votes
1answer
400 views

Create POST API to update order custom fields using increment ID

I need to update order custom attributes from increment ID using a custom REST API. I receive this XML : <order> <data> <incrementId>000000007</incrementId> <...
3
votes
2answers
614 views

Magento2 REST API - Cannot create cart/quote for customer

I am building a shoppingcart using the Magento2 Rest API and I want to create a cart for a customer and (if not logged in) for a guest. For guest carts is it working: Create a guestcart: POST ...
1
vote
0answers
26 views

What is the M1.9 UPS Shipping Default Rate Table (out of the box, not XML)

We are doing some comparisons with our different options using M1.9 UPS shipping. We noticed that the rate for the default UPS setting for UPS Type (United Parcel Service) is returning values that are ...
1
vote
0answers
30 views

Product images in multiple stores using JSON API

I have four stores created, and I'm trying to upload a single image for the same product in each of the stores. My issue is that to get an image to show in the category front end view, I need to ...
0
votes
1answer
65 views

API with swagger in magento 1 or other tool

I am trying to find out way to create api for magento 1. can we use swagger for magento 1 or any other tools available for magento 1.9. Please give suggestion or need to create from scratch ?
2
votes
0answers
151 views

How to find Magento version using API (JSON specifically)

Using the JSON RestAPI, I need to do things slightly differently depending on the version of Magento due to as-yet un-fixed bugs (specifically https://github.com/magento/magento2/issues/18005). I can ...
1
vote
1answer
120 views

How to get List Layer Filters in magento 1?

I trying to get list layer filters option in Magento 1 in custom file name is list_layer_options.php. This is my source: $appliedFilters = Mage::getSingleton('catalog/layer')->getState()->...
2
votes
1answer
86 views

Add configure product in Cart using Magento 2 API facing an issue

Here's the url http://<magento host>/rest/default/V1/carts/mine/items Method POST Headers Authentication :: Bearer <customer token> Content-Type :: application/json Body json data ...
1
vote
0answers
57 views

MAGENTO - want to get delievery date from UPS

How can I get the delivery date from the UPS? Does anyone have any idea about this?
1
vote
0answers
87 views

How to debug dropped Authorize.net transactions in M2

We are seeing seemingly random drops in responses from Auth.net using Magento 2. With the debug log on, we saw a customer place 2 orders, the first has no response, and the 2nd, placed half an hour ...
2
votes
0answers
86 views

Magento2 Rest Api to Delete an item after place order

Can anyone help me how to remove an item from an order after order completion using resti api in magento2 Thanks