Jump to content

Looking for an Example PHP Guzzle Script


 Share

Recommended Posts

Hi Everyone,

I have a client that uses Sage (the web based version) that is looking for our software to shoot invoices into his Sage software using an API.  

Would anyone have an example PHP / Guzzle script they could share on how to authenticate and get a token?  

They want us to send the following information into Sage:

Type, Customer Reference, Date, Customer Name, Reference, Ledger Account, Details, Net, Tax Rate, Tax, Total, Analysis Type 1,  Analysis Type 2,  Analysis Type 13

Any help would be greatly appreciated.

Thanks!

Brian 🙂

Link to comment
Share on other sites

Hi Brian,

It sounds like your client is using Sage Business Cloud Accounting but from the field requirements you are stating, this may not be the case. I would clarify with them before you start with the integration.

There's an example PHP 7 app here which details the auth flow.

As I mentioned above, some of the field names (mainly the Analysis Types) do not appear to be that of Sage Business Cloud Accounting. SBCA has the ability to set an analysis type for a contact as shown in the attached screenshot but this information is not exposed by the contacts API.

Thanks

Mark

Screenshot 2022-09-21 at 17.10.07.png

Link to comment
Share on other sites

Thanks Brian,

If they're in the process of upgrading it doesn't sound like SBCA. It sounds more likely to be Sage 50c. I'd definitely clarify this with them. I've included some information relating to Sage 50c should they be using this product.

Sage 50 Cloud Accounts is a desktop product that currently(UK version) does not have publicly available API's. 

Integration with Sage 50c is via Sage Data Objects (SDO) which is a collection of ActiveX dynamic link libraries (.DLLs). The SDK delivers an object- based interface with methods and properties designed to simplify communications between compliant development tools and the Sage 50 Accounts database. For example - the ‘SalesRecord’ object has methods to ‘Find’, ‘Edit’ and ‘Update’ a customer record, and properties to get and set the ‘Name’, ‘Credit_Limit’, and ‘Balance’.

Access to the SDO is via a subscription to the UK Sage Developers Programme. This entitles you to support with your applications a long with comprehensive help documentation complete with code examples for all objects written in both VB and C# .Net.

Thanks

Mark

Link to comment
Share on other sites

Hi Mark,

I wrote to my client.  They are using Sage Cloud now (moving to it).  Their old software (Sage 50) could import Excel files to generate invoices.  Can Sage Cloud import invoices via an Excel file (or another kind of file) or is the only way to import invoices in Sage Cloud via the API? 

Thanks,

Brian

Link to comment
Share on other sites

Hi Brian

SBCA (Sage Business Cloud Accounting) can import certain data types. There are CSV templates that can be downloaded and the import data created to suit the format. At present, transactional(invoices) csv import is not an option in SBCA and the API would need to be used.

By following our quick start guide you'll be able to setup a trial account free of charge and test your work as you develop.

Thanks

Mark

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...