PHPackages                             vanilo/cloud-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. vanilo/cloud-sdk

ActiveLibrary[API Development](/categories/api)

vanilo/cloud-sdk
================

SDK for Vanilo Cloud API

0.8.0(1y ago)21.7k1MITPHPPHP ^8.1CI passing

Since Jan 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vaniloecc/vcl-php-sdk)[ Packagist](https://packagist.org/packages/vanilo/cloud-sdk)[ RSS](/packages/vanilo-cloud-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (10)Used By (0)

Vanilo Cloud PHP SDK
====================

[](#vanilo-cloud-php-sdk)

[![Tests](https://camo.githubusercontent.com/7222a6a574e928b7820122b5d2f45724be34f9806275d5a92c8d35f3f9e48057/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76616e696c6f6563632f76636c2d7068702d73646b2f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/vaniloecc/vcl-php-sdk/actions?query=workflow%3Atests)[![Packagist version](https://camo.githubusercontent.com/f9d52ea1d402dfcc33e3775efb184605320c69e99e20e903cfc7902e8113d25f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616e696c6f2f636c6f75642d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vanilo/cloud-sdk)[![Packagist downloads](https://camo.githubusercontent.com/219a8460b49d0f3c12c2ae00ccc5c1480afeef13dba52efb3169fac535df22f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76616e696c6f2f636c6f75642d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vanilo/cloud-sdk)[![StyleCI](https://camo.githubusercontent.com/5b1fe24d304979b53e3e4c34123ac89e008dc362a287bcc66fcc31df77f425ed/68747470733a2f2f7374796c6563692e696f2f7265706f732f3538383637393130342f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/588679104)[![MIT Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package provides a PHP SDK for interacting with the [Vanilo Cloud REST API](https://vanilo.cloud/docs/api/).

[![Vanilo Cloud PHP Code Sample](vcl_code_sample.jpg)](vcl_code_sample.jpg)

Installation
------------

[](#installation)

> The minimum requirement of this package is PHP 8.1.

To install this library in your application, use composer:

```
composer require vanilo/cloud-sdk
```

Usage
-----

[](#usage)

### Authentication

[](#authentication)

To connect to the Vanilo Cloud API, you'll need your Shop's URL, a `client_id` and a `client_secret`.

The following code returns an API client instance:

```
$api = VaniloCloud\ApiClient::for('https://your.v-shop.cloud')->withCredentials('client id', 'client secret');
```

> Under the hood, the SDK will fetch auth tokens from the API in order to minimize the number of occasions when the `client_id` and `client_secret` are being sent over the wire.

To connect to the generic Sandbox environment use:

```
$api = VaniloCloud\ApiClient::sandbox();
```

> Vanilo Cloud Sandbox is available at:
> The sandbox database is reset every 30 minutes

#### HTTP Basic Auth

[](#http-basic-auth)

If your Vanilo Cloud shop instance is protected with basic authentication, then use the `withBasicAuth('user', 'pass')` method to pass the basic http auth credentials:

```
ApiClient::for('https://your.shop.url')
    ->withBasicAuth('user', 'pass') // withCredentials('client id', 'client secret');
```

### Token Store

[](#token-store)

In order to effectively use the token authentication, and to avoid rate limiting exceptions, it's highly recommended to use a persistent token store.

When you have the APC extension installed and enabled, then you have nothing to do, everything is handled for you behind the scenes.

If you use this library in a Laravel Application, then the best is when you use the built-in Laravel Cache token store, that utilizes the configured cache for temporarily storing the auth tokens:

```
$api = VaniloCloud\ApiClient::for('https://your.v-shop.cloud')
    ->withCredentials('client id', 'client secret')
    ->useLaravelTokenStore();
```

### Retrieve Raw Responses

[](#retrieve-raw-responses)

If you need to obtain the raw HTTP response from the API, you need to call the `rawGet`, `rawPost`, etc methods:

```
$api = VaniloCloud\ApiClient::sandbox();
$api->rawGet('/taxonomies');
//=> Illuminate\Http\Client\Response {#2743
//     +cookies: GuzzleHttp\Cookie\CookieJar {#2725},
//     +transferStats: GuzzleHttp\TransferStats {#2765},
```

To obtain the contents of the API call, use `json()` method of the returned response:

```
$response = $api->rawGet('/taxonomies');
foreach ($response->json('data') as $taxonomy) {
    echo $taxonomy['name'];
}
// Category
```

### Taxonomies

[](#taxonomies)

To fetch a taxonomy by id:

```
$api = VaniloCloud\ApiClient::sandbox();
$taxonomy = $api->taxonomy(1);
// => VaniloCloud\Models\Taxonomy
//     id: "1",
//     name: "Category",
//     slug: "category",
//     created_at: "2022-12-06T16:23:34+00:00",
//     updated_at: "2023-01-13T08:03:29+00:00"
```

### Products

[](#products)

To fetch a product by sku:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->product('WBB-030');
// => VaniloCloud\Models\Product
//     name: "William Black Bookshelf"
//     slug: "william-black-bookshelf"
//     sku: "WBB-030"
//     ...
```

To fetch the list of products:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->products();
// Illuminate\Support\Collection {
//  #items: array:2 [▼
//    1 => VaniloCloud\Models\Product
//    ...
//  ]
// ...
```

To create a product:

```
use VaniloCloud\Enums\ProductState;
use VaniloCloud\WriteModels\ProductCreate;

$api = VaniloCloud\ApiClient::sandbox();

$productCreate = new ProductCreate();
$productCreate
    ->setName('William Black Bookshelf')
    ->setSku('WBB-030')
    ->setState(ProductState::ACTIVE);

$api->createProduct($productCreate);
// "WBB-030"
```

To update a product by sku:

```
use VaniloCloud\WriteModels\ProductUpdate;

$api = VaniloCloud\ApiClient::sandbox();

$productUpdate = new ProductUpdate();
$productUpdate
    ->setName('William Black Bookshelf 030')
    ->setStock(1337)
    ->setDescription('A black bookshelf.');

$api->updateProduct('WBB-030', $productUpdate);
// true
```

To delete a product by sku:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->deleteProduct('WBB-030');
// true
```

### Master Products

[](#master-products)

To fetch a master product by id:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->masterProduct(1);
// => VaniloCloud\Models\MasterProduct
//     name: "My Master Product"
//     slug: "my-master-product"
//     price: 1
//     ...
```

To fetch the list of master products:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->masterProducts();
// Illuminate\Support\Collection {
//  #items: array:2 [▼
//    1 => VaniloCloud\Models\MasterProduct
//    ...
//  ]
// ...
```

To create a master product:

```
use VaniloCloud\Enums\ProductState;
use VaniloCloud\WriteModels\MasterProductCreate;

$api = VaniloCloud\ApiClient::sandbox();

$masterProductCreate = new MasterProductCreate();
$masterProductCreate
    ->setName('My Master Product');

$api->createMasterProduct($masterProductCreate);
// "1"
```

To update a master product by id:

```
use VaniloCloud\WriteModels\MasterProductUpdate;

$api = VaniloCloud\ApiClient::sandbox();

$masterProductUpdate = new MasterProductUpdate();
$masterProductUpdate
    ->setDescription('This is my Master Product.');

$api->updateMasterProduct(1, $masterProductUpdate);
// true
```

To delete a master product by id:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->deleteMasterProduct(1);
// true
```

### Orders

[](#orders)

To fetch an order by id:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->order(1);
// => VaniloCloud\Models\Order
//     number: "6YP-0K1A-BO06"
//     status:  VaniloCloud\Enums\OrderStatus { ...
//     fulfillment_status: VaniloCloud\Enums\FulfillmentStatus { ...
//     ...
```

To fetch the list of orders

```
$api = VaniloCloud\ApiClient::sandbox();

$api->orders();
// Illuminate\Support\Collection {
//  #items: array:2 [▼
//    1 => VaniloCloud\Models\Order
//    ...
//  ]
// ...
```

To create an order:

```
use VaniloCloud\Enums\ProductType;
use VaniloCloud\WriteModels\OrderCreate;
use VaniloCloud\WriteModels\BillpayerWrite;
use VaniloCloud\WriteModels\OrderItemWrite;

$api = VaniloCloud\ApiClient::sandbox();

$billpayerWrite = new BillpayerWrite();

$billpayerWrite
    ->setEmail('john@doe.com')
    ->setFirstName('John')
    ->setLastName('Doe')
    ->setCountry('GB')
    ->setCity('London')
    ->setAddress('Oxford Street');

$orderCreate = new OrderCreate();

$orderItem1 = new OrderItemWrite();
$orderItem1
    ->setName('Order item 1')
    ->setProductId(1)
    ->setProductType(ProductType::default())
    ->setPrice(4);

$orderItem2 = new OrderItemWrite();
$orderItem2
    ->setName('Order Item 2')
    ->setProductType(ProductType::default())
    ->setProductId(2)
    ->setPrice(2.4);

$orderItems = [$orderItem1, $orderItem2];

$orderCreate
    ->setBillpayer($billpayerWrite)
    ->setItems(...$orderItems);

$api->createOrder($orderCreate);
// "1"
```

To update an order by id:

```
use VaniloCloud\WriteModels\OrderUpdate;
use VaniloCloud\Enums\OrderStatus;

$api = VaniloCloud\ApiClient::sandbox();

$orderUpdate = new OrderUpdate();
$orderUpdate
    ->setStatus(OrderStatus::PROCESSING);

$api->updateOrder(1, $orderUpdate);
// true
```

To delete an order by id:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->deleteOrder(1);
// true
```

### Customers

[](#customers)

To fetch a customer by id:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->customer(1);
// => VaniloCloud\Models\Customer {#4804
//      default_shipping_address_id: ? ?string,
//      default_billing_address_id: ? ?string,
//      type: VaniloCloud\Enums\CustomerType {#4817
//          name: "ORGANIZATION",
//          value: "organization",
//      },
//      name: "Acme. Inc.",
//      ...
```

To fetch the list of customers

```
$api = VaniloCloud\ApiClient::sandbox();

$api->customers();
// Illuminate\Support\Collection {#4807
//  #items: array:2 [
//    1 => VaniloCloud\Models\Customer
//    ...
//  ]
// ...
```

To create a customer:

```
use VaniloCloud\Enums\CustomerType;
use VaniloCloud\WriteModels\CustomerCreate;

$api = VaniloCloud\ApiClient::sandbox();

$customerCreate = new CustomerCreate()
    ->setCompanyName('Acme. Inc.');

$api->createCustomer($customerCreate);
// "1"
```

To update a customer by id:

```
use VaniloCloud\WriteModels\CustomerUpdate;

$api = VaniloCloud\ApiClient::sandbox();

$customerUpdate = new CustomerUpdate();
$customerUpdate
    ->setCompanyName('Globex Corporation');

$api->updateCustomer(1, $customerUpdate);
// true
```

To delete a customer by id:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->deleteCustomer(1);
// true
```

### Addresses

[](#addresses)

To fetch an address by id:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->address(1);
// => VaniloCloud\Models\Address {#4635
//      type: VaniloCloud\Enums\AddressType {#4662
//      name: "PICKUP"
//      value: "pickup"
//    }
//    name: "Jane Doe"
//    firstname: "Jane"
//    lastname: "Doe"
//    ...
```

To update an address by id:

```
use VaniloCloud\WriteModels\AddressUpdate;

$api = VaniloCloud\ApiClient::sandbox();

$addressUpdate = new AddressUpdate();
$addressUpdate
    ->setName('John Doe');

$api->updateAddress(1, $addressUpdate);
// true
```

To delete an address by id:

```
$api = VaniloCloud\ApiClient::sandbox();

$api->deleteAddress(1);
// true
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance43

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60.6% 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 ~93 days

Recently: every ~116 days

Total

9

Last Release

452d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3653935?v=4)[Vanilo](/maintainers/vanilo)[@Vanilo](https://github.com/Vanilo)

---

Top Contributors

[![fulopattila122](https://avatars.githubusercontent.com/u/1162360?v=4)](https://github.com/fulopattila122 "fulopattila122 (66 commits)")[![molnarerwin](https://avatars.githubusercontent.com/u/58359015?v=4)](https://github.com/molnarerwin "molnarerwin (30 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (13 commits)")

---

Tags

apie-commercevanilovanilo cloud

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vanilo-cloud-sdk/health.svg)

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

###  Alternatives

[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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