Download the PHP package rangka/quickbooks without Composer
On this page you can find all versions of the php package rangka/quickbooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rangka/quickbooks
More information about rangka/quickbooks
Files in rangka/quickbooks
Package quickbooks
Short Description Quickbooks' PHP Client
License MIT
Homepage http://rangka.my/quickbooks
Informations about the package quickbooks
Quickbooks
PHP Library for connecting to QuickBooks.
Note: This was done with an AU account. There are differences between regions of Quickbooks Account. If you are using a different region's account and encounter any issue, please make a report of it.
Installation
Install it using composer.
Configuring
To start using this library, you must create an app in the Developer's Dashboard and obtain the client ID and secret.
Add this to the beginning of your app.
SANDBOX
- Usetrue
if this is a development environment. Leave it empty orfalse
for production.OAUTH
- Represents the entire array returned after requesting for access token. This will benull
when you first start out but must be filled after successfully obtaining an access token.realm_id
- This is your company's ID and is required when making API calls. You will obtain this ID on the 2nd step (after user authorizes on Quickbook) of Connecting to Quickbooks.
Connecting to Quickbooks
Quickbooks uses OAuth2 in order to establish an authenticated connection to it. This documentation will not delve too much detail into it and instead will just lay out what you need. Go through the documentation to find out more.
1. Authorization
Redirect user to Quickbooks' login page. Get the URL via;
2. Prepare a redirection page
Reconnect
OAuth have a very limited usage period (usually about 1 hour). In order to refresh the token;
Disconnect
Simply remove all of the Configuration values from your storage.
Usage
Read
To read a resource, initialize its service and call load($id)
on it. Take note not all Service have read capability. Check QB's documentation to know which one does and which one does not; https://developer.intuit.com/v2/apiexplorer?apiname=V3QBO .
Response will be in stdClass
object.
Delete
Deleting a resource is basically the same as loading except calling on delete($id)
instead.
Create
In order to create, you will need to obtain a Builder for the entity you wish for. You can get the Builder instance from its Service. Example given is for Invoice;
Any property can be added by calling set{$propertyName}
. For example setting the amount;
Nested value have two ways to be added. Either straight up arrays via its top-level property or using various helper methods within the Builder.
Straight up array;
Helper methods;
Once you've built up your data, just call create()
.
Upon doing so you Invoice will be created and your Invoice data object will be retured.
Putting it all together;
Note 1: Above example is a non-working solution. Please check Quickbooks' documentation on what are the required fields for each Entity.
Note 2: Builder methods can be chained, except for create()
which will return the created object.
Update
Updating is exactly the same as Create however you will need to set a SyncToken first setSyncToken()
and call update()
instead.
An updated object will be returned by update()
.
Attachment
$files
is an array of associative array. Add more of the associative array to upload more files at the same time.
Note: Not all Entities can have attachments. Currently supported Entity with Attachments is Invoice, Vendor, VendorCredit, Purchase, PurchaseOrder, Transfer, JournalEntry, Deposit, CreditMemo, Estimate, RefundReceipt, SalesReceipt, Bill, Customer and Payment.
Entity-specific Usage
Certain entities have usages beyond the normal CRUD operation.
Attachable
Uploading File
You are allowed to specify multiple Entities per Attachable.
Response upon upload is an array of Attachable objects.
Note: While Attachable can be used directly, its generally not recommended if you wish to upload a single file to a specific entity. Use each respective Services to upload files. Only use this if you wish to upload and link to several entities at once.
Invoice
Send Email
Download PDF
All versions of quickbooks with dependencies
guzzlehttp/guzzle Version ~6.0
guzzlehttp/psr7 Version ~1.0
guzzlehttp/promises Version ~1.0