Web API (official plugin)

1 year ago
Indeed, we do not have documentation for the web api, so we distribute it exclusively with source codes so that developers can see the implementation details. Swagger UI also helps.
The SelectShippingMethod method accepts only the selected option formed according to a special template (which you specified correctly) and a dictionary of parameters for pickup points. Based on your code, it seems to me that you are passing the shippingOption parameter in the body, but it must be a parameter from the query string.

here is an example call on my local server:

curl -X 'POST' \
   'http://192.168.1.172/api-frontend/Checkout/SelectShippingMethod?shippingOption=Ground___Shipping.FixedByWeightByTotal' \
   -H 'accept: application/json' \
   -H 'Content-Type: application/json-patch+json' \
   -d '{
}'
1 year ago
Thanks.
Sorry but... where is the source code?? i don't think that i've found it in my downloaded zip...

As for the call... we pass the selectedshippingoption as paramenter.
If I remeber well (i must ask to my collegue) if we don't pass anything in the body we have a problem...
I can recheck with him

Sergei-k wrote:
Indeed, we do not have documentation for the web api, so we distribute it exclusively with source codes so that developers can see the implementation details. Swagger UI also helps.
The SelectShippingMethod method accepts only the selected option formed according to a special template (which you specified correctly) and a dictionary of parameters for pickup points. Based on your code, it seems to me that you are passing the shippingOption parameter in the body, but it must be a parameter from the query string.

here is an example call on my local server:

curl -X 'POST' \
   'http://192.168.1.172/api-frontend/Checkout/SelectShippingMethod?shippingOption=Ground___Shipping.FixedByWeightByTotal' \
   -H 'accept: application/json' \
   -H 'Content-Type: application/json-patch+json' \
   -d '{
}'
1 year ago
I'm sorry if you didn't find the source code of the plugin in your archive, I know that it should be there, unless of course we are talking about this plugin. Just download the archive from your personal account again
1 year ago
Yes, i confirm, that plug-in-- we have buyed for different websites... and we are using with success... else without documentation...

Just tried... i remove the body... and let only the parameter... it say that is ok... but at the last step we have the error... and seeing at the data we find that the shipping method is not selected

Can i send you personal data via PM??

Sergei-k wrote:
I'm sorry if you didn't find the source code of the plugin in your archive, I know that it should be there, unless of course we are talking about this plugin. Just download the archive from your personal account again
1 year ago
Yes, of course, you can write me a PM, just please indicate the email from which you bought the plugin. However, I think that in the current question it may not be needed. I analyzed the problematic section of the code. Look in the plugin source code for the SelectShippingMethod method and if at the end your attribute is saved like this:

//save
await _genericAttributeService.SaveAttributeAsync(await _workContext.GetCurrentCustomerAsync(),
  NopCustomerDefaults.SelectedShippingOptionAttribute, shippingOption,
  (await _storeContext.GetCurrentStoreAsync()).Id);


then you should replace shippingOption with shippingOpt and rebuild the plugin, this will fix your problem.

[email protected] wrote:
Yes, i confirm, that plug-in-- we have buyed for different websites... and we are using with success... else without documentation...

Just tried... i remove the body... and let only the parameter... it say that is ok... but at the last step we have the error... and seeing at the data we find that the shipping method is not selected

Can i send you personal data via PM??

I'm sorry if you didn't find the source code of the plugin in your archive, I know that it should be there, unless of course we are talking about this plugin. Just download the archive from your personal account again
1 year ago
Many thanks Sergei, finally i've found in the zip tha source code folder.... and with your mod we can process the shipping method selection.

Sergei-k wrote:
Yes, of course, you can write me a PM, just please indicate the email from which you bought the plugin. However, I think that in the current question it may not be needed. I analyzed the problematic section of the code. Look in the plugin source code for the SelectShippingMethod method and if at the end your attribute is saved like this:

//save
await _genericAttributeService.SaveAttributeAsync(await _workContext.GetCurrentCustomerAsync(),
  NopCustomerDefaults.SelectedShippingOptionAttribute, shippingOption,
  (await _storeContext.GetCurrentStoreAsync()).Id);


then you should replace shippingOption with shippingOpt and rebuild the plugin, this will fix your problem.

Yes, i confirm, that plug-in-- we have buyed for different websites... and we are using with success... else without documentation...

Just tried... i remove the body... and let only the parameter... it say that is ok... but at the last step we have the error... and seeing at the data we find that the shipping method is not selected

Can i send you personal data via PM??

I'm sorry if you didn't find the source code of the plugin in your archive, I know that it should be there, unless of course we are talking about this plugin. Just download the archive from your personal account again
1 year ago
Hello,

I have purchased the API library for one of my shops (Order 44361), but I can’t figure out how to get the product details (e.g. product descriptions, names, etc…) returned from the API for a specific language (the shop has 4 languages). Unfortunately, the swagger documentation is not very helpful.

Example:
How can I specify the language to be used when making calls using “/api-frontend/Product/GetProductDetails/{productId}”?

Thanks
Stephan
1 year ago
Hi, Stephan. At the moment, the Web API with its behavior repeats the functionality of nopCommerce itself. In order to get the localized text, you need to change the language of the user on whose behalf the request is being made. that is, you must first make a call
/api-frontend/Common/SetLanguage


StephanZ wrote:
Hello,

I have purchased the API library for one of my shops (Order 44361), but I can’t figure out how to get the product details (e.g. product descriptions, names, etc…) returned from the API for a specific language (the shop has 4 languages). Unfortunately, the swagger documentation is not very helpful.

Example:
How can I specify the language to be used when making calls using “/api-frontend/Product/GetProductDetails/{productId}”?

Thanks
Stephan
1 year ago
Hi all,

I am new to the platform and I would really appreciate a bit of support here.
So I am planning to use NopCommerce with source code and as I will need the WEB API functionality, I came through the official plugin. I see that it is paid, but in the description it says that the source code is Open Source which means that if I want to use the plugin in my app, I shouldn`t have to purchase it. Am I right?

Thank you all.

Kind regards
1 year ago
yoanna.kostova wrote:
I am new to the platform and I would really appreciate a bit of support here.
So I am planning to use NopCommerce with source code and as I will need the WEB API functionality, I came through the official plugin. I see that it is paid, but in the description it says that the source code is Open Source which means that if I want to use the plugin in my app, I shouldn`t have to purchase it. Am I right?

Source code is available to customers who purchased it. So you have to purchase it first