PHPackages                             ready2order/r2o-api-client-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ready2order/r2o-api-client-php

ActiveLibrary[API Development](/categories/api)

ready2order/r2o-api-client-php
==============================

PHP library for ready2order POS API v1

1.3.0(3mo ago)58.3k—8.3%5[3 issues](https://github.com/ready2order/r2o-api-client-php/issues)MITPHPPHP &gt;=7.4

Since Sep 18Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/ready2order/r2o-api-client-php)[ Packagist](https://packagist.org/packages/ready2order/r2o-api-client-php)[ Docs](https://github.com/ready2order/r2o-api-client-php)[ RSS](/packages/ready2order-r2o-api-client-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (13)Used By (0)

ready2order PHP API
===================

[](#ready2order-php-api)

PHP client library for the ready2order POS API v1. Wraps the REST API at [api.ready2order.com](https://api.ready2order.com).

Getting Started
---------------

[](#getting-started)

1. Register as a developer at [api.ready2order.com](https://api.ready2order.com) to obtain your "Developer Token"
2. Use the developer token to request access to existing accounts and obtain an "Account Token"
3. Use the "Account Token" for your API requests

For full API documentation, see [ready2order.com/api/doc](https://ready2order.com/api/doc).

Installation
------------

[](#installation)

Install via Composer:

```
composer require ready2order/r2o-api-client-php
```

Basic Usage
-----------

[](#basic-usage)

```
use ready2order\Client;

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

// Fetch account information
$company = $client->get('company');
print_r($company);
```

HTTP Methods
------------

[](#http-methods)

The client supports all standard HTTP methods:

```
// GET - Retrieve resources
$products = $client->get('products');
$product = $client->get('products/123');

// POST - Create resources
$newProduct = $client->post('products', [
    'product_name' => 'Coffee',
    'product_price' => '3.50',
]);

// PUT - Create or replace resources
$productGroup = $client->put('productgroups', [
    'productgroup_name' => 'Beverages',
]);

// PATCH - Update resources
$updated = $client->patch('products/123', [
    'product_price' => '4.00',
]);

// DELETE - Remove resources
$client->delete('products/123');
```

Configuration Options
---------------------

[](#configuration-options)

### Custom Timeout

[](#custom-timeout)

Set a custom timeout for all requests (default: 10 seconds):

```
$client = new Client('your-token');
$client->setTimeout(30); // 30 seconds

// Or override per request (last parameter)
$result = $client->get('products', [], 60); // 60 second timeout
```

### Language Header

[](#language-header)

Set the Accept-Language header for localized responses:

```
$client = new Client('your-token');
$client->setLanguage('de-DE'); // German
$client->setLanguage('en-US'); // English (default)
```

### Custom API Endpoint

[](#custom-api-endpoint)

For testing or custom deployments, pass the endpoint as the second constructor parameter:

```
$client = new Client('your-token', 'https://custom-api.example.com/v1');
```

Error Handling
--------------

[](#error-handling)

The client throws specific exceptions for different error scenarios:

```
use ready2order\Client;
use ready2order\Exceptions\ErrorResponseException;
use ready2order\Exceptions\ResourceNotFoundException;
use ready2order\Exceptions\InvalidResponseException;

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

try {
    $product = $client->get('products/999999');
} catch (ResourceNotFoundException $e) {
    // HTTP 404 - Resource not found
    echo "Product not found: " . $e->getMessage();
} catch (ErrorResponseException $e) {
    // API returned an error (4xx/5xx)
    echo "API error: " . $e->getMessage();

    // Access full error response data
    $errorData = $e->getData();
    if ($errorData) {
        print_r($errorData);
    }
} catch (InvalidResponseException $e) {
    // Response could not be JSON-decoded
    echo "Invalid response from API";
}
```

Pagination
----------

[](#pagination)

List endpoints support pagination via query parameters:

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

// Fetch first page of products (default limit varies by endpoint)
$page1 = $client->get('products', [
    'page' => 1,
    'limit' => 50,
]);

// Fetch next page
$page2 = $client->get('products', [
    'page' => 2,
    'limit' => 50,
]);
```

Complete Example
----------------

[](#complete-example)

```
use ready2order\Client;
use ready2order\Exceptions\ErrorResponseException;

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

// Create a product group
$productGroup = $client->put('productgroups', [
    'productgroup_name' => 'Soft drinks',
]);

// Create a product in that group
$product = $client->put('products', [
    'product_name' => 'Cola',
    'product_price' => '2.50',
    'product_vat' => '20',
    'productgroup' => [
        'productgroup_id' => $productGroup['productgroup_id'],
    ],
]);

echo "Created product: " . $product['product_name'];
```

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- ext-curl
- ext-json
- guzzlehttp/guzzle ^7.0

License
-------

[](#license)

MIT

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance66

Regular maintenance activity

Popularity31

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~325 days

Recently: every ~481 days

Total

7

Last Release

114d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/07aef729df63d7497d0d238a57692abaa22787f6b0780e39c814a49f1678be7c?d=identicon)[duxthefux](/maintainers/duxthefux)

---

Top Contributors

[![duxthefux](https://avatars.githubusercontent.com/u/6758162?v=4)](https://github.com/duxthefux "duxthefux (55 commits)")[![ironic](https://avatars.githubusercontent.com/u/1299032?v=4)](https://github.com/ironic "ironic (2 commits)")[![krsriq](https://avatars.githubusercontent.com/u/2337648?v=4)](https://github.com/krsriq "krsriq (2 commits)")[![hajo-travanto](https://avatars.githubusercontent.com/u/68919624?v=4)](https://github.com/hajo-travanto "hajo-travanto (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/ready2order-r2o-api-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/ready2order-r2o-api-client-php/health.svg)](https://phpackages.com/packages/ready2order-r2o-api-client-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
