https://github.com/developifynet/brightpearl-php
Brightpearl PHP API Wrapper
https://github.com/developifynet/brightpearl-php
Last synced: about 1 year ago
JSON representation
Brightpearl PHP API Wrapper
- Host: GitHub
- URL: https://github.com/developifynet/brightpearl-php
- Owner: developifynet
- License: mit
- Created: 2019-05-16T05:34:45.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-16T10:19:17.000Z (about 7 years ago)
- Last Synced: 2025-03-30T05:31:26.993Z (about 1 year ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Brightpearl PHP API WRAPPER
This package uses arrays for the same json requests as you would send to the Brightpearl API. Please refer to the [Brightpearl API docs](http://api-docs.brightpearl.com/) for extra/optional field info.
## Installation
Begin by pulling in the package through Composer.
```bash
composer require developifynet/brightpearl-php
```
## Usage
Please note that all requests in
### Basic (any php app)
```php
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();
```
### Laravel
```php
$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'
```
Services
--------
These are the api method calls generated by the service config files using GuzzleHttp/Guzzle-Services. For
### Contact
`getContact()` - Retrieve contact info
```php
// 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']);
```
### Order
`getOrder()` - Retrieve order(s)
```php
// All Orders
$order = $client->getOrder();
// Order by id
$order = $client->getOrder('1');
// Orders by idset
$orders = $client->getOrder('1-3,4,5');
```
### Other Available Services
```php
// 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();
```
#### Contributing
Currently API coverage only represents fetching data portion of the Brightpearl API. If you want to contribute send bug fixes, additional resource/services and features in a pull request at the develop branch. Thanks!