PHP code example of tbbn / sdk

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

    

tbbn / sdk example snippets


use Tbbn\Sdk\TbbnClient;

$client = new TbbnClient(baseUrl: 'https://api.tbbnetwork.com', apiKey: 'sk_sandbox_...');

$listing = $client->listings->upsert([
    'merchantId' => '...',
    'merchantListingRef' => 'sku-1042',
    'sellerId' => '...',
    'listingType' => 'BOTH',
    'title' => 'Nike Air Max 90 — size 10, lightly worn',
    'category' => 'Apparel',
    'originalPrice' => 150,
    'requestedAmount' => 25,
    'currency' => 'USD',
    'visibility' => 'GLOBAL',
]);

$offers = $client->offers->list($listing['sellerId'], 'received');

use Tbbn\Sdk\WebhookVerifier;

$ok = WebhookVerifier::verify($rawBody, $_SERVER['HTTP_X_TBBN_SIGNATURE'], $signingSecret);