PHP code example of ready2order / r2o-api-client-php

1. Go to this page and download the library: Download ready2order/r2o-api-client-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ready2order / r2o-api-client-php example snippets


use \ready2order\Client;

$client = new Client('your-token');
print_r($client->get('company'));

use \ready2order\Client;

$client = new Client('your-token');

// Insert a new productgroup
$productGroup = $client->put('productgroups',array(
    "productgroup_name" => "Soft drinks"
));
$this->assertArrayHasKey("productgroup_name",$productGroup);


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

composer