Download the PHP package codeswholesale-v3/sdk without Composer
On this page you can find all versions of the php package codeswholesale-v3/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codeswholesale-v3/sdk
More information about codeswholesale-v3/sdk
Files in codeswholesale-v3/sdk
Package sdk
Short Description A PHP wrapper for CodesWholesale API v3
License GPL-3.0-only
Homepage https://github.com/fefrik/codeswholesale-v3
Informations about the package sdk
🌍 Languages:
Česky
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 8.3+
✅ No framework required
✅ Automatic OAuth authentication
✅ Safe pagination (resume using continuation token)
✅ Designed for long-running syncs and cron jobs
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:
➡️ https://github.com/sponsors/fefrik
Thank you — even a small contribution keeps the project going! 🚀
Requirements
- PHP 8.3+
- cURL extension
- JSON extension
Installation
Basic Usage
Creating the Client and SDK
Architecture Overview
Client
- Handles HTTP communication, OAuth2, retries, and errors
- Always returns
stdClass
Endpoint
- Represents a REST API group (
/v3/products,/v3/orders, …) - Converts responses into Resource objects
Resource
- Immutable DTO: input data and
raw()are defensively copied - Strict typed getters; invalid API field types throw
ResourceMappingException DateTimeImmutableaccessors preserve timezone information- Nested collections offer memory-efficient
iterate*()generators - Stable values such as code type are represented by PHP enums
- No filesystem or HTTP side effects
SDK Contents (by API area)
Products
- List products (paged, resumable)
- Fetch product details
- Fetch product descriptions
- Fetch product images
- Safe synchronization for large catalogs (50k+ products)
Orders
- Create orders
- Fetch order history
- Fetch order details
- Extract license keys from completed orders
Codes (License Keys)
- Fetch ordered license keys
- Write image-based codes through
ImageCodeWriter - Base64 image handling
Account
- Fetch account balance
- Fetch account details
Security
- Fraud / risk checks
- IP and domain reputation
- Risk score evaluation
Metadata
- Platforms
- Regions
- Languages
- Territories
Products
Fetching a single page of products
Iterating over all products
Memory-efficient streaming
For large catalogs, prefer the generator. It keeps only the current API page in
memory and yields one ProductItem at a time:
For resumable jobs, configure a ContinuationTokenStorageInterface and use
iterateWithContinuationStorage(). A token is checkpointed only after the
complete page has been consumed, so stopping the loop cannot skip products from
the unfinished page.
Resource collections and dates
Array getters remain available for convenience. For larger nested collections, use their generator counterparts:
Product descriptions expose structured LocalizedTitleItem, FactSheetItem,
PhotoItem, VideoItem, and ReleaseItem objects instead of untyped values.
raw() returns a deep copy and cannot mutate the resource.
Image codes are written by a separate service:
CodeItem::saveImageBase64() remains as a deprecated compatibility wrapper.
Product Synchronization (recommended)
Safe and resumable synchronization using continuation tokens.
✔ Safe for web requests
✔ Safe for cron jobs
✔ Continues exactly where it stopped
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.