PHP code example of rocket-labs / sellercenter-sdk-php

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

    

rocket-labs / sellercenter-sdk-php example snippets





    RocketLabs\SellerCenterSdk\Core\Client;
    use RocketLabs\SellerCenterSdk\Core\Configuration;
    use RocketLabs\SellerCenterSdk\Endpoint\Endpoints;

    // create client instance with your credetials
    $client = Client::create(new Configuration(SC_API_URL, SC_API_USER, SC_API_KEY));

    // get response for a certain api call with fluent interface:
    // Endpoints - name of endpoint - api method to call - call($client)
    $response = Endpoints::order()->getOrder(12)->call($client);

    // Or, for some complex methods, RequestBuilders can be used,
    // In such cases API command will have following structure:
    // Endpoints - name of endpoint - api method to call - some builder's setters - build - call($client)
    $response = Endpoints::order()->getOrders()->setSorting('created_at', 'ASC')->setLimit(12)->build()->call($client);
bash
cd samples
php ./genericGetter.php
bash
php ./samples/endpoint/order/getOrder.php