Wrapper for the QuickFile API.
No validation is provided by this library.
- PHP 8.0 and later
- Guzzle HTTP 7.4 and later
- ext-json
You can install the library by using Composer, and using the following command:
composer require roseblade/quickfile-php-sdk
Then use the Composer autoload library to get started:
require_once('vendor/autoload.php');
If you don't wish to use Composer, or are unable to, you can download the latest release and include the init.php
file:
require_once('/path/to/roseblade/quickfile-php-sdk/init.php');
Don't forget to download and install Guzzle.
We've included an example PHP file for you to get started in /example/index.php
.
To get started, you will need to set the API credentials, available within your QuickFile account.
$creds = [
'AccountNumber' => 6131400000,
'APIKey' => '000AA000-AAAA-0000-A',
'ApplicationID' => '00000000-AAAA-AAAA-AAAA-00AA00AA00AA'
];
\QuickFile\QuickFile::config($creds);
or individually
\QuickFile\QuickFile::setAccountNumber($creds['AccountNumber']);
\QuickFile\QuickFile::setAPIKey($creds['APIKey']);
\QuickFile\QuickFile::setApplicationID($creds['ApplicationID']);
Each function can be accessed through it's own class, for example, for a client\search, you would use:
\QuickFile\Client::search([
// Search Data
]);
And for invoice\create
\QuickFile\Invoice::create([
// Invoice Data
]);
These all match up with the API endpoints found in the QuickFile API documentation, replacing the underscore with the function name.
For example:
Client_Search
>\QuickFile\Client::search();
Project_TagCreate
>\QuickFile\Project::tagCreate();
Supplier_Create
>\QuickFile\Supplier::create();
All header information is populated for you. You need to supply everything as part of the body as per the documentation on the QuickFile site.
The QuickFile Partner API allows developers to make their tools available to third parties through the QuickFile Marketplace. This involves generating an app on their account so you have the correct API endpoint access.
The set up is similar to that of the individual API above:
$creds = [
'AccountNumber' => 6131400000,
'Token' => 'ABCD1234',
'ProductKey' => '00000000-AAAA-AAAA-AAAA-00AA00AA00AA',
'SecretKey' => '00000000-AAAA-AAAA-AAAA-00AA00AA00AA'
];
\QuickFile\Partner::config($creds);
or individually
\QuickFile\Partner::setAccountNumber($creds['AccountNumber']);
\QuickFile\Partner::setToken($creds['Token']);
\QuickFile\Partner::setProductKey($creds['ProductKey']);
\QuickFile\Partner::setSecretKey($creds['SecretKey']);
There are several static functions within the Partner
class that can help you streamline the process:
- authenticate(): Returns an array of API Key and ApplicationID.
- setupConfig(): Automatically sets up the QuickFile library with these variables
For example, after configuring the class as above:
\QuickFile\Partner::authenticate();
// Or, specify the returnArray and verifyProduct
// Example below is the default - verify the product and return a bool (rather than array)
\QuickFile\Partner::authenticate(true, false);
// Or be fancy with names variables
\QuickFile\Partner::authenticate(returnArray: true, verifyProduct: false);
This can be combined with the individual API, quickly setting the config by called setupConfig()
and then using the API as normal:
\QuickFile\Partner::setupConfig();
\QuickFile\Invoice::get([
'InvoiceID' => 123456
]);
It uses 1.2 of the JSON API
Function | API Docs |
---|---|
search | Link |
createAccount | Link |
createTransaction | Link |
getAccounts | Link |
getAccountBalances | Link |
Function | API Docs |
---|---|
create | Link |
delete | Link |
get | Link |
insertContacts | Link |
login | Link |
newDirectDebitCollection | Link |
search | Link |
update | Link |
Function | API Docs |
---|---|
upload | Link |
Function | API Docs |
---|---|
acceptDecline | Link |
convertToInvoice | Link |
Function | API Docs |
---|---|
create | Link |
delete | Link |
get | Link |
getPdf | Link |
search | Link |
send | Link |
Function | API Docs |
---|---|
create | Link |
delete | Link |
get | Link |
search | Link |
Function | API Docs |
---|---|
create | Link |
delete | Link |
get | Link |
search | Link |
Function | API Docs |
---|---|
search | Link |
getNominalLedgers | Link |
Function | API Docs |
---|---|
create | Link |
delete | Link |
get | Link |
getPayMethods | Link |
search | Link |
Function | API Docs |
---|---|
tagCreate | Link |
tagDelete | Link |
tagSearch | Link |
Function | API Docs |
---|---|
create | Link |
delete | Link |
get | Link |
search | Link |
Function | API Docs |
---|---|
create | Link |
Function | API Docs |
---|---|
ageing | Link |
balanceSheet | Link |
chartOfAccounts | Link |
profitAndLoss | Link |
vatObligations | Link |
subscriptions | Link |
Function | API Docs |
---|---|
create | Link |
delete | Link |
get | Link |
search | Link |
Function | API Docs |
---|---|
createNote | Link |
searchEvents | Link |
getAccountDetails | Link |
No, this is an unofficial library
The data is always sent using HTTPS, using the Guzzle HTTP library. Guzzle will use cURL, but it's not required. Please see the Guzzle Website for information.
If it's a security bug relating to the API, you can post it to the QuickFile forum. If it's a bug with the library, please open an issue. If it's a security issue, please contact us through our website before posting it publicly.
QuickFile operates a scheme called API Partners:
As an API Partner we provide you with a framework you can use so you can tell other users about your API product
Check out their user guide for more info.
It works by you having access to a secret key which can be combined with a user's account number and token (from the QuickFile marketplace). This generates an App ID and provides you with their API key so you can then interact with their account on their behalf.