Download the PHP package predictflow/sdk without Composer
On this page you can find all versions of the php package predictflow/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download predictflow/sdk
More information about predictflow/sdk
Files in predictflow/sdk
Package sdk
Short Description Official PHP SDK for PredictFlow - demand forecasting, inventory intelligence, and pricing optimization for Shopify and WooCommerce stores
License MIT
Homepage https://predictflow.co
Informations about the package sdk
PredictFlow PHP SDK
The official PHP SDK for PredictFlow — demand forecasting, inventory intelligence, and pricing optimization for Shopify and WooCommerce stores.
Installation
Bring your own HTTP client
This SDK is built against PSR-18 (ClientInterface) and PSR-17 (request/stream factories) rather than depending on Guzzle directly. That matters most inside a WordPress/WooCommerce plugin, where you often want to reuse whatever HTTP stack is already there instead of pulling in a second one.
If you already have a PSR-18 client installed (Guzzle, Symfony HttpClient, etc.), it's discovered automatically via php-http/discovery - you don't need to configure anything. If not, install one:
Or pass your own explicitly (see examples/04_custom_http_client.php):
Quickstart
Resources
| Resource | Covers |
|---|---|
$client->stores |
Connect/manage stores, trigger syncs, import CSV catalogs and orders |
$client->products |
Catalog, inventory health, ABC analysis, forecasting, cost/margin, competitor prices |
$client->predictions |
Simulation, stockout risk, and inventory policy for an existing forecast |
$client->analytics |
KPIs, revenue trends, day-of-week seasonality, product growth, projections |
$client->pricing |
Elasticity, optimization, simulation, cross-elasticity, batch repricing |
$client->scenarios |
What-if scenario planning and side-by-side comparisons |
$client->alerts |
Alert rules, templates, and evaluation history |
$client->exports |
CSV/XLSX/PDF exports — returns a FileDownload (raw bytes + filename), not JSON |
See examples/ for runnable scripts covering each of these.
Error handling
Every non-2xx response raises a specific PredictFlowException subclass, never a bare PSR-18 exception. One deliberate gap: there's no separate TimeoutException. PSR-18 doesn't standardize a portable way to distinguish "timed out" from other transport failures across different client implementations, so both surface as ConnectionException - shipping a TimeoutException that would never actually fire felt worse than not having one.
Client options
Every resource method also accepts a per-call maxRetries where relevant - e.g. pass maxRetries: 1 to opt a specific POST call into retries if you know that particular endpoint is safe to retry (see Retries below).
Retries
GET/PUT/DELETE retry automatically on 429/5xx and transport-level failures, with backoff. POST/PATCH don't, by default - they aren't guaranteed idempotent, and retrying one whose response was lost after the server already processed it (a sync trigger, a CSV import, a forecast run) risks duplicate side effects. Pass maxRetries explicitly on a specific call if you know it's safe.
Changelog
See CHANGELOG.md.
Contributing
See CONTRIBUTING.md.
Security
See SECURITY.md — please don't open a public issue for a vulnerability.
License
MIT © PredictFlow
All versions of sdk with dependencies
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
php-http/discovery Version ^1.19