subscribepro / subscribepro-php
Subscribe Pro PHP SDK
1.1.6
2023-12-06 21:29 UTC
Requires
- php: >=7.1
- ext-json: *
- guzzlehttp/guzzle: ~6.5.8|^7.4.5
Requires (Dev)
- monolog/monolog: ~1.27|~2.8|~3.2
- phpunit/phpunit: ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.9.4
- 0.9.3.1
- 0.9.3
- 0.9.2
- dev-56-connect-timeout-and-exception-surface
- dev-fix/php84-implicit-nullable-parameters
- dev-175-fix-phpstan-errors-level-3
This package is auto-updated.
Last update: 2026-09-02 14:00:45 UTC
README
This is our PHP client library for accessing the Subscribe Pro REST API. Our API documentation is available at https://docs.subscribepro.com/technical/rest-api/.
To learn more about Subscribe Pro you can visit us at https://www.subscribepro.com/.
Composer
You can install our PHP client via Composer. Run the following command:
composer require subscribepro/subscribepro-php
To use the PHP client, use Composer's autoload:
require_once('vendor/autoload.php');
Clean up code style
With php-cs-fixer v3.x installed, run this in project folder:
php-cs-fixer fix
Running the tests
With dev dependencies installed via composer (these will install phpunit >= 9.5), run this:
vendor/bin/phpunit
Getting Started
Simple usage looks like (example fetching a list of products):
<?php use SubscribePro\Sdk; // Set credentials $clientId = 'XXXX'; $clientSecret = 'XXXX'; // Set log message format $messageFormat = "SUBSCRIBE PRO REST API Call: {method} - {uri}\nRequest body: {req_body}\n{code} {phrase}\nResponse body: {res_body}\n{error}\n"; // Create SDK object // Setup with Platform API base url and credentials from Magento config $sdk = new Sdk([ 'client_id' => $clientId, 'client_secret' => $clientSecret, 'logging_enable' => true, 'logging_file_name' => 'var/log/subscribe_pro_api.log', 'logging_message_format' => $messageFormat, 'api_request_timeout' => 60, ]); $products = $sdk ->getProductService() ->loadProducts(['sku' => 'SOME-EXAMPLE-SKU']);