Hi
Please excuse the noob question.
I am aware of Data Import, it is very good but import/export cannot be automated or scheduled.
I cannot see a means for automated import, export, data updates or synchronization - potentially offered by web services or similar. i.e. if you want to despatch an order from a desktop client (such as an accounts system) or update an address. This seems strange, when far less capable stores have such features (of sorts)
What would be the best plan to leverage as much as possible of what AC has in place already? Has anyone got any examples of a web service (or what ever it might be called) achieving anything like this. I can't believe it is a massive job with such a cool structure, api etc that is in place already.
Cheers, Antony
Integration with AC : Web Services etc
Re: Integration with AC : Web Services etc
I have written an ASP.Net web service for a fullfillment house client that could be easily adapted to a specific need. It uses SOAP communication so it's very cross-platform compatible.
Currently the web service handles the following services:
Inbound requests for order data. Once the request is received and authenticated, order data is returned in XML format.
Inbound stock status requests. SKU is provided and and current stock level is returned.
Inbound stock update. SKU and stock quantity are provided, AC7 stock level is updated and status of the update is returned.
Inbound shipments posting. Inbound shipment data is provided with tracking number information. Full, partial and backorder shipments are all supported. Partial shipments automatically create additional shipment records in AC7 as needed to support the remaining shipments possible.
The module has been working flawlessly for many months, so it's rock-solid. I have not taken the time to write the documentation for it though - that takes a while given the technicals involved with such a design.
Currently the web service handles the following services:
Inbound requests for order data. Once the request is received and authenticated, order data is returned in XML format.
Inbound stock status requests. SKU is provided and and current stock level is returned.
Inbound stock update. SKU and stock quantity are provided, AC7 stock level is updated and status of the update is returned.
Inbound shipments posting. Inbound shipment data is provided with tracking number information. Full, partial and backorder shipments are all supported. Partial shipments automatically create additional shipment records in AC7 as needed to support the remaining shipments possible.
The module has been working flawlessly for many months, so it's rock-solid. I have not taken the time to write the documentation for it though - that takes a while given the technicals involved with such a design.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
Re: Integration with AC : Web Services etc
Right now AbleCommerce doesn't provide Web services interface to complete API out of the box. You can create your own webservice and then expose your desired operations through web methods. All you need is to pass required data to those methods and then make use of API to take proper actions against method calls in webservice.
Re: Integration with AC : Web Services etc
Thank you for your replys.
Given the superior AC DAL/API structure I am hoping a simple example could be readily replicated and extended.
Is there any chance you could provide sample code to say delete a stock item via a web service. I am sure that this would offer great interest and use to the community.
Thanks
Given the superior AC DAL/API structure I am hoping a simple example could be readily replicated and extended.
Is there any chance you could provide sample code to say delete a stock item via a web service. I am sure that this would offer great interest and use to the community.
Thanks
Re: Integration with AC : Web Services etc
ASP.Net Web Services are widely documented on the internet with many tutorials - that's how I learned them. They are insanely easy to create using Visual Studio. Once you have the web service created, it's up to your code to decide how to handle the methods exposed.etasp wrote:Is there any chance you could provide sample code to say delete a stock item via a web service. I am sure that this would offer great interest and use to the community.
Here's how I set stock quantity in my web service:
Code: Select all
[WebMethod()]
public string SetStockQty(string SBCUserName, string SBCPassword, string _SKU, int _InStock)
{
// First verify authentication
if (!SBCLoginValid(SBCUserName, SBCPassword)) {
return "Login credentials not valid.";
}
// authentication valid, are we enabled?
if (!SBCServiceActive()) {
return "Request for orders denied - Service Mode set to inactive";
}
string _RetVal = "";
// ok find the product with the SKU provided and update the product
Product _Product = GetProductbySKU(_SKU);
if (_Product != null) {
// found a product with that sku - update it with the stock value
if (_Product.Sku == _SKU)
{
_Product.InStock = _InStock;
_Product.Save();
_RetVal = "SKU " + _SKU + " stock updated to " + _InStock.ToString();
}
}
// check variants if the regular product record wasn't found
if (string.IsNullOrEmpty(_RetVal))
{
// No product found, check variants
ProductVariant _ProductVariant = GetVariantbySKU(_SKU);
if (_ProductVariant != null)
{
if (_ProductVariant.Sku == _SKU)
{
_ProductVariant.InStock = _InStock;
_ProductVariant.Save();
_RetVal = "Variant SKU " + _SKU + " stock updated to " + _InStock.ToString();
}
}
}
// if retval is still empty by this point, the provided sku was not found in either
// products or product variants so let the send know
if (string.IsNullOrEmpty(_RetVal))
{
ErrorMessageDataSource.Insert(new ErrorMessage(MessageSeverity.Warn, "SBCFulFillment", "SetStockQty tried to set Qty: " + _InStock + " for SKU: " + _SKU + " but was not found."));
_RetVal = "SKU not found";
}
return _RetVal;
}
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
Re: Integration with AC : Web Services etc
Joe,
Many thanks - thats really good of you to share.
I'm surprised that there is so little traffic on the forum in this regard. This is potentially a major benefit and competitor basher. Other stores/code bases have alot of work to achieve this, not so with AC due to its well designed/documented structure.
Cheers
Many thanks - thats really good of you to share.
I'm surprised that there is so little traffic on the forum in this regard. This is potentially a major benefit and competitor basher. Other stores/code bases have alot of work to achieve this, not so with AC due to its well designed/documented structure.
Cheers
Re: Integration with AC : Web Services etc
I agree. The data classes are well designed. You can find a ton of stuff in the Wiki here http://wiki.ablecommerce.com/index.php/Main_Pageetasp wrote:Other stores/code bases have alot of work to achieve this, not so with AC due to its well designed/documented structure.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com