2017 © Pedro Peláez
 

library billbee-api

The official Billbee API SDK for PHP

image

billbee/billbee-api

The official Billbee API SDK for PHP

  • Friday, April 13, 2018
  • by Devtronic
  • Repository
  • 4 Watchers
  • 6 Stars
  • 68 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 7 Versions
  • 24 % Grown

The README.md

Packagist GitHub license Packagist, (*1)

Logo, (*2)

Billbee API

With this package you can implement the official Billbee API in your application., (*3)

Prerequisites

Install

You can add this package as composer dependency, (*4)

$ composer require billbee/billbee-api

Instructions without composer, (*5)

Official API Documentation

https://app.billbee.io/swagger/ui/index, (*6)

Usage

Simply instantiate a client object for accessing the api:, (*7)

<?php

use BillbeeDe\BillbeeAPI\Client;

$user = 'Your Billbee username';
$apiPassword = 'Your Billbee API Password'; // https://app.billbee.io/de/settings/api
$apiKey = 'Your Billbee API Key';

$client = new Client($user, $apiPassword, $apiKey);

Example: Retrieve a list of products

<?php

use BillbeeDe\BillbeeAPI\Client;

$user = 'Your Billbee username';
$apiPassword = 'Your Billbee API Password'; // https://app.billbee.io/de/settings/api
$apiKey = 'Your Billbee API Key';

$client = new Client($user, $apiPassword, $apiKey);

/** @var \BillbeeDe\BillbeeAPI\Response\GetProductsResponse $productsResponse */
$productsResponse = $client->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

use BillbeeDe\BillbeeAPI\Client;
use BillbeeDe\BillbeeAPI\Response;

$user = 'Your Billbee username';
$apiPassword = 'Your Billbee API Password'; // https://app.billbee.io/de/settings/api
$apiKey = 'Your Billbee API Key';

$client = new Client($user, $apiPassword, $apiKey);
$client->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, (*8)

Contributing

Feel free to fork the repository and create pull-requests, (*9)

The Versions

13/04 2018

dev-master

9999999-dev

The official Billbee API SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julian Finkler

13/04 2018

v1.1.2

1.1.2.0

The official Billbee API SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julian Finkler

30/01 2018

v1.1.1

1.1.1.0

The official Billbee API SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julian Finkler

30/01 2018

v1.1.0

1.1.0.0

The official Billbee API SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julian Finkler

30/01 2018

v1.0.2

1.0.2.0

The official Billbee API SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julian Finkler

28/11 2017

v1.0.1

1.0.1.0

The official Billbee API SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julian Finkler

17/10 2017

v1.0.0

1.0.0.0

The official Billbee API SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Julian Finkler