Datajet.IO Client for PHP
The package is available on Packagist. Autoloading is PSR-4 compatible.
{
"require": {
"dafiti/datajet-client": "dev-master"
}
}
$config = [
'hawk' => [
'import_key' => '<your-key>',
'search_key' => '<your-key>'
]
];
$client = \Dafiti\Datajet\Client::create($config);
All returned data is an array.
$products = [
[
'id' => '1',
'title' => 'Product',
'payload' => [
'some' => 'thing'
],
'brand' => [
'id' => '2',
'name' => 'Dafiti',
'slug' => 'dafiti'
],
'attributes' => [
'color' => 'black'
],
'price' => [
'current' => 100.00,
'previous' => 200.00,
'currency' => 'BRL'
],
'sku' => 'APCC',
'published_at' => date('Y-m-d H:i:s'),
'stock_count' => 3
]
];
$client->product->import($products);
Please see Datajet.IO docs: https://github.com/datajet-io/docs/wiki
$search = [
'q' => 'shoe',
'filters' => [
'brand.id' => ['1']
],
'size' => 10,
'page' => 1
];
$client->product->search($search);
Please see Datajet.IO docs: https://github.com/datajet-io/docs/wiki
$client->product->delete($id);
Please see Datajet.IO docs: https://github.com/datajet-io/docs/wiki
MIT License