PHP code example of vipparcel / client
1. Go to this page and download the library: Download vipparcel/client 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/ */
vipparcel / client example snippets
$client = new VP_Client();
$client->auth_token('KEY');
$client->is_test(TRUE); // production or test request (default: production)
$request = new VP_Request_Account_Balance_History();
$request->set_params(array('limit' => 10, 'orderBy' => array('created' => 'ASC')));
$client->request($request); // set request object
$result = $client->execute(); // send request (return object VP_Response)
print_r($result->has_errors()); // boolean
print_r($result->get_errors()); // boolean false || array
print_r($result->as_object()); // result as stdClass object
print_r($result->as_array()); // result as array
$client = new VP_Client();
$client->auth_token('KEY');
$client->request(new VP_Request_Shipping_Label_Info(144241)); // with item id
$result = $client->execute();
...