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

ActiveLibrary[API Development](/categories/api)

codeswholesale-v3/sdk
=====================

A PHP wrapper for CodesWholesale API v3

v1.4.3(3mo ago)010GPL-3.0-onlyPHPPHP &gt;=7.4CI passing

Since Dec 29Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/fefrik/codeswholesale-v3)[ Packagist](https://packagist.org/packages/codeswholesale-v3/sdk)[ Docs](https://github.com/fefrik/codeswholesale-v3)[ GitHub Sponsors](https://github.com/fefrik)[ RSS](/packages/codeswholesale-v3-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (36)Used By (0)

🌍 **Languages:**
[English](README.md) | [Česky](README.cs.md)

CodesWholesale PHP SDK
======================

[](#codeswholesale-php-sdk)

PHP SDK for working with the **CodesWholesale API v3**(products, orders, license keys, synchronization, security).

Designed for real-world e‑commerce integrations and long-running background jobs.

✅ PHP 7.4+
✅ No framework required
✅ Automatic OAuth authentication
✅ Safe pagination (resume using continuation token)
✅ Designed for long-running syncs and cron jobs

---

Support This Project ❤️
-----------------------

[](#support-this-project-️)

This project is **free and open-source** and will always remain so.

If it helps you save time or ship faster, you can support ongoing maintenance via GitHub Sponsors:

➡️

Thank you — even a small contribution keeps the project going! 🚀

---

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

[](#requirements)

- PHP **7.4+**
- **cURL** extension
- **JSON** extension

---

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

[](#installation)

```
composer require codeswholesale-v3/sdk
```

---

Basic Usage
-----------

[](#basic-usage)

### Creating the Client and SDK

[](#creating-the-client-and-sdk)

```
use CodesWholesaleApi\Api\Client;
use CodesWholesaleApi\Config\Config;
use CodesWholesaleApi\Sdk;

$oauthStorage = new FileStorage(__DIR__ . '/oauth_token.json');

$client = new Client(
    new Config('https://api.codeswholesale.com'),
    $oauthStorage,
    'CLIENT_ID',
    'CLIENT_SECRET'
);

$sdk = new Sdk($client);
```

---

Architecture Overview
---------------------

[](#architecture-overview)

```
Client
 └── Endpoint (Products, Orders, Codes, …)
       └── Resource (ProductItem, OrderItem, …)

```

### Client

[](#client)

- Handles HTTP communication, OAuth2, retries, and errors
- **Always returns `stdClass`**

### Endpoint

[](#endpoint)

- Represents a REST API group (`/v3/products`, `/v3/orders`, …)
- Converts responses into **Resource objects**

### Resource

[](#resource)

- Immutable DTO (read‑only)
- Typed getters
- No business logic

---

SDK Contents (by API area)
--------------------------

[](#sdk-contents-by-api-area)

### Products

[](#products)

- List products (paged, resumable)
- Fetch product details
- Fetch product descriptions
- Fetch product images
- Safe synchronization for large catalogs (50k+ products)

### Orders

[](#orders)

- Create orders
- Fetch order history
- Fetch order details
- Extract license keys from completed orders

### Codes (License Keys)

[](#codes-license-keys)

- Fetch ordered license keys
- Download text or image-based codes
- Base64 image handling

### Account

[](#account)

- Fetch account balance
- Fetch account details

### Security

[](#security)

- Fraud / risk checks
- IP and domain reputation
- Risk score evaluation

### Metadata

[](#metadata)

- Platforms
- Regions
- Languages
- Territories

---

Products
--------

[](#products-1)

### Fetching a single page of products

[](#fetching-a-single-page-of-products)

```
$page = $sdk->products()->getPage([
    'updatedSince' => '2024-01-01T00:00:00Z'
]);

foreach ($page['items'] as $product) {
    echo $product->getName();
}
```

---

Iterating over all products
---------------------------

[](#iterating-over-all-products)

```
$sdk->products()->getAll(
    function (array $items) {
        foreach ($items as $product) {
            saveProduct($product);
        }
    }
);
```

---

Product Synchronization (recommended)
-------------------------------------

[](#product-synchronization-recommended)

Safe and resumable synchronization using continuation tokens.

```
$runner->runForSeconds(
    fn(ProductItem $p) => upsertProduct($p),
    30
);
```

✔ Safe for web requests
✔ Safe for cron jobs
✔ Continues exactly where it stopped

---

Disclaimer
----------

[](#disclaimer)

This is a **community-maintained integration** and **not an official CodesWholesale product**.

You must use your **own CodesWholesale API key and account**. All trademarks belong to their respective owners.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance78

Regular maintenance activity

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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 ~0 days

Total

35

Last Release

113d ago

Major Versions

0.3.9 → v1.0.02025-12-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/4884bc2fa5fe7e59a2b8506b9621b9b347707fc1ecd94bf19981ac95e00ef11a?d=identicon)[fefrik](/maintainers/fefrik)

---

Top Contributors

[![fefrik](https://avatars.githubusercontent.com/u/1052557?v=4)](https://github.com/fefrik "fefrik (6 commits)")

---

Tags

apicodeswholesalegamescd-keys

### Embed Badge

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

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

###  Alternatives

[codeswholesale/sdk

A PHP wrapper for CodesWholesale's API

3550.3k1](/packages/codeswholesale-sdk)[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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