PHPackages                             printcart/php-printcart-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. printcart/php-printcart-sdk

ActiveLibrary[API Development](/categories/api)

printcart/php-printcart-sdk
===========================

PHP SDK for Printcart API

v1.1(3y ago)23288MITPHPPHP &gt;=7.0.0

Since Apr 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Printcart/php-printcart-sdk)[ Packagist](https://packagist.org/packages/printcart/php-printcart-sdk)[ Docs](https://github.com/Printcart/php-printcart-sdk)[ RSS](/packages/printcart-php-printcart-sdk/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

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
------------

[](#installation)

Install with Composer

```
composer require printcart/php-printcart-sdk
```

### Requirements

[](#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 in `PHPPrintcart\GuzzleRequest` class.

##### How to get the permanent access token for a shop?

[](#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.

```
$config = array(
    'Username' => 'pcsia_b9a7d6fa332b74bdd073cabbac0e6ee539ed3b361aca0c2f7b9bbfe683430cce',
    'Password' => 'pcsup_02be5f225e8ddb1ff1569cf4bac0c9346c60928394902ab2f193fcd5bfc2657d'
);

PHPPrintcart\PrintcartSDK::config($config);
```

#### Get the PrintcartSDK Object

[](#get-the-printcartsdk-object)

```
$printcart = new PHPPrintcart\PrintcartSDK;
```

You can provide the configuration as a parameter while instantiating the object (if you didn't configure already by calling `config()` method)

```
$printcart = new PHPPrintcart\PrintcartSDK($config);
```

##### 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.)

[](#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)

```
$products = $printcart->Product->get();
```

- Get count of total products (GET request)

```
$products = $printcart->Product->count();
```

- Get any specific product with ID (GET request)

```
$productID = '1b665d2f-5a29-3e03-8698-01e4dc603fa9';
$product = $printcart->Product($productID)->get();
```

- Create a new product (POST Request)

```
$product = array(
    "name" => "T-shirt",
    "dynamic_side" => 1,
    "viewport_width" => 50.5,
    "viewport_height" => 50.5,
    "scale" => 50.5,
    "dpi" => 100,
    "dimension_unit" => "inch",
    "status" => "publish",
    "enable_design" => 1,
    "max_file_upload" => 50,
    "min_jpg_dpi" => 10,
    "allowed_file_types" => [
        "jpg",
        "pdf",
        "png"
    ]
);

$printcart->Product()->post($product);
```

> 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)

```
$updateInfo = array(
    "name" => "T-shirt update",
);

$printcart->Product($productID)->put($updateInfo);
```

- Update multiple products (PUT Request)

```
$updateInfo = array(
    'products' => [
        [
            "id" => "0dcccd18-18e1-4fbf-b26b-234944746ee9",
            "name" => 'T-shirt update'
        ],
        [
            "id" => "41fec099-789e-444e-81d5-a29078f175b6",
            "name" => "Bag update"
        ],
    ]
);

$printcart->Product()->put_batch($updateInfo);
```

- Remove a product (DELETE request)

```
$printcart->Product($productID)->delete();
```

- Remove multiple products (DELETE request)

```
$array = array(
    'products' => [
        [
            "id" => "0dcccd18-18e1-4fbf-b26b-234944746ee9",
        ],
        [
            "id" => "41fec099-789e-444e-81d5-a29078f175b6",
        ],
    ]
);

$printcart->Product()->delete_batch($array);
```

- Remove a Webhook (DELETE request)

```
$webHookID = 12345678;

$printcart->Webhook($webHookID)->delete();
```

### The child resources can be used in a nested way.

[](#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)

```
$productID = '1b665d2f-5a29-3e03-8698-01e4dc603fa9';
$productDesigns = $printcart->Product($productID)->Design->get();
```

Reference
---------

[](#reference)

- [Printcart API Reference](https://docs.printcart.com/rest-api-reference/)

Paid Support
------------

[](#paid-support)

You can hire the author of this SDK for setting up your project with PHPPrintcart SDK.

[Hire at my website](https://printcart.com/)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Total

2

Last Release

1456d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b64274fc06fa3438f02367074584d6c6c4aefa93595c10826a47acd272bcdf4?d=identicon)[dev.printcart](/maintainers/dev.printcart)

---

Top Contributors

[![congbk2910](https://avatars.githubusercontent.com/u/37996592?v=4)](https://github.com/congbk2910 "congbk2910 (23 commits)")[![muathuvang95](https://avatars.githubusercontent.com/u/45276880?v=4)](https://github.com/muathuvang95 "muathuvang95 (2 commits)")[![HiepVu511](https://avatars.githubusercontent.com/u/13346949?v=4)](https://github.com/HiepVu511 "HiepVu511 (1 commits)")

---

Tags

phpapisdkprintPrintcart

### Embed Badge

![Health badge](/badges/printcart-php-printcart-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/printcart-php-printcart-sdk/health.svg)](https://phpackages.com/packages/printcart-php-printcart-sdk)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
