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(6mo ago)59.6k↑15.4%5MITPHPPHP &gt;=7.4

Since Sep 18Pushed 1mo 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 2w 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

50

—

FairBetter than 95% of packages

Maintenance79

Regular maintenance activity

Popularity31

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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

204d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6758162?v=4)[duxthefux](/maintainers/duxthefux)[@duxthefux](https://github.com/duxthefux)

---

Top Contributors

[![duxthefux](https://avatars.githubusercontent.com/u/6758162?v=4)](https://github.com/duxthefux "duxthefux (56 commits)")[![hajo-travanto](https://avatars.githubusercontent.com/u/68919624?v=4)](https://github.com/hajo-travanto "hajo-travanto (3 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)")

###  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

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k54](/packages/neuron-core-neuron-ai)[files.com/files-php-sdk

Files.com PHP SDK

2482.9k](/packages/filescom-files-php-sdk)[volcengine/volcengine-php-sdk

119.5k](/packages/volcengine-volcengine-php-sdk)

PHPackages © 2026

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