PHP code example of robo-meister / robo-store-api

1. Go to this page and download the library: Download robo-meister/robo-store-api 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/ */

    

robo-meister / robo-store-api example snippets




use RoboMeister\RoboStoreApi\ClientOptions;
use RoboMeister\RoboStoreApi\RoboStoreApiClient;

$client = new RoboStoreApiClient(new ClientOptions(
    baseUrl: 'https://store.robo-meister.com',
    apiToken: getenv('ROBO_STORE_API_TOKEN') ?: null,
));

$offers = $client->offers('FLOWBEACON');
$freeCatalog = $client->publicFreeCatalog();
$changes = $client->publicFreeCatalogChanges(new DateTimeImmutable('yesterday'));
$cachedPath = $client->downloadPublicFreePackageToFile('apps', 'inventory-tracker', '1.0.0', __DIR__ . '/cache/inventory-tracker.rappkg');

$checkoutUrl = $client->checkoutStartUrl('FLOWBEACON_LTD', [
    'owner_type' => 'organisation',
    'owner_id' => 'org_123',
    'return_url' => 'https://flowbeacon.example/billing/return',
    'idempotency_key' => 'checkout-org_123-FLOWBEACON_LTD',
]);