Download the PHP package printcart/php-printcart-sdk without Composer
On this page you can find all versions of the php package printcart/php-printcart-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-printcart-sdk
PHP Printcart SDK
PHPPrintcart is a simple SDK implementation of Printcart API. It helps accessing the API in an object oriented way.
Installation
Install with Composer
Requirements
PHPPrintcart uses Guzzle extension for handling http calls. So you need to have the guzzlehttp extension installed and enabled with PHP.
However if you prefer to use any other available package library for handling HTTP calls, you can easily do so by modifying 1 line in each of the
get()
,post()
,put()
,delete()
methods inPHPPrintcart\GuzzleRequest
class.
How to get the permanent access token for a shop?
There is a AuthHelper class to help you getting the permanent access token from the shop using oAuth.
Get the PrintcartSDK Object
You can provide the configuration as a parameter while instantiating the object (if you didn't configure already by calling config()
method)
Now you can do get()
, post()
, put()
, put_batch()
, delete()
, delete_batch()
calling the resources in the object oriented way. All resources are named as same as it is named in printcart API reference. (See the resource map below.)
All the requests returns an array (which can be a single resource array or an array of multiple resources) if succeeded. When no result is expected (for example a DELETE request), an empty array will be returned.
-
Get all product list (GET request)
-
Get count of total products (GET request)
-
Get any specific product with ID (GET request)
- Create a new product (POST Request)
Note that you don't need to wrap the data array with the resource key (
order
in this case), which is the expected syntax from Printcart API. This is automatically handled by this SDK.
-
Update a product (PUT Request)
-
Update multiple products (PUT Request)
-
Remove a product (DELETE request)
-
Remove multiple products (DELETE request)
- Remove a Webhook (DELETE request)
The child resources can be used in a nested way.
You must provide the ID of the parent resource when trying to get any child resource
- For example, get the designs of a product (GET request)
Reference
Paid Support
You can hire the author of this SDK for setting up your project with PHPPrintcart SDK.