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,514 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  
Name: Julian Finkler <contact>
Classes: 8 packages by
Country: Germany Germany
Age: 31
All time rank: 2916173 in Germany Germany
Week rank: 215 Up10 in Germany Germany Up
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

  Files folder image Files (98)  /  doc  
File Role Description
  Plain text file sami.php Class Class source

  Files folder image Files (98)  /  src  
File Role Description
Files folder imageException (2 files)
Files folder imageLogger (1 file)
Files folder imageModel (36 files, 1 directory)
Files folder imageResponse (25 files, 1 directory)
Files folder imageTransformer (1 file)
Files folder imageType (13 files)
  Plain text file AbstractClient.php Class Class source
  Plain text file Client.php Class Class source

  Files folder image Files (98)  /  src  /  Exception  
File Role Description
  Plain text file InvalidIdException.php Class Class source
  Plain text file QuotaExceededException.php Class Class source

  Files folder image Files (98)  /  src  /  Logger  
File Role Description
  Plain text file DiagnosticsLogger.php Class Class source

  Files folder image Files (98)  /  src  /  Model  
File Role Description
Files folder imageSearch (3 files)
  Plain text file Address.php Class Class source
  Plain text file BillOfMaterialProduct.php Class Class source
  Plain text file Category.php Class Class source
  Plain text file CloudStorage.php Class Class source
  Plain text file Comment.php Class Class source
  Plain text file Customer.php Class Class source
  Plain text file CustomerAddress.php Class Class source
  Plain text file CustomFieldDefinition.php Class Class source
  Plain text file DeliveryNoteDocument.php Class Class source
  Plain text file Dimensions.php Class Class source
  Plain text file Event.php Class Class source
  Plain text file Image.php Class Class source
  Plain text file Invoice.php Class Class source
  Plain text file InvoiceDocument.php Class Class source
  Plain text file InvoicePosition.php Class Class source
  Plain text file Layout.php Class Class source
  Plain text file MessageForCustomer.php Class Class source
  Plain text file Order.php Class Class source
  Plain text file OrderItem.php Class Class source
  Plain text file OrderItemAttribute.php Class Class source
  Plain text file PartnerOrder.php Class Class source
  Plain text file Product.php Class Class source
  Plain text file ProductCustomField.php Class Class source
  Plain text file Seller.php Class Class source
  Plain text file Shipment.php Class Class source
  Plain text file ShipmentWithLabel.php Class Class source
  Plain text file ShippingProduct.php Class Class source
  Plain text file ShippingProvider.php Class Class source
  Plain text file SoldProduct.php Class Class source
  Plain text file Source.php Class Class source
  Plain text file Stock.php Class Class source
  Plain text file StockCode.php Class Class source
  Plain text file TermsInfo.php Class Class source
  Plain text file TranslatableText.php Class Class source
  Plain text file WebHook.php Class Class source
  Plain text file WebHookFilter.php Class Class source

  Files folder image Files (98)  /  src  /  Model  /  Search  
File Role Description
  Plain text file CustomerResult.php Class Class source
  Plain text file OrderResult.php Class Class source
  Plain text file ProductResult.php Class Class source

  Files folder image Files (98)  /  src  /  Response  
File Role Description
Files folder imageModel (1 file)
  Plain text file BaseResponse.php Class Class source
  Plain text file CreateDeliveryNoteResponse.php Class Class source
  Plain text file CreateInvoiceResponse.php Class Class source
  Plain text file GetCategoriesResponse.php Class Class source
  Plain text file GetCloudStoragesResponse.php Class Class source
  Plain text file GetCustomerAddressesResponse.php Class Class source
  Plain text file GetCustomerAddressResponse.php Class Class source
  Plain text file GetCustomerResponse.php Class Class source
  Plain text file GetCustomersResponse.php Class Class source
  Plain text file GetCustomFieldDefinitionResponse.php Class Class source
  Plain text file GetCustomFieldDefinitionsResponse.php Class Class source
  Plain text file GetEventsResponse.php Class Class source
  Plain text file GetInvoicesResponse.php Class Class source
  Plain text file GetLayoutsResponse.php Class Class source
  Plain text file GetOrderByPartnerResponse.php Class Class source
  Plain text file GetOrderResponse.php Class Class source
  Plain text file GetOrdersResponse.php Class Class source
  Plain text file GetPatchableFieldsResponse.php Class Class source
  Plain text file GetProductResponse.php Class Class source
  Plain text file GetProductsResponse.php Class Class source
  Plain text file GetShippingProvidersResponse.php Class Class source
  Plain text file GetTermsInfoResponse.php Class Class source
  Plain text file SearchDataResponse.php Class Class source
  Plain text file ShipWithLabelResponse.php Class Class source
  Plain text file UpdateStockResponse.php Class Class source

  Files folder image Files (98)  /  src  /  Response  /  Model  
File Role Description
  Plain text file ShipmentWithLabelResult.php Class Class source

  Files folder image Files (98)  /  src  /  Transformer  
File Role Description
  Plain text file DefinitionConfigTransformer.php Class Class source

  Files folder image Files (98)  /  src  /  Type  
File Role Description
  Plain text file ArticleSource.php Class Class source
  Plain text file CustomFieldDefinitionType.php Class Class source
  Plain text file EventType.php Class Class source
  Plain text file InvoiceType.php Class Class source
  Plain text file LayoutType.php Class Class source
  Plain text file OrderState.php Class Class source
  Plain text file Partner.php Class Class source
  Plain text file PaymentType.php Class Class source
  Plain text file ProductCondition.php Class Class source
  Plain text file ProductLookupBy.php Class Class source
  Plain text file SearchMode.php Class Class source
  Plain text file SearchType.php Class Class source
  Plain text file SendMode.php Class Class source

  Files folder image Files (98)  /  tests  
File Role Description
Files folder imageModel (3 files)
Files folder imageTransformer (1 file)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script
  Plain text file ClientTest.php Class Class source
  Plain text file EchoLogger.php Class Class source

  Files folder image Files (98)  /  tests  /  Model  
File Role Description
  Plain text file ShipmentTest.php Class Class source
  Plain text file StockCodeTest.php Class Class source
  Plain text file StockTest.php Class Class source

  Files folder image Files (98)  /  tests  /  Transformer  
File Role Description
  Plain text file DefinitionConfigTransformerTest.php Class Class source

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,514
This week:41Up