olsgreen/sage-business-cloud-accounting-api

This package provides a means easily of interacting with the Sage Business Cloud Accounting API.

2.0 2021-08-18 18:49 UTC

This package is auto-updated.

Last update: 2024-05-19 01:59:27 UTC


README

Latest Version Software License

This package provides a means easily of interacting with the Sage Business Cloud Accounting API.

Installation

Add the client to your project using composer.

composer require olsgreen/sage-business-cloud-accounting-api

Usage

Sage require that you exchange your key & secret for an access token, this is then used to access the API.

You can handle authentication and obtain an access token by using my other package that olsgreen/oauth2-sage-business-cloud for the PHP Leagues oAuth2 Client package.

Examples

Creating a basic Contact

    $sage = new \Olsgreen\SageBusinessCloud\Accounting\Client([
        'access_token' => 'your_acess_token'
    ]);

    $contact = $sage->contacts()->create('Peter Jones', ['CUSTOMER']);

    // [
    //     "id" => "4d63c58e4a8943ff81a5b1809b98e58a",
    //     "displayed_as" => "Peter Jones",
    //     "$path" => "/contacts/4d63c58e4a8943ff81a5b1809b98e58a",
    //     "created_at" => "2021-08-10T15:57:42Z",
    //     "updated_at" => "2021-08-10T15:57:42Z",
    //     ...
    // ]

Endpoint Support

Sage Business Cloud Accounting has numerous endpoints, we have only implemented a limited number so far:

✅ Contacts

✅ Contact Payments

✅ Contact Allocations

✅ Contact Types

✅ Countries

✅ Sales Invoices

✅ Purchase Invoices

✅ Transaction Types

✅ Tax Rates

✅ Journals

➖ Ledger Accounts

➖ Bank Accounts

➖ User

See the API Reference for a full list.

License

See attached license file

Contributions

Pull requests welcome 🙂