PHPackages                             lecangs/open-api - 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. lecangs/open-api

ActiveLibrary

lecangs/open-api
================

乐歌海外仓开发包

v1.1.0(1y ago)019MITPHPPHP ^7.4 || ^8.0

Since Dec 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AndyMoxq/lecangs)[ Packagist](https://packagist.org/packages/lecangs/open-api)[ RSS](/packages/lecangs-open-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Lecangs Open API SDK for PHP
============================

[](#lecangs-open-api-sdk-for-php)

乐歌海外仓 Open API PHP SDK 提供了一套简单的方式来调用乐歌 OMS 系统 API，支持查询库存、订单管理等功能。

环境要求
----

[](#环境要求)

- PHP 版本要求：**7.0 或更高版本**
- Composer 包管理工具

安装
--

[](#安装)

使用 Composer 安装：

```
composer require lecangs/open-api
```

参考文档
----

[](#参考文档)

更多接口详情，请参考乐歌海外仓官方 API 文档：[乐歌海外仓 API 文档](https://app.lecangs.com/wiki?systemType=OMS_CLIENT&id=37)

使用示例
====

[](#使用示例)

以下示例展示如何通过 SDK 调用库存分页查询接口。

```
use Lecangs\OpenApi\Contracts\Config;
use Lecangs\OpenApi\System\Request\AppUnityRequest;
use Lecangs\OpenApi\Lecangs;
use Lecangs\OpenApi\Constants\ApiUri;

try {
    // 配置访问凭证
    $config = new Config();
    $config->setAccessKey('Your-AccessKey')
           ->setSecretKey('Your-SecretKey')
           ->setIsDev();  // 设置为开发环境，可根据需要调整

    // 请求体
    $body = [
        'pageNum' => '1',
    ];

    // 创建请求实例
    $request = new AppUnityRequest();
    $request->setMethod('post')
            ->setApiUri(ApiUri::INVENTORY_OVERVIEW)
            ->setBody($body);

    // 发起请求并获取响应
    $response = Lecangs::system($config)->appUnity($request);

    // 输出响应结果
    var_dump($response->getData());  // 返回的数据
    var_dump($response->getCode());  // 响应码
    var_dump($response->getMessage());  // 响应消息
} catch (\Exception $e) {
    // 处理异常
    var_dump($e->getMessage());
}
```

常量说明
----

[](#常量说明)

ApiUri 类中定义了多个可用的 API 地址常量，用于不同的业务场景。

示例常量
----

[](#示例常量)

```
namespace Lecangs\OpenApi\Constants;

class ApiUri {
    const INVENTORY_OVERVIEW = '/oms/inventoryOverview/apiPage';  // 分页查询库存
    const TOC_ORDER_LIST = '/oms/omsTocOrder/listByOrderNos';     // 查询 2C 订单列表
    const CREATE_TOC_ORDER = '/oms/omsTocOrder/create';           // 创建 2C 订单
    const CANCEL_TOC_ORDER = '/oms/omsTocOrder/cancel';           // 取消 2C 订单
}
```

反馈和支持
-----

[](#反馈和支持)

如有任何问题或建议，请联系 SDK 维护者或提交 issue。

许可证
---

[](#许可证)

本项目遵循 MIT 许可证。详细信息请查阅 LICENSE 文件。

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

530d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbc5c485ed4609a934dba135f1dcfc1201511d73acc53f896a53ba41caf3e1ae?d=identicon)[AndyMoxq](/maintainers/AndyMoxq)

### Embed Badge

![Health badge](/badges/lecangs-open-api/health.svg)

```
[![Health](https://phpackages.com/badges/lecangs-open-api/health.svg)](https://phpackages.com/packages/lecangs-open-api)
```

PHPackages © 2026

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