PHP code example of developifynet / brightpearl-php
1. Go to this page and download the library: Download developifynet/brightpearl-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/ */
developifynet / brightpearl-php example snippets
use \Developifynet\Brightpearl\BrightpearlClient;
$client = new BrightpearlClient([
'app_reference' => 'your-api-reference',
'account_code' => 'your-account',
'account_token' => 'your-app-token',
'api_domain' => 'ws-eu1.brightpearl.com', // [optional], Provide URL or remove this line
]);
// or
$client = new BrightpearlClient();
$client->settings([
'app_reference' => 'your-api-reference',
'account_code' => 'your-account',
'account_token' => 'your-app-token',
'api_domain' => 'ws-eu1.brightpearl.com', // [optional], Provide URL or remove this line
]);
/**
* Example Call
* For more api calls check 'resources' folder
*/
$response = $client->getOrderStockStatus();
$client = Brightpearl::settings([
'app_reference' => 'your-api-reference',
'account_code' => 'your-account',
'account_token' => 'your-app-token',
'api_domain' => 'ws-eu1.brightpearl.com', // [optional], Provide URL or remove this line
]);
/**
* Example Calls
* For more api calls check 'resources' folder
*/
$response = Brightpearl::getOrderStockStatus(); // Optional $ids, e.g. '1' or '1-3,4,5'
$response = Brightpearl::getOrder(); // Optional $ids, e.g. '1' or '1-3,4,5'
// All Contacts
$contact = $client->getContact();
// Contact by idset
$contact = $client->getContact(['id' => '1-3,4,5']);
// get a specific contact by id
$contact = $client->getContact(['id' => '1']);
// All Orders
$order = $client->getOrder();
// Order by id
$order = $client->getOrder('1');
// Orders by idset
$orders = $client->getOrder('1-3,4,5');
// Order Types
$order_types = $client->getOrderType(); // Optional $ids, e.g. '1' or '1-3,4,5'
// Product Prices
$product_prices = $client->getProductPrice(); // Optional $ids, e.g. '1' or '1-3,4,5'
// Price Lists
$price_lists = $client->getPriceList(); // Optional $ids, e.g. '1' or '1-3,4,5'
// All Price Lists Urls
$price_list_urls = $client->optionsProductPrice(); // Optional $ids, e.g. '1' or '1-3,4,5'
// All Contacts Urls
$contact_urls = $client->optionsContact(); // Optional $ids, e.g. '1' or '1-3,4,5'
// All Orders Urls
$order_urls = $client->optionsOrder(); // Optional $ids, e.g. '1' or '1-3,4,5'
// All Orders Urls
$order_urls = $client->optionsOrder(); // Optional $ids, e.g. '1' or '1-3,4,5'
// Order Statuses
$order_statuses = $client->getOrderStatus();
// Warehouses
$warehouses = $client->getWarehouse();
// Channels
$channels = $client->getChannel();
// Order Stock Statuses
$order_stock_statuses = $client->getOrderStockStatus();
// Order Shipping Statuses
$order_shipping_statuses = $client->getOrderShippingStatus();
// Order Types
$order_types = $client->getOrderType();
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.