cancel
Showing results for 
Search instead for 
Did you mean: 

Add new request param to SOAP request

Add new request param to SOAP request

 Hi

I am calling the API

$soapClient->quoteCartManagementV1CreateEmptyCart(['order_type' => 1]) 

 Actually I have one custom fields in my quote table . `order_type`
I want to pass the value for the field so when the new cart is created it should have it filled.

Below is my sample code. But is not working.
I have created plugin

afterCreateEmptyCart(QuoteManagement $subject, int $result, $vars = [])


And I am trying to get the parameter there but the param value is not available there.

Can anyone help me in this case .

Thanks

4 REPLIES 4

Re: Add new request param to SOAP request

Hello @ravirajm10 ,


As per your request, you need pass the custom field in Order API, so  you can use the Extension Attribute mechanism.  The extension_attributes mechanism, it take some work to set up, but this exposes the data consistently throughout the API (both internally, for code hinting, etc., and externally, for SOAP and REST).

Please refer the more information for extension_attribute.

 

https://devdocs.magento.com/guides/v2.3/extension-dev-guide/attributes.html

https://magento.stackexchange.com/questions/113447/how-to-use-extension-attributes-in-magento2

If my answer is useful, please Accept as Solution & give Kudos

Re: Add new request param to SOAP request

Hi Binod

Thanks for the kind reply. I will go through the link.
If you have any sample example kindly share . Actually I am new to M2.

Thanks

Re: Add new request param to SOAP request

Hi @ravirajm10 ,

Go throught once magento documentation for the SOAP API in magento 2.

https://devdocs.magento.com/guides/v2.3/get-started/soap/soap-web-api-calls.html

I hope it will help you!

Re: Add new request param to SOAP request

Hi Vimal

I have already gone through you can see in issue description . I am able to create the empty quote. I want to pass additional parameter to the createEmptyCart api. Currently here I have stuck.

Its kind of same like below in M1
https://stackoverflow.com/questions/17737635/magento-add-parameter-to-soap-method

Thanks for the reply.
Will let you know If I get any solution on the same