PHPackages                             sphere/php-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sphere/php-sdk

Abandoned → [commercetools/php-sdk](/?search=commercetools%2Fphp-sdk)ArchivedProject[Utility &amp; Helpers](/categories/utility)

sphere/php-sdk
==============

This Composable Commerce PHP SDK is deprecated effective 1st September 2022. We recommend you to use our new SDK here https://docs.commercetools.com/sdk/php-sdk#php-sdk-v2.

v2.22.0(3y ago)4334422[9 issues](https://github.com/commercetools/commercetools-php-sdk/issues)[10 PRs](https://github.com/commercetools/commercetools-php-sdk/pulls)MITPHPPHP &gt;=5.6

Since Feb 11Pushed 2y ago67 watchersCompare

[ Source](https://github.com/commercetools/commercetools-php-sdk)[ Packagist](https://packagist.org/packages/sphere/php-sdk)[ Docs](https://github.com/commercetools/commercetools-php-sdk)[ RSS](/packages/sphere-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (23)Versions (110)Used By (0)

[![](build/theme/resources/CT_cube_200px.png)](build/theme/resources/CT_cube_200px.png) Composable Commerce PHP SDK
===================================================================================================================

[](#-composable-commerce-php-sdk)

⚠️ \*\*This Composable Commerce PHP SDK is deprecated effective `1st September 2022.`, We recommend to use our [PHP SDK V2](https://docs.commercetools.com/sdk/php-sdk#php-sdk-v2).

[![Build Status](https://camo.githubusercontent.com/a44b5fcef167207963fb4cd8457a66cd57a6c0d86d71d122b298b3033c55b1dc/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f636f6d6d65726365746f6f6c732f636f6d6d65726365746f6f6c732d7068702d73646b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/commercetools/commercetools-php-sdk) [![Scrutinizer](https://camo.githubusercontent.com/13b4e717d8d651d28ff6c829c47d33e383a120200fbcbb3005892b6d28bd9d7f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f636f6d6d65726365746f6f6c732f636f6d6d65726365746f6f6c732d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/commercetools/commercetools-php-sdk/) [![Scrutinizer](https://camo.githubusercontent.com/9b503af2dd99ff98cb21501b90c20ff72cccaf4561dbe51dae0b27e3b8abbb19/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f636f6d6d65726365746f6f6c732f636f6d6d65726365746f6f6c732d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/commercetools/commercetools-php-sdk/) [![Packagist](https://camo.githubusercontent.com/cddd6bbca5c187855091b6d5181b38eb2d97691534afe9ed923f16be73c45d18/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6d6d65726365746f6f6c732f7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/commercetools/php-sdk) [![Packagist](https://camo.githubusercontent.com/13ea778fc1ead5271b48783134d1e6dabdb914b65c11c61cbbd94db995013f6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f636f6d6d65726365746f6f6c732f7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/commercetools/php-sdk)

The PHP SDK allows developers to integrate with Composable Commerce APIs using PHP native interfaces, models and helpers instead of manually using the HTTP and JSON API.

You gain lots of IDE Auto-Completion, type checks on a literal API, Warnings, Object Mapping, i18n support etc.. The Client manages the OAuth2 security tokens, provides caches and interfaces for concurrent and asynchronous API calls.

The SDK is licensed under the permissive [MIT License](LICENSE). Don't hesitate to [contribute](#contribute)!

Using the SDK
-------------

[](#using-the-sdk)

The [PHP API documentation](http://commercetools.github.io/commercetools-php-sdk) provides all the details you need in a searchable form (link points to latest stable release).

### Install &amp; Integrate the SDK into your Project

[](#install--integrate-the-sdk-into-your-project)

The SDK requires a PHP version of 5.6 or higher. The SDK tries to use the APC(u) as it's default cache. If you provide a [PSR-6](https://packagist.org/providers/psr/cache-implementation) or [PSR-16](https://packagist.org/providers/psr/simple-cache-implementation) compliant cache adapter, APC(u) is not necessary. The [cache/filesystem-adapter](https://packagist.org/packages/cache/filesystem-adapter) is tried to be used if no APC(u) is installed.

The curl extension is recommended but not strictly necessary because the SDK is using the [Guzzle library](https://github.com/guzzle/guzzle) library, which falls back to PHP stream wrappers if curl is not available. The intl extension is required to directly output Money objects as a String.

The recommended way to install the SDK is through [Composer](http://getcomposer.org).

```
# Install Composer if not installed yet
curl -sS https://getcomposer.org/installer | php
```

Next, run the Composer command to install the latest version of the SDK:

```
composer require commercetools/php-sdk
```

The SDK supports Guzzle6 as well as Guzzle5 as HTTP client. For Guzzle6:

```
composer require guzzlehttp/guzzle ^6.0
```

When you want to use Guzzle5 you have to ensure react/promise at minimum version 2.2:

```
composer require guzzlehttp/guzzle ^5.3.1
composer require react/promise ^2.2
```

After installing, you need to require Composer's autoloader if that's not yet the case:

```
require 'vendor/autoload.php';
```

If you don't use Composer, just [download a zip archive](https://github.com/commercetools/commercetools-php-sdk/archive/master.zip) of the latest release, manually integrate it and configure your own autoloader.

The project follows the [semantic versioning](http://semver.org) guidelines, i.e. everything but major version changes are backwards-compatible. This matches composer's default behavior.

With composer just run `composer update commercetools/php-sdk` to update to compatible versions. Edit your `composer.json` file to update to incompatible versions.

Please read the [Changelog](CHANGELOG.md) before updating in any case.

### Getting started

[](#getting-started)

To get up and running, create a free test [Project](https://mc.commercetools.com/login/new) on Composable Commerce. You can create your first API Client in [The Merchant Center](https://mc.commercetools.com/) (Menu "Settings"-&gt;"Developer settings"-&gt;"Create new API client"). You need to select the template for the "Admin client".

```
