PHP code example of covergenius / ebay-rest-php-sdk

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

    

covergenius / ebay-rest-php-sdk example snippets


use CoverGenius\EbayRestPhpSdk\Api\FulfillmentApi;

$fulfillmentApi = FulfillmentApi::create([
    'base_uri' => 'https://api.sandbox.ebay.com',
    'headers' => [
        'Authorization' => 'Bearer ACCESS_TOKEN',
    ]
]);

use CoverGenius\EbayRestPhpSdk\Api\FulfillmentApi;
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.sandbox.ebay.com',
    'headers' => [
        'Authorization' => 'Bearer ACCESS_TOKEN',
    ]
]);

$fulfillmentApi = new FulfillmentApi($client);

use CoverGenius\EbayRestPhpSdk\Api\FulfillmentApi;

$config = [];

$fulfillmentApi = FulfillmentApi::create($config);

$order = $fulfillmentApi->getOrder(['orderId' => 'ORDER_ID']);

// via getter
$order->offsetGet('orderId');

// via array key
$order['orderId'];