for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Inktale\Api;
use Inktale\Api\Exceptions\InktaleApiException;
use Inktale\Api\Structures\ProductItem;
use Inktale\Api\Structures\StoreItem;
class Inktale
{
/** @var InktaleApiClient */
private $api;
/**
* @param InktaleApiClient|null $apiClient
*/
public function __construct(InktaleApiClient $apiClient = null)
$this->api = $apiClient ?: new InktaleApiClient;
}
* Set api key to be used for next requests
*
* @param string|null $apiKey
public function setApiKey($apiKey)
$this->api->setApiKey($apiKey);
* Create a new store and retrieve the api key. This request does not require an api key to be set
* @param string $email
* @param string $name
* @return StoreItem
* @throws InktaleApiException
public function createStore($email, $name)
$response = $this->api->post('store', [
'email' => $email,
'name' => $name,
]);
return StoreItem::fromArray($response['store']);
* Fetch list of available products that artwork can be created on
* @return ProductItem[]
public function getProducts()
$response = $this->api->get('products');
$re = [];
foreach ($response['products'] as $v) {
$re[] = ProductItem::fromArray($v);
return $re;