productflowbv/php-client

PHP Client for ProductFlow API.

v0.2.7 2023-10-23 09:55 UTC

This package is auto-updated.

Last update: 2024-05-23 11:17:50 UTC


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();