-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mintware-de/master
Initial release
- Loading branch information
Showing
53 changed files
with
4,487 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.idea | ||
vendor | ||
test_config.yml | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
[![Logo](https://app01.billbee.de/static/billbee/img/logo.png)](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://www.billbee.de/de/settings/api](https://www.billbee.de/de/settings/api)) | ||
|
||
## Install | ||
You can add this package as composer dependency | ||
```bash | ||
$ composer require billbee/billbee-api | ||
``` | ||
|
||
## Official API Documentation | ||
[https://app01.billbee.de/swagger/ui/index](https://app01.billbee.de/swagger/ui/index) | ||
|
||
## Usage | ||
|
||
Simply instantiate a client object for accessing the api: | ||
```php | ||
<?php | ||
|
||
$user = 'Your Billbee username'; | ||
$apiPassword = 'Your Billbee API Password'; // https://www.billbee.de/de/settings/api | ||
$apiKey = 'Your Billbee API Key'; | ||
|
||
$client = new \BillbeeDe\BillbeeAPI\Client($user, $apiPassword, $apiKey); | ||
``` | ||
|
||
### Class methods | ||
```text | ||
__construct() | ||
getProducts() | ||
updateStock() | ||
updateStockMultiple() | ||
updateStockCode() | ||
getProduct() | ||
getTermsInfo() | ||
getEvents() | ||
getOrders() | ||
getOrder() | ||
getOrderByOrderNumber() | ||
getOrderByPartner() | ||
createOrder() | ||
addOrderTags() | ||
addOrderShipment() | ||
createDeliveryNote() | ||
createInvoice() | ||
setOrderTags() | ||
setOrderState() | ||
getInvoices() | ||
getShippingProviders() | ||
``` | ||
|
||
## Example: Retrieve a list of products | ||
```php | ||
<?php | ||
|
||
$user = 'Your Billbee username'; | ||
$apiPassword = 'Your Billbee API Password'; // https://www.billbee.de/de/settings/api | ||
$apiKey = 'Your Billbee API Key'; | ||
|
||
$client = new \BillbeeDe\BillbeeAPI\Client($user, $apiPassword, $apiKey); | ||
|
||
/** @var \BillbeeDe\BillbeeAPI\Response\GetProductsResponse $productsResponse */ | ||
$productsResponse = $client->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); | ||
} | ||
``` | ||
|
||
## Testing | ||
Clone the repository, copy the `test_config.dist.yml` to `test_config.yml` and fill it. | ||
Run `phpunit` | ||
|
||
## Contributing | ||
Feel free to fork the repository and create pull-requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "billbee/billbee-api", | ||
"description": "The official Billbee API SDK for PHP", | ||
"type": "library", | ||
"require": { | ||
"php": "5.6.* || ^7.0", | ||
"mintware-de/json-object-mapper": "^1.1.0", | ||
"guzzlehttp/guzzle": "^6.3" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~5.7", | ||
"symfony/yaml": "~3.3" | ||
}, | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Julian Finkler", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "stable", | ||
"autoload": { | ||
"psr-4": { | ||
"BillbeeDe\\BillbeeAPI\\": "src/", | ||
"BillbeeDe\\Tests\\BillbeeAPI\\": "tests/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- | ||
~ This file is part of the Billbee API package. | ||
~ | ||
~ Copyright 2017 by Billbee GmbH | ||
~ | ||
~ For the full copyright and license information, please read the LICENSE | ||
~ file that was distributed with this source code. | ||
~ | ||
~ Created by Julian Finkler <[email protected]> | ||
--> | ||
|
||
<phpunit bootstrap="tests/autoload.php"> | ||
<testsuites> | ||
<testsuite name="Billbee API Test Suite"> | ||
<directory suffix="Test.php">./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
Oops, something went wrong.