- PHP 7.2.5 or higher
- PHP JSON extension
- [Composer] (https://github.com/composer/composer)
https://vipparcel.com/docs/api/
- [Guzzle HTTP client] (https://github.com/guzzle/guzzle)
Run the Composer command
composer require "vipparcel/client"
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
=======
$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();
...
Account > Address
- [POST] VP_Request_Account_Address_Create
- [GET] VP_Request_Account_Address_List
- [GET] VP_Request_Account_Address_Info
- [PUT] VP_Request_Account_Address_Update
- [DELETE] VP_Request_Account_Address_Delete
Account > Balance
- [GET] VP_Request_Account_Balance_Current
- [GET] VP_Request_Account_Balance_History
Account > Personal Info
- [GET] VP_Request_Account_Personal_Details
- [PUT] VP_Request_Account_Personal_Update
Shipping > Label
- [GET] VP_Request_Shipping_Label_Info
- [GET] VP_Request_Shipping_Label_List
- [GET] VP_Request_Shipping_Label_Images
- [POST] VP_Request_Shipping_Label_Calculate
- [POST] VP_Request_Shipping_Label_Print
Shipping > Pickup
- [GET] VP_Request_Shipping_Pickup_List
- [GET] VP_Request_Shipping_Pickup_Info
- [POST] VP_Request_Shipping_Pickup_Request
Shipping > Refund
- [GET] VP_Request_Shipping_Refund_Info
- [GET] VP_Request_Shipping_Refund_List
- [GET] VP_Request_Shipping_Refund_Labels
- [POST] VP_Request_Shipping_Refund_Request
Shipping > Scan Form
- [GET] VP_Request_Shipping_Scan_Info
- [GET] VP_Request_Shipping_Scan_List
- [GET] VP_Request_Shipping_Scan_Labels
- [POST] VP_Request_Shipping_Scan_Create
Shipping > Tracking
- [GET] VP_Request_Shipping_Tracking_Info
Location > Country
- [GET] VP_Request_Location_Country_List
Location > State
- [GET] VP_Request_Location_State_List