PHP Classes

Billbee PHP API SDK: Manage sales in multiple sites with BillBee API

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 59 All time: 10,526 This week: 41Up
Version License PHP version Categories
billbee-php-sdk 1.8.0MIT/X Consortium ...5PHP 5, E-Commerce, Web services
Description 

Author

This package can manage sales in multiple sites with BillBee API.

It can send HTTP requests to the BillBee API Web server to perform several types of operations. Currently it can:

Products:

- Get products
- Get single product
- Get categories
- Update the stock quantity of a single product
- Update the stock quantity of multiple products
- Update the stock code
- Create a product
- Patch a product
- Delete a product
- Get a list of custom field definitions
- Get a single custom field definition

Provisioning:

- Get the terms info

Events:

- Get events

Orders:

- Get the order list
- Get an single order
- Get an single order by the order number
- Get an single order by the partner
- Create an order
- Add tags to an order
- Add shipment an order
- Create a delivery note
- Create an invoice
- Send messages to customers
- Set the order tags
- Set the order state
- Patch an order
- Get invoices

Shipping:

- Get shipping providers
- Ship orders and create shipping labels

Web Hooks:

- Get registered web hooks
- Get a single web hook
- Get available web hook filters
- Create a web hook
- Update a web hook
- Delete all web hooks
- Delete a web hook by id
- Delete a web hook

Customers:

- Get a list of customers
- Get a single customer
- Get addresses for a customer
- Get a single address for a customer
- Get all orders for a customer
- Create a customer
- Update a customer

Misc:

- Get a list of cloud storages
- Get a list of layouts
- Search orders, products, customers

Innovation Award
PHP Programming Innovation award nominee
December 2019
Number 5
Billbee is an API that can help managing the sales processes of products in many well known marketplaces.

This package can be used to access the Billbee API from PHP applications, so it can be used by the back-office part of many businesses that sell their products on those marketplaces.

Manuel Lemos
Picture of Julian Finkler
  Performance   Level  
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

 

Documentation

Packagist GitHub license Packagist

Logo

Billbee API

With this package you can implement the official Billbee API in your application.

Prerequisites

Install

You can add this package as composer dependency

$ composer require billbee/billbee-api

Official API Documentation

https://app.billbee.io/swagger/ui/index

Usage

Simply instantiate a client object for accessing the api:

<?php

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

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

Example: Retrieve a list of products

<?php
 
$user = 'Your Billbee username';
$apiPassword = 'Your Billbee API Password'; // https://app.billbee.io/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);
}

Example: Batch requests


<?php

$user = 'Your Billbee username';
$apiPassword = 'Your Billbee API Password'; // https://app.billbee.io/de/settings/api
$apiKey = 'Your Billbee API Key';
 
$client = new \BillbeeDe\BillbeeAPI\Client($user, $apiPassword, $apiKey);
$client->useBatching = true; # Enable batching
 
$client->getProducts(1, 1); # Adds the request to the batch pool / returns null
$client->getOrders(1, 1); # Adds the request to the batch pool / returns null
$client->getEvents(1, 1); # Adds the request to the batch pool / returns null
 
$results = $client->executeBatch(); # Results contain all responses in the added order
 
/ @var \BillbeeDe\BillbeeAPI\Response\GetProductsResponse $productsResult */
$productsResult = $results[0];
 
/ @var \BillbeeDe\BillbeeAPI\Response\GetOrdersResponse $productsResult */
$ordersResult = $results[1];
 
/ @var \BillbeeDe\BillbeeAPI\Response\GetEventsResponse $productsResult */
$eventsResult = $results[2];

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


  Files folder image Files (98)  
File Role Description
Files folder imagedoc (1 file)
Files folder imagesrc (2 files, 6 directories)
Files folder imagetests (3 files, 2 directories)
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Read me
Accessible without login Plain text file test_config.dist.yml Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:59
This week:0
All time:10,526
This week:41Up