Developer notes
The add-on is built on the shared Marketplace Hub: the generic parts (mapping, price rules, stock buffer, sync jobs, order import, status mapping, shipments, returns, log, queue) are channel independent; the bol part is three files.
| Part | Role |
|---|---|
Client\Api |
The bol HTTP calls. Client credentials token (HTTP Basic at login.bol.com), versioned media types (application/vnd.retailer.v10+json, v11 for offers), problem+json error mapping, the Process Status host. |
Drivers\Bol\Mapper |
Pure translation: offer requests, order and return mapping, process outcome, transporter codes, reason texts. Unit tested with samples from the specifications. |
Drivers\Bol\Driver |
Implements Hub\DriverInterface: one request per offer, read back for the sale state, orders list then order, shipment and cancellation with process status follow, returns. |
Hub\*, Queue, Jobs, Accounts, Log |
Channel independent. |
Endpoints used
Section titled “Endpoints used”| Purpose | Call |
|---|---|
| Token | POST https://login.bol.com/token (Basic, grant_type=client_credentials) |
| Categories | GET /retailer/products/categories (Accept-Language nl) |
| Offers (v11) | POST /retailer/offers, PATCH /retailer/offers/{id}, GET /retailer/offers, GET /retailer/offers/{id}, GET /retailer/offers/{id}/not-for-sale-reasons |
| Orders | GET /retailer/orders (status, fulfilment-method, change-interval-minute, page), GET /retailer/orders/{id}, PUT /retailer/orders/cancellation |
| Shipments | POST /retailer/shipments |
| Returns | GET /retailer/returns, GET /retailer/returns/{id}, PUT /retailer/returns/{rma-id} |
| Process status | GET /shared/process-status/{id} |
| Content | POST /retailer/content/products |
Test mode uses /retailer-demo and /shared-demo.
PHP hooks: update_product_post and delete_product_post (mark the product for a push), init_templater_post (upgrade synchronizer). Admin template hooks add the license bar and the add-on settings overview.
php81 tests/unit.php (also php83): mapping and driver tests with samples built from the specifications. node tests/mock-server/server.js 11840 is a mock that follows the specifications (Basic token request, media type checks, problem+json violations, asynchronous process status); node tests/e2e/e2e.mjs and e2e-vendor.mjs drive a dev store against it. The bol demo environment needs a seller’s credentials and returns fixed example answers, so it is not part of the automated tests.
Configuration for tests
Section titled “Configuration for tests”$config['kv_bol_base_url'] = 'http://127.0.0.1:11840/retailer'; in config.local.php redirects the API, the token endpoint and the shared host to the mock. Never set it in production.