橙子通API自动化

v1.0.0

橙子通(orange-office.cn)库存管理系统 API 自动化。用于通过 API 创建出库单、查询库存、管理主播仓库等,无需浏览器。

0· 110·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for xiao1230123/orange-office-api.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "橙子通API自动化" (xiao1230123/orange-office-api) from ClawHub.
Skill page: https://clawhub.ai/xiao1230123/orange-office-api
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install orange-office-api

ClawHub CLI

Package manager switcher

npx clawhub@latest install orange-office-api
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
The skill's name and description match the instructions: it documents how to query stock, create/update/delete stockout orders, and how to write inventory snapshots to DingTalk tables. The listed teamId, locId, tableId and fieldId mappings are consistent with the described use-case.
Instruction Scope
SKILL.md gives concrete API paths, a signing algorithm (static salt), request headers, and payload examples for orange-office.cn — all within scope. It also instructs reading/writing DingTalk tables (get_fields, writing records via cells) but does not include explicit DingTalk API endpoint/URL or authentication flow; it expects a live ASP.NET_SessionId Cookie for orange-office and implies use of some SESSION variable. The document references sensitive inputs (session cookie, possibly DingTalk credentials) but does not declare how the agent should securely obtain them.
Install Mechanism
No install spec and no code files (instruction-only). Nothing is written to disk or downloaded during install, which is the lowest-risk installation footprint.
Credentials
The skill does not declare any required environment variables, yet the examples reference a SESSION value (ASP.NET_SessionId) and the instructions require valid session cookies and likely DingTalk credentials to read/write tables. Asking for those credentials would be expected for this functionality, but omission is a mismatch that the user should notice because these are sensitive secrets.
Persistence & Privilege
Flags show always:false and normal autonomous invocation allowed. The skill does not request permanent presence or modify other skills; no elevated persistence or privilege is requested by the package itself.
Assessment
This skill is largely coherent with its description: it documents how to call orange-office APIs and how to update DingTalk tables. Before using it, be aware that it requires sensitive credentials that are not declared in the metadata: a valid ASP.NET_SessionId cookie for orange-office and (likely) DingTalk API access to write tables. Only provide those credentials if you trust the skill author and the runtime environment. Prefer using a limited-permission or test account and avoid sharing your primary account's session token. Ask the author to (1) declare required env vars (e.g., ORANGE_OFFICE_SESSION, DINGTALK_TOKEN) in the skill metadata, (2) specify exact DingTalk endpoints and auth flow, and (3) confirm that no data is sent to any third-party endpoints other than orange-office.cn and the official DingTalk API. If you cannot verify the source, test with throwaway credentials and monitor outbound network requests.

Like a lobster shell, security has layers — review code before you run it.

latestvk972kyp0nhqcxe0sdkb89jbsf983s4qm
110downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

橙子通 API 自动化技能

通过 API 操作橙子通库存管理系统,包括创建出库单、查询库存、管理主播仓库等。

基础信息

双系统识别

系统名teamId用途
库存通-库存通952393固定仓库出入库
库存通-幼稚鬼潮玩724308主播出库用这个

API 调用

签名算法

import hashlib

SALT = '68756c61'

def md5(data: str) -> str:
    return hashlib.md5((SALT + data).encode()).digest().hex()

所有 API 请求 body 经过签名,sign = md5(json.dumps(body, separators=(',',':')))

请求头

headers = {
    'Content-Type': 'application/json',
    'X-Requested-With': 'XMLHttpRequest',
    'sign': md5(json.dumps(body, separators=(',',':'))),
    'client': 'pcWeb',
    'Cookie': f'ASP.NET_SessionId={SESSION}'
}

常用 API

功能路径说明
创建出库单POST /stock/stockout/create
修改出库单POST /stock/stockout/update
删除出库单POST /stock/stockout/delete
获取出库单列表POST /stock/stockout/getList
获取出库单详情POST /stock/stockout/getInfo
查询库存POST /stock/prod/getStockList必须带 locId

查询库存

POST /stock/prod/getStockList
{
    "keyword": "", "catId": "", "page": 1, "rows": 500,
    "sort": "barcode", "order": "descending",
    "teamId": 724308,        # 场景B用724308,场景A用952393
    "ifValue": "Y",
    "ifShowSku": "Y",
    "ifShowZero": "N",
    "locId": 63              # 仓库ID,必须填写
}

返回:response.obj.list[] — 每项含 prodIdprodNamestockQtyoutPrice

创建出库单

POST /stock/stockout/create
{
    "teamId": 724308,
    "outNo": "",             # 空字符串自动生成
    "outDate": "2026-03-26",
    "refId": 695620,         # 抖店售卖
    "refName": "抖店售卖",
    "locId": 63,             # 仓库ID
    "locName": "梅天娇",
    "amount": 1234.56,       # 总金额 = 各行 amount 之和
    "remark": "机器人操作",
    "itemList": [
        {
            "prodId": 9973574,
            "qty": 24,
            "price": 15,      # 单价从 getStockList 的 outPrice 字段获取
            "amount": 360,    # qty × price,保留2位小数
            "outQty": 24,
            "stockQty": 36
        }
    ]
}

