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

ActiveLibrary[API Development](/categories/api)

codeswholesalev3/sdk
====================

A PHP client library for CodesWholesale's API

1.1(1mo ago)04CC-BY-NC-4.0PHPPHP &gt;=7.4.0

Since Sep 4Pushed 1mo agoCompare

[ Source](https://github.com/proxene/CodesWholesale-PHP)[ Packagist](https://packagist.org/packages/codeswholesalev3/sdk)[ Docs](https://github.com/proxene/CodesWholesale-PHP)[ RSS](/packages/codeswholesalev3-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

CodesWholesale PHP SDK (V3)
===========================

[](#codeswholesale-php-sdk-v3)

[![GitHub Issues](https://camo.githubusercontent.com/ef0e8affc888d616b4381c168403e849d431e5b5f09074dc3f6abd1e0b846a86/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f70726f78656e652f436f64657357686f6c6573616c652d5048502e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/proxene/CodesWholesale-PHP/issues)[![PHP](https://camo.githubusercontent.com/bbeaca4ecdd74d3fde840f711ebb8a5def2ff801187623f9bc365761b3b66f86/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2532333737374242342e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](#)

A simple and lightweight PHP SDK for interacting with the **CodesWholesale API V3**.
Designed in an **object-oriented style** inspired by the V2 SDK, with support for:

Features
--------

[](#features)

- **Authentication &amp; Token Management**

    - Automatic OAuth2 client credentials flow.
    - Token storage via session or custom storage implementation.
    - Automatic token renewal when expired.
- **Product Management**

    - Fetch all products with optional callback handling for large datasets.
    - Retrieve specific products by ID.
    - Access product codes (text or image) through structured objects.
- **Order Management**

    - Create new orders with multiple products.
    - Retrieve orders and their status.
    - Access ordered products as structured objects with codes.
- **Clean, Extensible Architecture**

    - Namespaced classes under `CodesWholesale\Resource` and `CodesWholesale\Storage`.
    - Client class handles all HTTP requests and authentication.
    - Fully object-oriented with typed properties and methods.
    - Exception handling for HTTP and authentication errors.

Requirements
------------

[](#requirements)

- PHP 7.4+
- cURL extension enabled

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

[](#installation)

composer require codeswholesalev3/sdk

Usage
-----

[](#usage)

### 1. Initialize the Client

[](#1-initialize-the-client)

```
use CodesWholesale\Client;
use CodesWholesale\CodesWholesale;
use CodesWholesale\Storage\SessionAuthTokenStorage;
use CodesWholesale\Storage\FileContinuationTokenStorage;

$params = [
    'cw.client_id' => 'your-client-id',
    'cw.client_secret' => 'your-client-secret',
    'cw.endpoint_uri' => CodesWholesale::SANDBOX_ENDPOINT, // or LIVE_ENDPOINT,
    'cw.token_storage' => new SessionAuthTokenStorage()
];

$client = new Client($params);

$continuationStorage = new FileContinuationTokenStorage(__DIR__ . '/last_token.txt');
$continuationToken = $continuationStorage->getContinuationToken();
```

### 2. Retrieve Products

[](#2-retrieve-products)

```
use CodesWholesale\Resource\Product;
use CodesWholesale\Resource\ProductItem;

// Process all products page by page
Product::getAll(
    $client,
    function (array $items, ?string $nextContinuationToken): void {
        foreach ($items as $item) {
            $product = new ProductItem($item);
            echo $product->getName() . PHP_EOL;
        }
    },
    $continuationToken
);

// Get a product by ID
$product = Product::getById($client, 'PRODUCT_ID');
```

 Getter list for products```
    $product->getName();
    $product->getPrices();
    $product->getDefaultPrice();
    $product->getStock();
    $product->getPlatform();
    $product->getRegions();
    $product->getReleaseDate();
```

### 3. Create an order

[](#3-create-an-order)

```
use CodesWholesale\Resource\Order;

$createdOrder = Order::createOrder($client, [
    ['productId' => '6313677f-5219-47e4-a067-7401f55c5a3a', 'quantity' => 2]
]);
```

### 4. Retrieve account details

[](#4-retrieve-account-details)

```
use CodesWholesale\Resource\Account;

$accountDetails = Account::getCurrent($client);
```

 Getter list for the current account```
    $accountDetails->getBalance();
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~34 days

Recently: every ~49 days

Total

7

Last Release

53d ago

Major Versions

0.6.1 → 1.02025-09-12

PHP version history (2 changes)0.1PHP &gt;=7.0.0

1.1PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8831899b835bf5ca694a44ec2a41a4138fb9fd30fc6b35f29243390ab1e799e0?d=identicon)[proxene](/maintainers/proxene)

---

Top Contributors

[![proxene](https://avatars.githubusercontent.com/u/3314028?v=4)](https://github.com/proxene "proxene (33 commits)")

---

Tags

apicloudsecuritycodeswholesalegamescd-keys

### Embed Badge

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

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

###  Alternatives

[codeswholesale/sdk

A PHP wrapper for CodesWholesale's API

3550.3k1](/packages/codeswholesale-sdk)[aimeos/aimeos-headless

Aimeos headless ecommerce system

2.5k2.3k](/packages/aimeos-aimeos-headless)

PHPackages © 2026

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