cancel
Showing results for 
Search instead for 
Did you mean: 

[Soap Api v2 shoppingCartProductAdd] Add custom product option of type file

[Soap Api v2 shoppingCartProductAdd] Add custom product option of type file

Hi,

 

Trying to upload a file for a product custom option of type File. This file needs to be attached to the product that is to be ordered.

 

All I have available is the "options" parameter which takes a [key] and [value]. When I have a custom product option of type text field and fill this option [value] with some text, and the [key] with the appropriate id, this works fine. In the final order(created from the cart) I can see that this value successfully has been transferred.

 

But then the custom option is of type file and I have an base64 encoded file as the [value] there is an error that I need to fill in the required product options. So it ignores my base64 content.

 

So, how do I need to upload this file custom option of a product that needs to be added to a shopping cart.

 

I'm using the following soap api calls, in order of use:

 

.login

.shoppingCartCreate

.shoppingCartCustomerSet

.shoppingCartCustomerAddresses

.shoppingCartProductAdd

.shoppingCartShippingMethod

.shoppingCartPaymentMethod

.shoppingCartOrder

 

Thank you in advance.

1 REPLY 1

Re: [Soap Api v2 shoppingCartProductAdd] Add custom product option of type file

So, in the Magento 2.x REST documentation(my question was about Magento 1.9 community edition, I should have mentioned that) it seems there are more options to configure custom options.

 

For example, in the "/V1/carts/{quoteId}/items" resource there is an explicit notion of file_info and base64_encoded_data.

 

Unfortunately I'm currently bound to Magento 1.9 with Soap(as the REST interface isn't implemented fully. Only GET's as far as I can see.)

 

So, one definitive answer that this is currently not possible in the 1.9 version of Magento would be great. Even greater would be that it is possible but currently I'm doing it wrong Smiley Happy

 

Hope to hear from someone.