productflowbv / php-client
PHP Client for ProductFlow API.
Installs: 72 402
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 2
Open Issues: 1
Requires
- php: ^7.1|^8.0
- ext-json: *
- guzzlehttp/guzzle: ^6|^7
README
Installation
composer require productflowbv/php-client
Set-up connection
$client = new \ProductFlow\API\Client($companyId, $secret); $productFlow = new \ProductFlow\API\ProductFlow($client);
Products
Get a paginated list of products
$products = $productFlow->product($locale)->setPage(1)->list();
Get a single product
$product = $productFlow->product($locale)->show($sku);
Create or update a product
$productFlow->product($locale)->upsert($sku, ['title' => 'Awesome product']);
Delete an product
$productFlow->product($locale)->delete($sku);
Orders
Get a paginated list of open orders
$orders = $productFlow->order()->setPage(1)->list(['open']);
Get a single order
$order = $productFlow->order()->show($identifier);
Accept a single order
$productFlow->order()->accept($identifier);
Add shipment for an order
$productFlow->shipment()->create($identifier, [ 'identifier' => 'PACK01', 'method' => 'Shipment name', 'track_and_trace' => 'ATRACKANDTRACECODE' ]);
Add cancellation for an order
$productFlow->cancel()->create($identifier, []);
Add note for an order
$productFlow->note()->create($identifier, [ 'message' => 'Sample note for this order', ]);
Offers
Get a paginated list of offers
$productFlow->offer()->setPage(1)->list();
Get a single offer
$productFlow->offer()->show($sku);
Create or update an product offer
$productFlow->offer()->upsert($sku, [ 'title' => 'Awesome product', 'qty_available' => 2, 'proposition' => 'Fast delivery', 'prices' => [ 'EUR' => [ 'sell_price' => 19.95, 'base_price' => 24.95, 'suggested_retail_price' => 29.95, 'purchase_price' => 9.25, 'cost_price' => 4.50 ] ] ]);
Delete an offer
$productFlow->offer()->delete($sku);
Misc
List languages
$languages = $productFlow->language()->list();
List marketplaces
$marketplaces = $productFlow->marketplace()->list();