PHP library for using ready2order POS api
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.env.example
.gitignore
LICENSE
README.md
composer.json
phpunit.xml

README.md

ready2order PHP API

ready2order PHP API v1 is a PHP-wrapper for simply using ready2order API api.ready2order.at

Website: www.ready2order.at

Documentation: http://docs.ready2order.apiary.io/

Please contact developer@ready2order.at to get your secret master token!

Installation

You can install ready2order-php-api-v1 with composer

composer require duxthefux/ready2order-php-api-v1

You will then need to:

  • run composer install to get these dependencies added to your vendor directory
  • add the autoloader to your application with this line: require("vendor/autoload.php")

Alternatively you can just download the ready2orderAPI.php file and include it manually:

include('./ready2orderAPI.php');

Examples

Get client data

use \ready2order\ready2orderAPI;

$ready2orderAPI = new ready2orderAPI('user-token');
print_r($ready2orderAPI->get('company'));

Insert new productgroup with one product

use \ready2order\ready2orderAPI;

$ready2order = new ready2orderAPI(getenv('R2O_USER_TOKEN'));

// INSERT PRODUCTGROUP
$productGroup = $ready2order->put('productgroups',array(
    "productgroup_name" => "PHPUnit Testproductgroup"
));
$this->assertArrayHasKey("productgroup_name",$productGroup);


// INSERT PRODUCT
$product = $ready2order->put('products',array(
        "product_name" => "Cupcake",
        "product_price" => 5.2,
        "product_vat" => 20,
        "productgroup" => array(
            "productgroup_id" => $productGroup["productgroup_id"]
        )
));

Thanks to Drew McLellan's drewm/mailchimp-api