PHPackages                             hvenus/jingdong-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. [API Development](/categories/api)
4. /
5. hvenus/jingdong-api

ActiveLibrary[API Development](/categories/api)

hvenus/jingdong-api
===================

京东接口

1.5(8y ago)34573MITPHPPHP &gt;=5.5.9

Since May 27Pushed 8y ago2 watchersCompare

[ Source](https://github.com/hVenus/Jingdong-api)[ Packagist](https://packagist.org/packages/hvenus/jingdong-api)[ RSS](/packages/hvenus-jingdong-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (7)Dependencies (2)Versions (9)Used By (0)

Jingdong-api
============

[](#jingdong-api)

京东接口

> 本接口基于京东宙斯系统所提供API创建，请以宙斯系统为准，本程序若未及时更新，敬请详解。

安装
--

[](#安装)

composer require hvenus/Jingdong-api

使用
--

[](#使用)

示例

```
// 创建实例
$jd = new JD();

// 设置系统参数
$jd->setConfig([
    'AppKey' => 'YOUR_APP_KEY',
    'AppSecret' => 'YOUR_APP_SECRET',
    'Url' => 'https://api.jd.com',
    'Uri' => 'routerjson',
    'Version' => '2.0',
    'Format' => 'json',
    'deptNos' => '事业部编号',
]);

// 设置应用参数
$jd->setParams([
    'access_token' => 'YOUR_ACCESS_TOKEN'
]);

// 获取京东快递运单号
$jd->ExpressGetWaybillCode([
    'preNum' => 1,
    'customerCode' => '商家编码',
    'orderType' => 0
]);

// 返回值(JSON)：
{
    "jingdong_etms_waybillcode_get_responce": {
        "resultInfo": {
            "message": "成功",
            "code": "100",
            "deliveryIdList": [
                {
                    "deliveryIdList": "这里是快递号"
                }
            ]
        }
    }
}
```

注意:
---

[](#注意)

以上面示例为例。

京东的接口文档里返回值写明是 "jingdong\_etms\_waybillcode\_get\_response"，可实际返回的是"jingdong\_etms\_waybillcode\_get\_responce"，"response"拼成了"responce"。

京东所有接口的返回值里 "response" 都拼成了 "responce"。

别问我怎么知道的！！！

已完成接口
-----

[](#已完成接口)

- ACCOUNT 子账号API
- ADDRESS 京东地址库API
- ECLP ECLP仓海API
- EXPRESS 京东快递API
- CATEGORY 类目API
- DSP 京准通-快车API
- SHOP 店铺API
- ORDER 订单API

其它
--

[](#其它)

PHP函数不允许以数字开头，所以所有数字开头的前面都多加个“jd\_”前缀以示区别.

刷新授权Token
---------

[](#刷新授权token)

京东的授权Token正式环境下是一年的有效期，可以写个定时任务每天去检查下token的过期时间，根据需要来自动刷新。

示例

```
// 先取出已经获得到授权数据
$auth_time = $config['jd:auth:time']; // token发放时间，单位毫秒
$auth_expires_in = $config['jd:auth:expires_in']; // 有效期时长, 单位秒
$auth_refresh_token = $config['jd:auth:refresh_token']; // refresh_token
$expires_time = $auth_time + $auth_expires_in * 1000; // 计算过期时间，单位毫秒。 token发放时间(毫秒) + 有效期时长(秒) * 1000
$diff = $expires_time/1000 - time(); // 取差值，表示还剩多少秒过期。
$deadline = 60*60*24; // 一天
if ($diff  $config['AppKey'],
      'client_secret' => $config['AppSecret'],
      'refresh_token' => $config['refresh_token'],
      'state' => $Something, // 此参数内容原样返回
    ];
    $result = $jd->RefreshToken($param);
    if (false !== $result) {
        // 重新设置新token
        $config['jd:auth:access_token'] = $result['access_token']; // 新access_token
        $config['jd:auth:expires_in'] = $result['expires_in'];
        $config['jd:auth:refresh_token'] = $result['refresh_token']; // 京东文档说refresh_token是不变的。
        $config['jd:auth:time'] = $result['time'];
    }
}
```

License
-------

[](#license)

MIT

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

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

Recently: every ~66 days

Total

7

Last Release

3048d ago

### Community

Maintainers

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

---

Top Contributors

[![hVenus](https://avatars.githubusercontent.com/u/1572430?v=4)](https://github.com/hVenus "hVenus (16 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hvenus-jingdong-api/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1772.4k4](/packages/aimeos-prisma)

PHPackages © 2026

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