vleks/bol-plaza-sdk

A PHP client SDK for the Bol.com Plaza API


Keywords
api, client, sdk, bol, plaza, Bol.com, vleks, adena, bol-com, bolcom, composer, php, plaza-sdk, psr-1, psr-2, psr-4
License
MIT

Documentation

Bol.com Plaza SDK for PHP

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock

Installation

It's recommended that you use Composer to install the SDK.

composer require vleks/bol-plaza-sdk

This will install the Bol.com Plaza SDK.
PHP 5.6 or newer is required.

Usage

Create an index.php file with the following contents:

<?php
use Vleks\BolPlazaSDK\Client;
use Vleks\BolPlazaSDK\ClientException;

require 'vendor/autoload.php';

$publicKey  = '-- YOUR PUBLIC KEY --';
$privateKey = '-- YOUR PRIVATE KEY --';

$bolPlazaClient = new Client($publicKey, $privateKey);
$bolPlazaClient->setTestMode(true);

try {
    $orders = $bolPlazaClient->getOrders();

    var_dump($orders);
} catch (ClientException $clientException) {
    echo 'An error occurred: ' . $clientException->getMessage();
}

See the contents of the examples directory for more information.

Coverage

Not every Bol.com Plaza API endpoint is covered, check out the table for more details

API Endpoint Covered Client method
PUT /offers/v2/
GET /offers/v2/_parameters_
GET /offers/v2/export/
GET /offers/v2/export/_generated-file.csv_
DELETE /offers/v2/
GET /commission/v2/_parameters_
GET /reductions Yes getReductions
GET /reductions/latest Yes getLatestReductionsFilename
GET /services/rest/orders/v2 Yes getOrders
GET /services/rest/orders/v2/_order-id_
GET /services/rest/shipments/v2
GET /services/rest/shipments/v2/_shipment-id_
PUT /services/rest/transports/v2/_:id_
GET /services/rest/process-status/v2/_:id_
GET /services/rest/purchasable-shipping-labels/v2?orderItemId=_:id_
GET /services/rest/transports/v2/_:transportId_/shipping-label/_:shippingLabelId_
GET /services/rest/return-items/v2/unhandled
PUT /services/rest/return-items/v2/_:id_/handle
GET /services/rest/invoices Yes getInvoices
GET /services/rest/invoices/:invoice-id Yes getInvoice
GET /services/rest/invoices/_invoice-id_/specification Yes getInvoiceSpecification
GET /services/rest/inbounds Yes getInbounds
POST /services/rest/inbounds Yes createInbound
GET /services/rest/inbounds/fbb-transporters Yes getFbbTransporters
GET /services/rest/inbounds/delivery-windows Yes getDeliveryWindow
GET /services/rest/inbounds/_inbounds-id_ Yes getInbound
POST /services/rest/inbounds/productlabels Yes getProductlabels
GET /services/rest/inbounds/_inbound-id_/shippinglabel Yes getShippingLabel
GET /services/rest/inbounds/inbound-id/packinglistdetails Yes getPackingListDetails
GET /services/rest/inventory/parameters Yes getInventory

Tests

To execute the test suite, you'll need PHPUnit.

$ phpunit

License

The Bol.com Plaza SDK for PHP is licensed under the MIT licence.
See the license file for more information.