注意

  • 单价用 outPrice(不是 price)
  • 金额:amount = qty × outPrice,保留2位小数
  • 总金额 amount = 各行 amount 之和

出库操作三原则

  1. 只认"销售数量"字段 — 其他字段(库存、今日转仓、销售金额等)一律不看
  2. 每个主播只建一张出库单 — 出错时在原单上修改,不删除重建
  3. 先查库存再创建 — 必须先调 API 查询实际库存,确认足够后再创建

主播仓库 locId 对应表

系统:库存通-幼稚鬼潮玩(teamId=724308)

主播locId
邓晓美15
梅天娇63
罗文婧57
苟林分71
张儒尊16
廖紫帆68
冉红霞9
周语妍7
杜瑶79
倪玉婷44
曹洢珂晗80
谷乐欣49
高李伟69
王馨宇30
李妍茜29
钟雨欣8
黄敏慧50
廖文琪3
杨名10
刘明月4

钉钉主播库存表

  • baseIddxXB52LJqnrEb4pjcQQQjq598qjMp697
  • 每个主播有独立的 tableId
主播tableId销售数量字段
邓晓美yj6ZAgXCcg9VfH
梅天娇exNEdWqlFRkHI3
罗文婧TZvYd1VACXQniC
苟林分kIcLRmkYdlC9og
张儒尊yy2mQJS6WcPYAw
廖紫帆ER5lrFrLMixcf1
冉红霞YMnnPwVtzjnNNK
周语妍JR04qLuqKu49Ok
杜瑶143LNaMY3XobF0
倪玉婷HTfR4PuBKCiXNl
曹洢珂晗xyAVrjrKilxGYr
谷乐欣MwtqlRv05RaEdP
高李伟ETlz1vwY3FmkMG
王馨宇6xK7UjKSo8eWZ5
李妍茜wUBEIEDdtZXTtB
钟雨欣3P6EtSyo9BFZd2
黄敏慧sXo9484vCBtAiB
廖文琪vFkcdBhBleldKK
杨名11ESFXjOXj619G
刘明月RFkRdbHeKjh1jK

注意:每个主播的"销售数量"字段ID可能不同,操作前必须先调用 get_fields 读取表头确认。

商品名称注意

  • kpl燃礼盒(是"竟"不是"竞")
  • pel物竞天择风云变系列盲抽镭射票盲抽亚克力挂件 是两个不同商品
  • 卡夹类(130pt卡夹、75pt卡夹等)忽略,无需出库

钉钉主播库存表写入规范(重要!)

录入主播库存快照时,必须包含以下全部字段

字段说明来源
日期库存账面日期手动指定,如 2026-03-27T00:00:00+08:00
商品编号商品编码API getStockList 返回的 prodNo
商品名称商品全名API getStockList 返回的 prodName
规格型号包装规格API getStockList 返回的 prodSpec
单位计量单位API getStockList 返回的 unit
库存数量账面库存计算得出(当前库存 + 当日出库回补)

写入格式:使用 cells 而非 fields,每个字段对应其 fieldId

const records = snapshot.map(item => ({
  cells: {
    [fieldId_日期]: '2026-03-27T00:00:00+08:00',
    [fieldId_商品编号]: item.prodNo || '',
    [fieldId_商品名称]: item.prodName,
    [fieldId_规格型号]: item.prodSpec || '',
    [fieldId_单位]: item.unit || '包',
    [fieldId_库存数量]: item.qty,
    // 以下字段填0或空
    [fieldId_今日入库]: 0,
    [fieldId_今日剩余]: 0,
    [fieldId_销售金额]: '',
    [fieldId_送出]: 0,
    [fieldId_销售数量]: 0,
    [fieldId_今日转仓]: 0
  }
}));

日期格式:必须是 ISO 格式(如 2026-03-27T00:00:00+08:00),不能只写 2026-03-27

计算3月27日库存快照

  1. 调用 getStockList 获取当前库存
  2. 调用 getList 查询日期=3月27日的出库单
  3. 对每张出库单调用 getInfo 获取明细
  4. 将出库数量加回到当前库存,得到3月27日账面库存

3月28日之后做快照:由于3月27日之后可能还有出库,必须先查3月28日之后有无新的出库单,如有则同样回补。如果3月28日至今无出库单,直接用当前库存即为3月27日快照。

常见问题

Q:保存时报"总金额错误" A:确保每个商品的 amount = qty × outPrice,且总金额 obj.amount 等于各行 amount 之和

Q:商品找不到 A:用更短的关键词搜索相近商品名称

Q:Session 过期 A:重新登录并获取新的 Cookie

Comments

Loading comments...