https://github.com/billbeeio/billbee-php-sdk
🔌 The official Billbee API SDK for PHP 💻
https://github.com/billbeeio/billbee-php-sdk
api billbee billbee-api composer-package ecommerce hacktoberfest php
Last synced: 5 months ago
JSON representation
🔌 The official Billbee API SDK for PHP 💻
- Host: GitHub
- URL: https://github.com/billbeeio/billbee-php-sdk
- Owner: billbeeio
- License: mit
- Created: 2017-10-13T15:18:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-13T07:57:43.000Z (about 1 year ago)
- Last Synced: 2024-12-17T03:08:11.112Z (5 months ago)
- Topics: api, billbee, billbee-api, composer-package, ecommerce, hacktoberfest, php
- Language: PHP
- Homepage:
- Size: 404 KB
- Stars: 23
- Watchers: 8
- Forks: 25
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://packagist.org/packages/billbee/billbee-api)
[](https://raw.githubusercontent.com/billbeeio/billbee-php-sdk/master/LICENSE)
[](https://packagist.org/packages/billbee/billbee-api)[](https://www.billbee.de)
# Billbee API
With this package you can implement the official Billbee API in your application.## Prerequisites
- For accessing the Billbee API you need an API Key.
To get an API key, send a mail to [[email protected]](mailto:[email protected]) and send us a short note about what you are building.
- The API module must be activated in the account ([https://app.billbee.io/app_v2/settings/api/general](https://app.billbee.io/app_v2/settings/api/general))## Install
You can add this package as composer dependency
```bash
$ composer require billbee/billbee-api
```[Instructions without composer](./doc/usage_without_composer.md)
## Official API Documentation
[https://app.billbee.io/swagger/ui/index](https://app.billbee.io/swagger/ui/index)## Usage
Simply instantiate a client object for accessing the api:
```php
products()->getProducts($page = 1, $pageSize = 10);
/** @var \BillbeeDe\BillbeeAPI\Model\Product $product */
foreach ($productsResponse->data as $product) {
echo sprintf("Id: %s, SKU: %s, Price: %f\n", $product->id, $product->sku, $product->price);
}
```## Example: Batch requests
```php
enableBatchMode();
$client->products()->getProducts(1, 1); # Adds the request to the batch pool / returns null
$client->orders()->getOrders(1, 1); # Adds the request to the batch pool / returns null
$client->events()->getEvents(1, 1); # Adds the request to the batch pool / returns null
$results = $client->executeBatch(); # Results contain all responses in the added order
/** @var Response\GetProductsResponse $productsResult */
$productsResult = $results[0];
/** @var Response\GetOrdersResponse $ordersResult */
$ordersResult = $results[1];
/** @var Response\GetEventsResponse $eventsResult */
$eventsResult = $results[2];
```## Testing
Run `phpunit`## Contributing
Feel free to fork the repository and create pull-requests