PHPackages                             tbondois/odoo-ripcord - 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. tbondois/odoo-ripcord

ActiveLibrary[API Development](/categories/api)

tbondois/odoo-ripcord
=====================

Ripoo : a PHP8 XML-RPC client handler for Odoo External API

2.0.0(1y ago)15129.8k↓49.4%16[6 issues](https://github.com/tbondois/odoo-ripcord/issues)[1 PRs](https://github.com/tbondois/odoo-ripcord/pulls)1MITPHPPHP &gt;=7.0

Since Dec 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tbondois/odoo-ripcord)[ Packagist](https://packagist.org/packages/tbondois/odoo-ripcord)[ Docs](https://packagist.org/packages/tbondois/odoo-ripcord)[ RSS](/packages/tbondois-odoo-ripcord/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (3)Versions (13)Used By (1)

Ripoo (odoo-ripcord)
====================

[](#ripoo-odoo-ripcord)

Ripoo is a PHP7 XML-RPC client handler for [Odoo](https://www.odoo.com/).

Forked from [robroypt/odoo-client](https://github.com/robroypt/odoo-client), itself using [darkaonline/ripcord](https://github.com/DarkaOnLine/Ripcord), Ripoo is a PSR-compliance edition of [ripcord](https://github.com/poef/ripcord), the library used in example in the [Odoo External API documentation for PHP](https://www.odoo.com/documentation/11.0/api_integration.html).

This library is on [GitHub](https://github.com/tbondois/odoo-ripcord) and [Packagist](https://packagist.org/packages/tbondois/odoo-ripcord).

- [Ripoo (odoo-ripcord)](#ripoo-odoo-ripcord)
    - [Supported versions](#supported-versions)
    - [Changelog](#changelog)
    - [Installation](#installation)
    - [Update](#update)
    - [Usage](#usage)
        - [xmlrpc/2/common endpoint](#xmlrpc2common-endpoint)
        - [xmlrpc/2/object endpoint](#xmlrpc2object-endpoint)
    - [How to know the model names](#how-to-know-the-model-names)
    - [License](#license)

Supported versions
------------------

[](#supported-versions)

This library should work with all versions of Odoo, at least between 8.0 and [14.0](https://www.odoo.com/documentation/14.0/developer/misc/api/odoo.html), Community &amp; Enterprise Editions. I personnaly tested it only with **11.0** but their API is the same. It can be used in all PHP frameworks, like Symfony, Laravel or Magento2. If you find any incompatibilities, please create an issue or submit a pull request.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md)

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

[](#installation)

```
composer require tbondois/odoo-ripcord
```

Update
------

[](#update)

- To update all your libraries included in your composer.json

```
composer update
```

- But if you want to update JUST this library :

```
composer update tbondois/odoo-ripcord
```

Add ` --with-dependencies` to also update others libraries used by this one.

Usage
-----

[](#usage)

- Instantiate a new client via instance itself :

```
use Ripoo\OdooClient;

$host = 'example.odoo.com:8080';
$db = 'example-database';
$user = 'user@email.com';
$password = 'yourpassword';

$client = new OdooClient($host, $db, $user, $password);
```

- Or you can instanciate new client via ClientFactory, to centralize configuration use good Design Patterns .

Basic sample for Magento2 :

```
class RipooClientProvider
{
    private $clientFactory;
    private $client;
    private $scopeConfig;

    function __construct(
        \Ripoo\OdooClientFactory $clientFactory,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
    ) {
        $this->clientFactory = $clientFactory;
        $this->scopeConfig   = $scopeConfig;
    }

    public function createClient() : \Ripoo\OdooClient
    {
        // TODO secure injections
        $odooUrl  = $this->scopeConfig->getValue('my/settings/odoo_url');
        $odooDb   = $this->scopeConfig->getValue('my/settings/odoo_database');
        $odooUser = $this->scopeConfig->getValue('my/settings/odoo_user');
        $odooPwd  = $this->scopeConfig->getValue('my/settings/odoo_pwd');

        $this->client = $this->clientFactory->create(
            $host,
            $odooDb,
            $odooUser,
            $odooPwd
        );
        return $this->client;
    }

    public function getClient() : \Ripoo\OdooClient
    {
        // You can force nenewing a Client based on createdAt
        if (!$this->client) {
            $this->client = $this->createClient();
        }
        return $this->client;
    }
}
```

For the client to work you have to exclude the `http://` and `/xmlrpc/2` parts in the url. If you want to use another Odoo API, put it in the optional 5th parameter of constructor.

### xmlrpc/2/common endpoint

[](#xmlrpc2common-endpoint)

Getting version information:

```
$client->version();
```

There is no login/authenticate method. The client does authentication for you, that is why the credentials are passed as constructor arguments.

### xmlrpc/2/object endpoint

[](#xmlrpc2object-endpoint)

Search for records:

```
$criteria = [
  ['customer', '=', true],
];
$offset = 0;
$limit = 10;

$client->search('res.partner', $criteria, $offset, $limit);
```

Search and count records.

```
$criteria = [
  ['customer', '=', true],
];

$client->search_count('res.partner', $criteria);
```

Reading records:

```
$ids = $client->search('res.partner', [['customer', '=', true]], 0, 10);

$fields = ['name', 'email', 'customer'];

$customers = $client->read('res.partner', $ids, $fields);
```

Search and Read records:

```
$criteria = [
  ['customer', '=', true],
];

$fields = ['name', 'email', 'customer'];

$customers = $client->search_read('res.partner', $criteria, $fields, 10);
```

Creating records:

```
$data = [
  'name' => 'John Doe',
  'email' => 'foo@bar.com',
];

$id = $client->create('res.partner', $data);
```

Updating records:

```
// change email address of user with current email address foo@bar.com
$ids = $client->search('res.partner', [['email', '=', 'foo@bar.com']], 0, 1);

$client->write('res.partner', $ids, ['email' => 'baz@quux.com']);

// 'uncustomer' the first 10 customers
$ids = $client->search('res.partner', [['customer', '=', true]], 0, 10);

$client->write('res.partner', $ids, ['customer' => false]);
```

Deleting records:

```
$ids = $client->search('res.partner', [['email', '=', 'baz@quuz.com']], 0, 1);

$client->unlink('res.partner', $ids);
```

How to know the model names
---------------------------

[](#how-to-know-the-model-names)

- Model `ir.models` will return a list of reachable models.
- You can also use `erppeek` :

```
sudo pip install -U erppeek
erppeek  --server=http://odoo.example.com -d your_db -u admin -p password
your_db >>> models()
```

License
-------

[](#license)

MIT License. Copyright (c) 2018 Thomas Bondois. [See LICENSE file](LICENSE).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 84.5% 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 ~206 days

Recently: every ~553 days

Total

12

Last Release

492d ago

Major Versions

1.7.0 → 2.0.02025-02-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11269723?v=4)[Thomas Bondois](/maintainers/tbondois)[@tbondois](https://github.com/tbondois)

---

Top Contributors

[![tbd-tbd](https://avatars.githubusercontent.com/u/20397071?v=4)](https://github.com/tbd-tbd "tbd-tbd (98 commits)")[![robroypt](https://avatars.githubusercontent.com/u/19811784?v=4)](https://github.com/robroypt "robroypt (7 commits)")[![tbondois](https://avatars.githubusercontent.com/u/11269723?v=4)](https://github.com/tbondois "tbondois (5 commits)")[![mattv8](https://avatars.githubusercontent.com/u/9312603?v=4)](https://github.com/mattv8 "mattv8 (2 commits)")[![ThomasNucleus](https://avatars.githubusercontent.com/u/25164792?v=4)](https://github.com/ThomasNucleus "ThomasNucleus (1 commits)")[![mermetbt](https://avatars.githubusercontent.com/u/711667?v=4)](https://github.com/mermetbt "mermetbt (1 commits)")[![rem42](https://avatars.githubusercontent.com/u/1371193?v=4)](https://github.com/rem42 "rem42 (1 commits)")[![gaelg](https://avatars.githubusercontent.com/u/445352?v=4)](https://github.com/gaelg "gaelg (1 commits)")

---

Tags

apixmlrpcodooxml-rpcxmlrpcmagento2ripcord

### Embed Badge

![Health badge](/badges/tbondois-odoo-ripcord/health.svg)

```
[![Health](https://phpackages.com/badges/tbondois-odoo-ripcord/health.svg)](https://phpackages.com/packages/tbondois-odoo-ripcord)
```

###  Alternatives

[lstrojny/fxmlrpc

Fast and tiny XML/RPC client with bridges for various HTTP clients

1465.6M32](/packages/lstrojny-fxmlrpc)[tivoka/tivoka

The universal JSON-RPC client/server library. JSON-RPC done right!

77163.9k3](/packages/tivoka-tivoka)[nathanmac/parser

Simple PHP Parser Utility Library for API Development

2141.0M3](/packages/nathanmac-parser)[robroypt/odoo-client

A PHP Client for Odoo using Ripcord RPC library (as used in Odoo Web API docs)

2152.2k](/packages/robroypt-odoo-client)[ufo-tech/rpc-exceptions

Exception package RPC server error codes

164.6k8](/packages/ufo-tech-rpc-exceptions)[lao-liu/laravel-hprose

Hprose client/server providers for Laravel 5.x or Lumen 5.x

201.2k](/packages/lao-liu-laravel-hprose)

PHPackages © 2026

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