shufflingpixels / bokio-php
PHP Wrapper for the experimental Bokio API
v0.0.1
2025-03-05 06:13 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.70
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.0
README
PHP Wrapper for the experimental Bokio API
Install
Install via composer
composer require shufflingpixels/bokio-php
Example
<?php require_once 'vendor/autoload.php'; use Shufflingpixels\BokioApi\Api; use Shufflingpixels\BokioApi\Auth; use Shufflingpixels\BokioApi\Enum\CustomerType; use Shufflingpixels\BokioApi\Enum\LanguageEnum; use Shufflingpixels\BokioApi\Exception\ApiException; use Shufflingpixels\BokioApi\Exception\Exception; use Shufflingpixels\BokioApi\Objects\Customer; $api = new Api(new Auth('<company_id>', '<token>')); try { $customer = new Customer([ 'name' => "Created From Api", 'type' => CustomerType::COMPANY, 'vatNumber' => "SE1234567890", 'orgNumber' => "123456-7890", 'contactsDetails' => [ [ 'name' => 'Person 1', 'email' => 'test@example.com', 'phone' => '0739281831', 'isDefault' => true, ], [ 'name' => 'Person 2', ], ], "address" => [ 'line1' => 'Älvsborgsvägen 10', 'city' => 'Göteborg', 'postalCode' => '123 45', 'country' => 'SE', ], 'language' => LanguageEnum::SV, ]); $response = $api->customer()->create($customer); print_r($response); } catch (ApiException $e) { print_r($e->getError()); } catch (Exception $e) { print_r($e); }
Implemented
-
Journal Entries
-
Customers
-
Upload
-
Invoice
Author
Henrik Hautakoski henrik@shufflingpixels.com