正在加载页面,请稍候…

公开文档

库存查询

分页获取库存查询列表

瑞盈毛行ERP公开接口限流 不限

接口地址

按环境选择对应 Base URL,请求方法见下方标识。

请求基础路径https://api.maoyimall.com/wewin/
POST
Request Method库存查询
生产环境
/open/wool/woolstorge
测试环境
/open/wool/woolstorge

调用说明

鉴权方式、调用限制与参数概览。

鉴权方式

请求需携带应用密钥相关 Header(见下方请求头参数),请先在控制台创建应用并获取 AppId / AppSecret。

调用限制

当前接口日限额为 不限 。超出限额将返回限流错误,请合理控制调用频率。

参数概览

Header 7 项 · Body 9 项 · 其中必填 10 项

字段名类型是否必填说明示例
pageNonumber必填页码1
pageSizenumber必填页数1
mkDatestring必填截止日期2026-10-30
woolTypestring可选查询字段:品种—
vatNostring可选查询字段:缸号—
colorIdstring可选查询字段:色号—
pnstring可选查询字段:批号—
ascstring可选排序;可选值:asc/desc—
typestring可选筛选:0:全部,1:正数,2:非零数—
字段名类型是否必返说明示例
errcodenumber必返错误码0
errmsgstring必返错误码英文信息ok
dataobject可选成功时返回的具体数据—
listobject可选当前页记录列表,里面是具体生产/订单记录—
recordsobject[]可选当前页记录列表,里面是具体生产/订单记录—
vatNostring可选缸号2408109G
netWeightnumber可选库存重-1808.3
woolTypestring可选品种28/2高弹包芯纱
colorstring可选颜色枣红
colorIdstring可选色号A12G
houseNamestring可选仓库—
storePosstring可选仓位—
lockWeightnumber可选预留数1.8
packTypestring可选包装筒装
woolPnstring可选批号—
typestring可选——
dyeColorIdstring可选染厂色号—
mkDatestring可选末次销售2026-09-30 00:00:00
inDatestring可选末次入仓—
incIdstring可选门店—
inWeightnumber可选—0
outWeightnumber可选—1806.5
stripQtynumber可选件数-84
qtyWeightnumber可选个重0
qtynumber可选个数7
packQtynumber可选扎数0
salePricenumber可选售价0
costPricenumber可选成本价0
costMoneynumber可选—0
saleMoneynumber可选—0
pcWeightnumber可选件重18
weightDigitnumber可选—2
spinPLIDstring可选——
providerNamestring可选供应商—
totalnumber可选总记录数27589
sizenumber可选每页条数1
currentnumber可选当前页码1
ordersarray可选排序规则列表[]
optimizeCountSqlboolean可选是否优化 count SQLtrue
searchCountboolean可选是否执行 count 查询true
maxLimitstring可选最大查询条数限制—
countIdstring可选count 查询标识—
pagesnumber可选总页数27589
sumNetWeightnumber可选重量-15441743.22
sumStripQtynumber可选件数-759028
sumQtynumber可选个数109307
vatNoSetstring可选——
timestampnumber必返请求发生时的毫秒级时间戳1791941076009

请求示例

1

可直接复制到本地调试的多语言示例。

JavaScript
const crypto = require('crypto'); 

// 请替换为真实的appid,appsecret,access token 
const APP_ID       = 'your_app_id'; 
const APP_SECRET   = 'your_app_secret'; 
const ACCESS_TOKEN = 'your_access_token'; 


function sign(method, path, query, body) { 
  const sha256Hex = d => crypto.createHash('sha256').update(d).digest('hex'); 
  const hmac      = (k, d) => crypto.createHmac('sha256', k).update(d).digest(); 
  const b64u      = b => b.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); 
  const b64uDec   = s => Buffer.from(s.replace(/-/g, '+').replace(/_/g, '/'), 'base64'); 

  const timestamp = Math.floor(Date.now() / 1000).toString(); 
  const nonce     = crypto.randomBytes(16).toString('hex'); 

  // 派生 signingKey 
  const signingKey = b64u(hmac(APP_SECRET, 'wewin-openapi-sign-v1
' + ACCESS_TOKEN)); 

  // 构造 query 
  const canonicalQuery = Object.keys(query || {}).sort() 
    .map(k => encodeURIComponent(k) + '=' + encodeURIComponent(query[k])) 
    .join('&'); 


  const canonicalRequest = [ 
    'WEWIN-HMAC-SHA256', 
    APP_ID, 
    sha256Hex(ACCESS_TOKEN), 
    timestamp, 
    nonce, 
    method.toUpperCase(), 
    path, 
    canonicalQuery, 
    'application/json', 
    sha256Hex(body || '') 
  ].join('
'); 


  const signature = b64u(hmac(b64uDec(signingKey), canonicalRequest)); 

  return { 
    query: canonicalQuery, 
    headers: { 
      'Content-Type':   'application/json', 
      'O-App-Id':       APP_ID, 
      'O-Access-Token': ACCESS_TOKEN, 
      'O-Timestamp':    timestamp, 
      'O-Nonce':        nonce, 
      'O-Sign-Version': 'v1', 
      'O-Signature':    signature 
    } 
  }; 
} 


const method = 'POST'; 
const path   = '/open/wool/woolstorge'; 
const params = {};                                  // 查询参数 
const body   = JSON.stringify({ /* 业务参数 */ });   // 请求体 

const { query, headers } = sign(method, path, params, body); 
const url = 'https://test.example.com' + path + (query ? '?' + query : ''); 

fetch(url, { 
  method: method, 
  headers: headers, 
  body: body 
}) 
  .then(res => res.json()) 
  .then(data => { 
    console.log(data); 
  }); 
  .catch(err => { 
    console.error('请求失败:', err); 
  }); 
成功响应
{
  "errcode": 0,
  "errmsg": "ok",
  "data": {
    "list": {
      "records": [
        {
          "vatNo": "2408109G",
          "netWeight": -1808.3,
          "woolType": "28/2高弹包芯纱",
          "color": "枣红",
          "colorId": "A12G",
          "houseName": "",
          "storePos": "",
          "lockWeight": 1.8,
          "packType": "筒装",
          "woolPn": "",
          "type": null,
          "dyeColorId": "",
          "mkDate": "2026-09-30 00:00:00",
          "inDate": null,
          "incId": "",
          "inWeight": 0,
          "outWeight": 1806.5,
          "stripQty": -84,
          "qtyWeight": 0,
          "qty": 7,
          "packQty": 0,
          "salePrice": 0,
          "costPrice": 0,
          "costMoney": 0,
          "saleMoney": 0,
          "pcWeight": 18,
          "weightDigit": 2,
          "spinPLID": null,
          "providerName": null
        }
      ],
      "total": 27589,
      "size": 1,
      "current": 1,
      "orders": [],
      "optimizeCountSql": true,
      "searchCount": true,
      "maxLimit": null,
      "countId": null,
      "pages": 27589
    },
    "sumNetWeight": -15441743.22,
    "sumStripQty": -759028,
    "sumQty": 109307,
    "vatNoSet": null
  },
  "timestamp": 1791941076009
}
失败响应
{
  "code": 500,
  "message": "操作失败",
  "result": null
}
错误码英文说明中文说明
-1system error系统繁忙,请稍候再试
40001appid invalidAPPID无效或不存在
40002appsecret invalidAppSecret错误,请检查密钥
41001access_token missing请求中未携带access_token
41002access_token expiredacess_token已过期,请重新获取