npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jdl-sdk-node

v1.0.0

Published

京东物流服务端接口的 Node.js 版本封装,暴露出简单的方法函数供调用。(非官方)

Downloads

8

Readme

京东物流 JDL SDK For Node.js

京东物流服务端接口的 Node.js 版本封装,暴露出简单的方法函数供调用。(非官方)

安装

npm install jdl-sdk-node

使用

初始化

// CommonJS
const { JDL } = require("jdl-sdk-node");
// esModule
import { JDL } from "jdl-sdk-node";
// 初始化
const jdl = new JDL({
  appKey: "your app key",
  appSecret: "your app secret",
  accessToken: "your access token",
  env: "prod" // 环境参数,可选 prod 、 test, 默认 prod, 测试环境使用 test
});

// 使用 获取运单号
jdl.preGetWaybillCodes([{ orderOrigin: 2, customerCode: "010K000001", sum: 2 }]).then(res => {
  console.log(res);
});

options

| 参数名称 | 值描述 | | ----------- | --------------------------------------------------------------------- | | appSecret | 应用的 appSecret,可从【控制台-应用管理-概览】中查看 | | accessToken | “ISV 应用”、“自研商家应用”传值:用户授权完成时平台分配的 access_token | | appKey | 应用的 appKey,可从【控制台-应用管理-概览】中查看 | | env | 环境参数,可选 prod 、 test, 默认 prod, 测试环境使用 test |


注意事项

京东物流要求 所有 API 的入参都是数组包裹的对象 否则报错 code 62

// 错误示例 ❌
jdl.preGetWaybillCodes({ orderOrigin: 2, customerCode: "010K000001", sum: 2 }).then(res => {
  console.log(res);
});
// 正确示例 ✅
jdl.preGetWaybillCodes([{ orderOrigin: 2, customerCode: "010K000001", sum: 2 }]).then(res => {
  console.log(res);
});

相关文档

  • 联调指南 https://cloud.jdl.com/#/open-business-document/access-guide/267/53377
  • 业务错误码说明 https://cloud.jdl.com/#/open-business-document/access-guide/267/54365
  • API 平台错误码 https://cloud.jdl.com/#/open-business-document/access-guide/267/53215

API

获取运单号

若入参传了「cargoes-货品信息」和「productsReq-产品信息」,则接口校验客户编码下的产品信息,校验通过后出参返回揽收时间范围、支持的产品、预计送达时间以及预估费用

preGetWaybillCodes(data: PreGetWaybillCodesRequest)

下单接口

commonCreateOrderV1(data: object)

订单修改

commonModifyOrderV1(data: object)

订单取消

commonCancelOrderV1(data: object)

订单状态查询

commonGetOrderStatusV1(data: object)

订单轨迹查询

commonGetOrderTraceV1(data: object)

获取运单实时位置

getWaybillGisTrackByWaybillCode(data: object)

查询运单预计送达时间

queryOrderInfoByCondition(data: object)

查询电子签名图片

querySignatureImage(data: object)

查询标价运费

queryFeeResultByBusinessNo(data: object)

实际费用查询

commonGetActualFeeInfoV1(data: object)

物流轨迹订阅

commonSubscribeTraceV1(data: object)

参考文档