PHPackages                             dominicwatts/onbuysdk - 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. dominicwatts/onbuysdk

ActiveProject[API Development](/categories/api)

dominicwatts/onbuysdk
=====================

OnBuy PHP SDK

1.3.7(3y ago)12.0k↓33.3%3OSL-3.0PHPPHP &gt;=7.1.3

Since Aug 16Pushed 3y ago2 watchersCompare

[ Source](https://github.com/DominicWatts/OnBuySDK)[ Packagist](https://packagist.org/packages/dominicwatts/onbuysdk)[ RSS](/packages/dominicwatts-onbuysdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (14)Used By (0)

OnBuy Php SDK
=============

[](#onbuy-php-sdk)

OnBuy - UK Online Marketplace &amp; Amazon Alternative

Unofficial PHP SDK to interact with OnBuy API

[![phpcs](https://github.com/DominicWatts/OnBuySDK/workflows/phpcs/badge.svg)](https://github.com/DominicWatts/OnBuySDK/workflows/phpcs/badge.svg)

[![PHPCompatibility](https://github.com/DominicWatts/OnBuySDK/workflows/PHPCompatibility/badge.svg)](https://github.com/DominicWatts/OnBuySDK/workflows/PHPCompatibility/badge.svg)

[![PHPStan](https://github.com/DominicWatts/OnBuySDK/workflows/PHPStan/badge.svg)](https://github.com/DominicWatts/OnBuySDK/workflows/PHPStan/badge.svg)

[![PHPUnit](https://github.com/DominicWatts/OnBuySDK/workflows/PHPUnit/badge.svg)](https://github.com/DominicWatts/OnBuySDK/workflows/PHPUnit/badge.svg)

[![Coverage Status](https://camo.githubusercontent.com/e9d4e1d74e63f98ecabba069287921a9cb4bdb7813865297bb083e8e78e08719/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f446f6d696e696357617474732f4f6e42757953444b2f62616467652e737667)](https://coveralls.io/github/DominicWatts/OnBuySDK)

Install Instructions
--------------------

[](#install-instructions)

`composer require dominicwatts/onbuysdk`

There is a composer archive at:

[Coveralls Status](https://coveralls.io/github/DominicWatts/OnBuySDK)

API Documentation
-----------------

[](#api-documentation)

Connection Details
------------------

[](#connection-details)

The API settings page can be found in your Seller Control Panel. There are two sets of keys, Live and Test. You should use the Test keys when integrating with the API and switch to the Live Keys when you are ready to go live.

Usage
-----

[](#usage)

### Get token

[](#get-token)

To connect to any API method, you first need to obtain your temporary secret access token.

```
require 'vendor/autoload.php';

$config = [
    'consumer_key' => 'test_consumer_key',
    'secret_key' => 'test_secret_key'
];

use Xigen\Library\OnBuy\Auth;

$auth = new Auth(
    $config
);

$auth->getToken(); // This is your token
```

```
The access token is only valid for 15 minutes, after which a new token will need to be requested.

```

To debug

```
$auth->getResponse()->getBody();
$auth->getResponseArray();
$auth->getExpires();

```

### General process

[](#general-process)

1. Load token
2. Build request
3. Perform request and return results

### Brands

[](#brands)

```
use Xigen\Library\OnBuy\Brand\Brand;

$brand = new Brand($auth->getToken());

$brand->getBrand('keyword', 'asc', 10, 0);
$brand->getResponse();

$brand->getBrandById(123);
$brand->getResponse();
```

### Categories

[](#categories)

#### Categories

[](#categories-1)

```
use Xigen\Library\OnBuy\Category\Category;

$category = new Category($auth->getToken());

$category->getCategory([
    'name' => 'test'
]);
$category->getResponse();

$category->getCategory([
    'name' => 'test',
    'category_type_id' => 1 // department
]);
$category->getResponse();

$category->getCategoryById(13490);
$category->getResponse();
```

#### Categories Features

[](#categories-features)

```
use Xigen\Library\OnBuy\Category\Feature;

$categoryFeature = new Feature($auth->getToken());

$categoryFeature->getFeatureById(13490);
$categoryFeature->getResponse();
```

#### Categories Technical Details

[](#categories-technical-details)

```
use Xigen\Library\OnBuy\Category\Technical;

$categoryTechnical = new Technical($auth->getToken());

$categoryTechnical->getTechnicalDetailById(13490);
$categoryTechnical->getResponse();

$categoryTechnical->getGroupById(13490, 125);
$categoryTechnical->getResponse();
```

#### Categories Variants

[](#categories-variants)

```
use Xigen\Library\OnBuy\Category\Variant;

$categoryVariant = new Variant($auth->getToken());

$categoryVariant->getVariantId(13490);
$categoryVariant->getResponse();
```

### Commission

[](#commission)

```
use Xigen\Library\OnBuy\Commission\Commission;

$commission = new Commission($auth->getToken());

$commission->getTier();
$commission->getResponse();

$commission->getTierById(13490, 125);
$commission->getResponse();
```

### Condition

[](#condition)

```
use Xigen\Library\OnBuy\Condition\Condition;

$condition = new Condition($auth->getToken());

$condition->getCondition();
$condition->getResponse();
```

### Order

[](#order)

```
use Xigen\Library\OnBuy\Order\Order;

$order = new Order($auth->getToken());

$order->getOrder(
    [
        'status' => 'awaiting_dispatch',
        'previously_exported' => 0
    ],
    [
        'created' => 'asc'
    ]
);
$order->getResponse();

$order->getOrderById('T9R7V');
$order->getResponse();

$order->dispatchOrder([['order_id' => 'T9R7V']]);
$order->getResponse();

$order->dispatchOrder([
    [
        "order_id" => "T9R7V",
        "products" => [

            "sku" => "EXP-143-33S",
            "opc" => "PN8JV6",
            "quantity" => 125

        ],
        "tracking" => [
            "tracking_id" => "bar",
            "supplier_name" => "bar",
            "number" => "bar",
            "url" => "https://example.com/path-to-resource/"
        ]
    ]
]);
$order->getResponse();

$order->cancelOrder([
    'order_id' => 'T9R7V',
    'order_cancellation_reason_id' => 1,
    'cancel_order_additional_info' => 'Out of stock'
]);
$order->getResponse();

$order->refundOrder([
    'order_id' => 'T9R7V',
    'order_refund_reason_id' => 1,
    'seller_note' => 'Customer Return',
    'customer_note' => 'Item return received - Thank you!'
]);
$order->getResponse();

$order->getTrackingProviders();
$order->getResponse();
```

### Product

[](#product)

[![Submit](https://camo.githubusercontent.com/5258c132138c784bd2c9838fd0a99145f362172450ffa8532d59a5b1f745217c/68747470733a2f2f692e736e6970626f6172642e696f2f614b576e68512e6a7067)](https://camo.githubusercontent.com/5258c132138c784bd2c9838fd0a99145f362172450ffa8532d59a5b1f745217c/68747470733a2f2f692e736e6970626f6172642e696f2f614b576e68512e6a7067)

#### Product

[](#product-1)

```
use Xigen\Library\OnBuy\Product\Product;

$product = new Product($auth->getToken());
$product->createProduct($insertArray);
$product->getResponse();

$product->testCreateProductByBatch($insertArray);
$product->getResponse();

$product->updateProduct($updateArray); // single array
$product->getResponse();

$product->updateProductByBatch($updateArray); // array of array
$product->getResponse();

$product->getProduct([
    'query' => 'test',
    'field' => 'name'
]);
$product->getResponse();
```

#### Product Listing

[](#product-listing)

```
use Xigen\Library\OnBuy\Product\Listing;

$listing = new Listing($auth->getToken());

$listing->getListing(
    ['last_created' => 'asc'],
    ['sku' => 'test']
);
$listing->getResponse();

$listing->updateListingBySku([
    [
        "sku" => "EXP-143-33S",
        "price" => 126.34,
        "stock" => 125,
        "boost_marketing_commission" => 14.83
    ],
    [
        "sku" => "EXP-143-33L",
        "price" => 126.34,
        "stock" => 125,
        "boost_marketing_commission" => 14.83
    ],
]);
$listing->getResponse();

$listing->deleteListingBySku([
    "EXP-143-33S",
    "EXP-144-33L"
]);
$listing->getResponse();

$listing->createListing(
    'P5ZVSFF',
    [[
        "sku" => "EXP-143-33S",
        "group_sku" => "bar",
        "boost_marketing_commission" => 2.98
    ]]
);
$listing->getResponse();

$listing->createListingByBatch(
    [[
        "opc" => "PN8JV6",
        "condition" => "poor",
        "price" => 9.99,
        "stock" => 8,
        "delivery_weight" => 16,
        "handling_time" => 125,
        "free_returns" => "true",
        "warranty" => 7
    ]]
);
$listing->getResponse();

$listing->getWinningListing([
    "EXP-143-33S",
    "EXP-144-33L"
]);
$listing->getResponse();
```

#### Queue

[](#queue)

```
use Xigen\Library\OnBuy\Queue\Queue;

$queue = new Queue($auth->getToken());

$queue->getQueue([
    'queue_ids' => '123,456',
    'status' => 'pending'
]);
$queue->getResponse();

$queue->getQueueById(123);
$queue->getResponse();
```

### Seller

[](#seller)

#### Seller

[](#seller-1)

```
use Xigen\Library\OnBuy\Seller\Seller;

$seller = new Seller($auth->getToken());
$seller->getSellerById(123);
$seller->getResponse();
```

#### Seller Deliveries

[](#seller-deliveries)

```
use Xigen\Library\OnBuy\Seller\Delivery;

$sellerDelivery = new Delivery($auth->getToken());
$sellerDelivery->getDelivery();
$sellerDelivery->getResponse();
```

#### Seller Entities

[](#seller-entities)

```
use Xigen\Library\OnBuy\Seller\Entity;

$sellerEntity = new Entity($auth->getToken());

$sellerEntity->getEntity();
$sellerEntity->getResponse();

$sellerEntity->getEntityById(123);
$sellerEntity->getResponse();
```

### Sites

[](#sites)

```
use Xigen\Library\OnBuy\Site\Site;

$site = new Site($auth->getToken());

$site->getSite([
    'name' => 'test'
]);
$site->getResponse();

$site->getSiteById(123);
$site->getResponse();
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.4% 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 ~61 days

Recently: every ~166 days

Total

12

Last Release

1418d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44d79495721d844614b7004c5811ff2ab7cf15c9be3544000f7ee89f3e187de3?d=identicon)[DominicPixie](/maintainers/DominicPixie)

---

Top Contributors

[![XigenDominic](https://avatars.githubusercontent.com/u/6814203?v=4)](https://github.com/XigenDominic "XigenDominic (79 commits)")[![DominicWatts](https://avatars.githubusercontent.com/u/7295705?v=4)](https://github.com/DominicWatts "DominicWatts (16 commits)")[![DomPixie](https://avatars.githubusercontent.com/u/94372161?v=4)](https://github.com/DomPixie "DomPixie (1 commits)")[![sphinxv1337](https://avatars.githubusercontent.com/u/9435390?v=4)](https://github.com/sphinxv1337 "sphinxv1337 (1 commits)")

---

Tags

phpsdkonbuy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dominicwatts-onbuysdk/health.svg)

```
[![Health](https://phpackages.com/badges/dominicwatts-onbuysdk/health.svg)](https://phpackages.com/packages/dominicwatts-onbuysdk)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)[octw/aramex

A Library to integrate with Aramex APIs

2925.2k](/packages/octw-aramex)

PHPackages © 2026

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