Topic: SOAP Web Service

I've started working on a SOAP web service primarily so I can post Direct Sales Invoices and Payments from a custom online store. I'm using the underlying transactions that sales_order_entry.php?NewInvoice=0 uses.

Has anyone worked on this already? I don't want to reinvent the wheel - especially given I'm a C# geek not a PHP one!

Gareth.

Re: SOAP Web Service

Hi Gareth,

I have no experience with soap, but some time ago I have implemented Hessian protocol interface for FA, however the code was never bundled with core FA sources.

Janusz

3 (edited by gobrien 12/04/2010 08:32:28 pm)

Re: SOAP Web Service

I've attached the first pass at a soap interface. It is only a start and implements only the direct sales invoice workflow - cause that's all I need for now! However, it may be of use as a starting point for anyone that needs to integrate with FrontAccounting.

Put the soap folder from the zip file into your install folder (e.g. http://yourdomain/account). Connect to http://yourdomain/account/soap/soap.php?wsdl and you're off and running.

Remove the .txt from the end of the attachment. The forum is not liking the .zip extension.

Re: SOAP Web Service

This is really good  start point to implement full soap API for FrontAccounting, thank you Gareth. We will put it with your permission also on our download page. I hope somebody over there will be interested in making it more complete, then we can make it available also from our repo as extension module smile.

Janusz

Re: SOAP Web Service

Please post it wherever it might help. The pattern should help anyone that wants to continue.

6 (edited by tclim 03/16/2011 03:46:20 pm)

Re: SOAP Web Service

Hi All, I have created a Soap Web Services that integrate with Customer Contact table and it will automatically populate the customer information into FrontAccounting system. This release is based on "Import Customers module" that is available in "download" page.

Initially, this web services API come with 3 methods:

  1) get_debtors_masters (Query Customer Master Table)
  2) get_debtor_trans (Query the Customer Transaction Table)
  3) create_debtors_masters
       3.1) Insert Action - Create Customer Master, Branch, Person and Contact information.
       3.2) Update Action - Update Customer Master Table Only

You can used this web service to Sync Customers Contact Information with any e-Commerce and provide data integrity between
the two system.

PROBLEM:    I was unable to perform Security Role Checking by using this web services. Maybe someone can share with me how FrontAccounting security Access Level rules.

You can download this "Plugin" from http://www.anterp.com/downloads/fa_soap_web_services.zip

For installation and User Guide, please read the document file at readme.txt and FrontAccounting-Web-Service.pdf

I would like to heard your suggestion, kindly reply to this forums or email to me. Thanks & Enjoy it.

Re: SOAP Web Service

Hi,

Has anyone have an luck on Magento - FA integration ?

8 (edited by tclim 03/22/2011 12:43:14 pm)

Re: SOAP Web Service

Hi Tomarnst,

I think you can use this plugin to sync your customer contact information into FA. It regardless what Shopping Cart you are using. You can call the interface as below:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$_company_name = "ABC Co";
$_short_name = strtolower(ereg_replace("[^A-Za-z0-9]`~!#'\"", "", str_replace(' ', '', $_company_name)));
$_first_name = "Your Name";
$_last_name = "Lim";
//Create Debtor Master
$param = array("company"=> $_company,
                 "user_id"=> $_uid,
                 "password"=>$_upswd,
                 "id"=>"",
                 "company_name"=>$_company_name,
                 "short_name"=>$_short_name,
                 "first_name"=>$_first_name,
                 "last_name"=>$_last_name,
                 "address"=>"123, Jalan ABC, Malaysia",
                 "email"=>"abc@yahoo.com",
                 "phone"=>"60311111111",
                 "mobile"=>"6012222288",
                 "fax"=>"",
                 "tax_group"=>"GST Tax",
                 "tax_id"=>"GST8888",
                 "area"=>"Asia",
                 "country_code"=>"MY",
                 "currency_code"=>"MYR",
                 "customer_type"=>"Retail",
                 "payment_terms"=>"Cash Only",
                 "credit_status_id"=>"1",
                 "notes"=>"Good Customer");
$antResults=$soapclient->call("create_debtors_masters",$param);

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Hope it help...

Re: SOAP Web Service

Thanks tclim,

i'm going to try this asap.

Re: SOAP Web Service

This is really very interesting and I downloaded the source. It looks like the other method required would be: 
create_debtor_trans

You could then process an eCommerce shopping cart, add/edit the debtor to FA and then create an FA sales order or invoice (based on the trans type) depending on whether you track delivery of orders in FA or your eCommerce system ( I make sales orders and track deliveries in FA). For those of you using Virtuemart (like me), I understand there is a user class system so you can hook onto so you can make these calls to SOAP without touching the main Virtuemart source. Not sure if Magento has the same coding structure.

In addition to that, some procedures to Get and Create sales Items might be useful to keep product lists in Sync between eCommerce and FA.

[b]RodW[/b]
Brisbane, QLD, Australia

11 (edited by tclim 05/18/2011 04:13:31 pm)

Re: SOAP Web Service

Hi rodw,

    i hope that you enjoy the source code that I have published last time for the SOAP API. With regard to your new method "create_debtor_trans". I am sorry that I didn't continue with SOAP but rather I have created a totally new FrontAccounting REST API which have better performance gain at least 30% better than current SOAP API.

    This new REST API are written to solve the issues below:

   1) FA doesn't provide any API for integration

   2)  I have done the FA vtiger integration (Please refer to another post that i have mention about - 2 ways synchronization between vtiger and front accounting - RELEASED at https://frontaccounting.com/punbb/viewtopic.php?id=2096)

    3) You can now enjoy the possibility of data sync between FA to any Open Source Shopping Cart System include osCommerce, Magento, PrestaShop, Virtuemart, OpenCart, ZenCart etc that enable you to bi-directional synchronize between the Customer information, Orders, Invoices, Stock Status etc (Current version does not support image Sync Yet).

    4) Another solutions can be done is creating a new Mobile Access to your FA directly. Since the REST API can be call directly from any browser including the Mobile Devices.

    I am currently working hard for the integration between the FA and others related modules which include the above mention except for mobile solutions. Hope you enjoy it.

Re: SOAP Web Service

tclim

Thanks so much for contributing this. I had seen the Vtiger contribution but am not quite ready to tackle the CRM side of my small business and did not realise that it included a generic API as REST meant nothing to me. Now I need to get my head around all of what you have done and of course once I stopped and thought I needed Purchase order integration as well. I had a quick look at your Vtiger integration demo and was impressed and will return.

I will continue the conversation on the other thread once I am ready to tackle this.

Rod

[b]RodW[/b]
Brisbane, QLD, Australia

Re: SOAP Web Service

Can someone point me to the download for the REST API that was offered by TCLIM  https://frontaccounting.com/punbb/viewtopic.php?id=1569
I can find it no where on the frontaccounting site.    I have a bunch of customers to import.    Thanks so much.

Re: SOAP Web Service

Hi kpimichael,

   This API was built using Soap WebService as the title have clearly mention about it. You can use it to import your Customers and  Contacts into FA. It will automatically populate the data into Debtor Master, Branch and Contact tables. You can extend the API by creating your own WebService API to suite your need. Please downloads the zip file from http://www.anterp.com/downloads/fa_soap_web_services.zip and read my documents FrontAccounting-Web-Service.pdf.

Hope it help.

tclim

Re: SOAP Web Service

Does this still work in FA v2.3.22?