PHPackages                             hanson/weidian - 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. hanson/weidian

ActiveLibrary

hanson/weidian
==============

1.0.3(9y ago)8652MITPHP

Since Jun 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/HanSon/weidian-sdk)[ Packagist](https://packagist.org/packages/hanson/weidian)[ RSS](/packages/hanson-weidian/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

weidian-sdk
===========

[](#weidian-sdk)

微店的API接口包

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

[](#installation)

```
composer require hanson/weidian

```

Usage
-----

[](#usage)

```
$weidian = new Hanccc/Weidian('appkey', 'secret');
//$weidian = new Hanccc/Weidian('appkey', 'secret', 'access_token');

//上架举例

$data = ['itemid' => 'itemid', 'opt' => 1];

$weidian->send(Hanccc\Services\ItemService::itemOnSale($data));

```

### Notice

[](#notice)

文档有版本号限制,此包版本为 2016-6-20 的版本, 如有变动可手动设置版本号或提交issue通知本人变更

```
$weidian->send(Hanccc\Services\ItemService::itemOnSale($data, '1.0.1'));

```

### Document

[](#document)

具体传参请查阅 [官方文档链接](http://wiki.open.weidian.com/)

### 商品API

[](#商品api)

```

Hanccc\Services\ItemService::getItem($data)

Hanccc\Services\ItemService::addItem($data)

Hanccc\Services\ItemService::listItem($data)

Hanccc\Services\ItemService::deleteItem($data)

Hanccc\Services\ItemService::addItemImage($data)

Hanccc\Services\ItemService::deleteItemImage($data)

Hanccc\Services\ItemService::updateItem($data)

Hanccc\Services\ItemService::addItemSku($data)

Hanccc\Services\ItemService::updateItemSku($data)

Hanccc\Services\ItemService::deleteItemSku($data)

Hanccc\Services\ItemService::getItemCate($data)

Hanccc\Services\ItemService::setItemCate($data)

Hanccc\Services\ItemService::cancelItemCate($data)

Hanccc\Services\ItemService::addItemCate($data)

Hanccc\Services\ItemService::updateItemCate($data)

Hanccc\Services\ItemService::deleteItemCate($data)

Hanccc\Services\ItemService::itemOnSale($data)

Hanccc\Services\ItemService::itemSetTop($data)

Hanccc\Services\ItemService::itemCancelTop($data)

Hanccc\Services\ItemService::delDiscountItem($data)

Hanccc\Services\ItemService::getCateList($data)

```

### 订单API

[](#订单api)

```
Hanccc\Services\OrderService::getOrderList($data)

Hanccc\Services\OrderService::getOrder($data)

Hanccc\Services\OrderService::deliverOrder($data)

Hanccc\Services\OrderService::modifyExpress($data)

Hanccc\Services\OrderService::modifyOrder($data)

Hanccc\Services\OrderService::refundOrder($data)

Hanccc\Services\OrderService::cancelOrder($data)

Hanccc\Services\OrderService::delayOrder($data)

```

### 营销工具API

[](#营销工具api)

```
Hanccc\Services\MarketService::getDiscountList($data)

Hanccc\Services\MarketService::setDiscountItem($data)

Hanccc\Services\MarketService::createCoupon($data)

Hanccc\Services\MarketService::deleteCoupon($data)

Hanccc\Services\MarketService::getCoupon($data)

Hanccc\Services\MarketService::getCouponList($data)

Hanccc\Services\MarketService::getCouponReport($data)

```

### CPS API

[](#cps-api)

```
Hanccc\Services\CpsService::searchItem($data)

Hanccc\Services\CpsService::getCpsItem($data)

Hanccc\Services\CpsService::getItemPublic($data)

```

### 微中心API

[](#微中心api)

```
Hanccc\Services\WeiService::listOrder($data)

Hanccc\Services\WeiService::getOrder($data)

Hanccc\Services\WeiService::deliverOrder($data)

Hanccc\Services\WeiService::modifyExpress($data)

```

###  Health Score

31

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

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 ~6 days

Total

4

Last Release

3551d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/998d7b42b1dc8c352825b1c6546a1aa0fd0b28eb5cefe4059a727e8181594956?d=identicon)[hanson](/maintainers/hanson)

---

Top Contributors

[![Hanson](https://avatars.githubusercontent.com/u/10583423?v=4)](https://github.com/Hanson "Hanson (17 commits)")

### Embed Badge

![Health badge](/badges/hanson-weidian/health.svg)

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

PHPackages © 2026

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