PHP code example of repull / sdk

1. Go to this page and download the library: Download repull/sdk 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/ */

    

repull / sdk example snippets



GuzzleHttp\Client;
use Repull\Api\ReservationsApi;
use Repull\Configuration;

$config = Configuration::getDefaultConfiguration()
    ->setAccessToken(getenv('REPULL_API_KEY'));

$api = new ReservationsApi(new Client(), $config);
$response = $api->v1ReservationsGet(limit: 10);

foreach ($response->getData() as $r) {
    printf(
        "%s  %s → %s  %s  %s %s\n",
        $r->getId(),
        $r->getCheckIn()?->format('Y-m-d'),
        $r->getCheckOut()?->format('Y-m-d'),
        $r->getPlatform(),
        $r->getTotalPrice(),
        $r->getCurrency()
    );
}

$config = Configuration::getDefaultConfiguration()
    ->setAccessToken('sk_test_...');
bash
REPULL_API_KEY=sk_test_... php examples/quickstart.php
bash
./scripts/regen.sh
php scripts/relax-enums.php  # forward-compat patch for enum drift
composer phpstan