PHP code example of jeffrey-kroonen / bol-retailer-api-php

1. Go to this page and download the library: Download jeffrey-kroonen/bol-retailer-api-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jeffrey-kroonen / bol-retailer-api-php example snippets


$client = new Client(
    bolClientId: '<client-id>',
    bolClientSecret: '<client-secret>'
);

$client->authenticate();

$client->getAuth();

$client = new Client(
    bolClientId: '<client-id>',
    bolClientSecret: '<client-secret>',
    accessToken: '<access-token>'
);

$ordersEndpoint = $client->orders();

$ordersEndpoint->orders(); // Retrieve a Paginate class instance containing orders
$ordersEndpoint->orderById(id: '<order-id>'); // Retrieve an order by id

$client->getAuth(); // Returns an instance of Auth

$client->getAuth()->getExpiresIn(); // 1661613446

$client->isAuthenticated();