PHPackages                             nickcheek/mckesson - 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. nickcheek/mckesson

ActiveLibrary

nickcheek/mckesson
==================

Mckesson API Package

v1.3.1(4y ago)7141MITPHPPHP ^7.1.3 || ^8.0

Since Nov 20Pushed 4y ago2 watchersCompare

[ Source](https://github.com/nickcheek/McKesson)[ Packagist](https://packagist.org/packages/nickcheek/mckesson)[ Docs](https://github.com/nickcheek/mckesson)[ RSS](/packages/nickcheek-mckesson/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (2)Versions (6)Used By (0)

McKesson PHP Library
====================

[](#mckesson-php-library)

A simple library to send lookup, search, and order requests to McKesson.

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

[](#installation)

You can install the package via composer:

```
composer require nickcheek/mckesson
```

Usage
-----

[](#usage)

### Item Search

[](#item-search)

```
$search = new Mckesson($identity, $secret, $account_number, $b2b_key);
$result = $search->search('Tena Underwear');
var_dump($result);
```

##### You can also pass an additional search type of 'refinement' as the third search pararmeter. The result will display a list of categories where the product you're searching for can be found. If you're searching gloves, you'll get over 2000 results. If you're looking for gloves for physical theapy, you can narrow it down to 15 results using the refinement and node feature.

[](#you-can-also-pass-an-additional-search-type-of-refinement-as-the-third-search-pararmeter-the-result-will-display-a-list-of-categories-where-the-product-youre-searching-for-can-be-found-if-youre-searching-gloves-youll-get-over-2000-results-if-youre-looking-for-gloves-for-physical-theapy-you-can-narrow-it-down-to-15-results-using-the-refinement-and-node-feature)

```
$search = new Mckesson($identity, $secret, $account_number, $b2b_key);
$result = $search->lookup('978841',null, 'refinement');
var_dump($result);
```

##### To only search for physical therapy gloves, you should pass the node number as the fourth and final parameter. If you pass 'refinement' parameter again, it will further narrow your search nodes. So your search will look as such:

[](#to-only-search-for-physical-therapy-gloves-you-should-pass-the-node-number-as-the-fourth-and-final-parameter-if-you-pass-refinement-parameter-again-it-will-further-narrow-your-search-nodes-so-your-search-will-look-as-such)

```
$search = new Mckesson($identity, $secret, $account_number, $b2b_key);
$result = $search->lookup('978841', null, 'refinement', 16873);
var_dump($result);
```

##### The above search would have narrowed your 2000+ gloves down the 15 with the ability to narrow it down even further using the three addional nodes of Exercise Equipment, Treatments, and Self-Help Aids.

[](#the-above-search-would-have-narrowed-your-2000-gloves-down-the-15-with-the-ability-to-narrow-it-down-even-further-using-the-three-addional-nodes-of-exercise-equipment-treatments-and-self-help-aids)

### Item Lookup

[](#item-lookup)

```
$lookup = new Mckesson($identity, $secret, $account_number, $b2b_key);
$result = $lookup->lookup('978841');
var_dump($result);
```

### Types

[](#types)

#### You can also pass an additional type or combination of types with the above methods. They include availability, detail, extra, and image. If no type is chosen, it will default to 'availability detail'.

[](#you-can-also-pass-an-additional-type-or-combination-of-types-with-the-above-methods-they-include-availability-detail-extra-and-image-if-no-type-is-chosen-it-will-default-to-availability-detail)

- availability - Updating prices or checking availability.
- detail - General product information.
- extra - Ideal for product images, features, and atrributes.
- image - To get the item image.

```
$lookup = new Mckesson($identity, $secret, $account_number, $b2b_key);
$result = $lookup->lookup('978841','extra');
var_dump($result);
```

### Item Feed

[](#item-feed)

```
$feed = new Mckesson($identity, $secret, $account_number, $b2b_key);
$result = $feed->feed('foo','list', 802115, 'detail availability');
var_dump($result);
```

### Item Ordering

[](#item-ordering)

```
//first you will need to setup the required arrays.
$customer = [
    'orderId' => 123,
    'total' => '12.00',
    'customerName' => 'Nicholas Cheek',
    'address1' => '123 Anystreet Dr',
    'address2' => 'Suite F', //optional
    'city' => 'Little Rock',
    'state' => 'AR',
    'zip' => 72019,
    'phone' => '5011234567', //optional
    'email' => 'nick@nicholascheek.com', //optional (*i think*)
    'customerId' => 12345
    ];

$item1 = [
    'qty' => 2,
    'sku' => 123456,
    'price' => '12.00',
    'uom' => 'BX'
];

$item2 = [
    'qty' => 2,
    'sku' => 78901,
    'price' => '12.00',
    'uom' => 'BX'
];

$order = [$item1, $item2];

$order = new Mckesson($identity, $secret, $account_number, $b2b_key);
$result = $order->order($customer, $order) // or whatever you're searching
var_dump($result);
```

### Using the Builder

[](#using-the-builder)

```
//You can use the builder to make it easy to build up items and customers.
$builder = new Mckesson($identity, $secret, $account_number, $b2b_key);
$items = $builder->addItem(2, '123456','12.00','BX');
$items = $builder->addItem(1, '23939291','23.00','EA');
$items = $builder->addItem(19, '8328237','83.00','CS');
$customer = $builder->addCustomer(12345,'23.00','nick cheek','201 MyStreet Ave', '', 'Little Rock', 'AR',72204,'','',123456778);

//afterwards, you can order like so:
$order = $builder->order($customer, $items);
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Nicholas Cheek](https://github.com/nickcheek)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

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

Total

5

Last Release

1604d ago

PHP version history (2 changes)v1.1.1PHP ^7.1

v1.2PHP ^7.1.3 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f33b515b89e91b73f02d7f38c436c85be7f9035c99f0cfa1ba78a1806045def?d=identicon)[nickcheek](/maintainers/nickcheek)

---

Top Contributors

[![nickcheek](https://avatars.githubusercontent.com/u/7572691?v=4)](https://github.com/nickcheek "nickcheek (15 commits)")

---

Tags

nickcheekmckesson

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nickcheek-mckesson/health.svg)

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

PHPackages © 2026

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