skuio / sku-sdk
SKU.io User API.
Installs: 131
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 1
Open Issues: 0
Type:project
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- nesbot/carbon: ^2.32
Requires (Dev)
- phpunit/phpunit: 6.*
- dev-master
- v0.6.12.8
- v0.6.12.7
- v0.6.12.6
- v0.6.12.5
- v0.6.12.4
- v0.6.12.3
- v0.6.12.2
- v0.6.12.1
- v0.6.12.0
- v0.6.11.9
- v0.6.11.8
- v0.6.11.7
- v0.6.11.6
- v0.6.11.5
- v0.6.11.4
- v0.6.11.3
- v0.6.11.2
- v0.6.11.1
- v0.6.10.9
- v0.6.10.8
- v0.6.10.7
- v0.6.10.6
- v0.6.10.5
- v0.6.10.4
- v0.6.10.3
- v0.6.10.2
- v0.6.10.1
- v0.6.10
- v0.6.9.17
- v0.6.9.16
- v0.6.9.15
- 0.6.9.12
- v0.6.9.11
- v0.6.9.10
- v0.6.9.2
- v0.6.9.1
- v0.6.9
- v0.6.8.9
- v0.6.8.8
- v0.6.8.7
- v0.6.8.6
- v0.6.8.5
- v0.6.8.1
- v0.6.8
- v0.6.7
- v0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6
- v0.5.2
- v0.5.1
- v0.5
- v0.2.1-beta
- v0.02-beta
- v0.01-beta
This package is auto-updated.
Last update: 2025-04-07 18:55:32 UTC
README
A PHP package to connect to sku.io User API.
Table of contents
Installation
Installation using composer:
composer require skuio/sku-sdk
Usage
-
You need to create or get user API credentials from this APIs User API
This APIs return
{ "key": "f6a9f775f414ecc550a....", "secret": "0a9be418866a453cb9...." }
-
Use this credentials to connect with sku.io user api (
username
,password
). -
Set the SDK configurations:
- username
- password
- environment
you can set
url
ordev_url
if you want to change your testing domains. -
the SDK handle response automatically and you code get the results using these three functions:
getCode()
: returns http response status of i.e (200,500 ..).getResponse()
: returns the JSON format response (response also return errors like validation errors ..etc).getCurlError()
: returns thecurl
error.
Example Usage
Here is an example of a function used to get products from sku.io:
use Skuio\Sdk\Sdk; use Skuio\Sdk\Request; use Skuio\Sdk\Resource\Products; public function getProducts() { Sdk::config( [ 'username' => $username, 'password' => $password, 'environment' => Sdk::DEVELOPMENT ] ); $productsRequest = new Request(); $productsRequest->setConjunction( 'and' ); $productsRequest->addFilter( 'sku', '=', '5333180491623' ); $productsRequest->setLimit( 15 ); $productsRequest->setPage( 1 ); $products = new Products(); $products = $products->get( $productsRequest ); return $products->getResponse(); }
And you can use the base Sdk
class
use Skuio\Sdk\Sdk; public function testConnection() { Sdk::config( [ 'username' => $username, 'password' => $password, 'environment' => Sdk::DEVELOPMENT ] ); $sdk = new Sdk(); $res = $sdk->authorizedRequest( '/vendors' ); return $res->getResponse(); }