Open source: Bol.com Plaza offer management SDK

I recently had to integrate the new Bol.com offer management API into a project. There was no SDK available, so I had to figure most things out by myself. The library I created was heavily integrated into the existing code, so I decided to recreate a stand-alone SDK for others to use.

Features

  • Offer management
  • Request validation
  • Offer validation
  • Understandable error messages
  • Condition enum
  • Delivery code enum

Installation

Simple requiry the koenreiniers/bol-sdk package through composer:

Usage

There are two ways to use the SDK. The recommended way is using Kr\Bol\Plaza, which has predefined methods for each API call.
You can use it as follows:

PlazaClient

Alternatively, you can use \Kr\Bol\Http\PlazaClient, which can be used for any Plaza api call:

The downside of using \Kr\Bol\PlazaClient is that it doesn’t validate your offers against Bol.com’s predefined rules, which \Kr\Bol\Plaza does.

Other

There’s also a few more things like the Enums for conditions and delivery codes. They are primarily used to validate offers, but you can also use them to list all the available conditions and delivery codes:

And let’s not forget the HeaderGenerator: