Mighty Shield API 接口文档
本文档为 Mighty Shield API 对外接口文档,包含公共签名规则、统一响应格式、业务接口和返回示例。页面部署在 API 模块静态资源下,可通过 https://www.maiyidun.com/third/ig-compatible-api.html 访问;服务域名为 https://www.maiyidun.com,各接口路径以文档中 URL 为准。
版本记录
| 版本 | 日期 | 修改内容 |
|---|---|---|
| v1.2.11 | 2026-10-21 | 为渠道业务错误新增 201xxx 错误码,区分参数、商品、价格、订单、余额、下游及系统异常;鉴权错误码保持不变。查看:统一响应与错误码 |
| v1.2.10 | 2026-10-19 | 新增 trade_info,按 trade_id 实时查询单件在售商品,data 直接返回商品对象,字段、币种及报价口径与 trade_list 的商品明细一致;补充请求签名、适用范围、异常行为及中英文示例。查看:单件商品详情查询 |
| v1.2.9 | 2026-10-16 | 新增 quick_order,按商品名称、最高价及可选磨损范围购买一件商品;余额须严格大于最高价,待确认期间冻结最高价,成交后按实际成交售价扣款。补充签名、币种、响应和超时查询说明;原有下单接口不变。查看:按条件快速下单 |
| v1.2.7 | 2026-10-08 | 取消原因新增 14(买家取消订单,发货阶段未明确)、15(卖家取消订单,发货阶段未明确),保留已知取消方信息。订单查询、取消响应、历史订单及回调统一使用;原有枚举含义不变,请兼容新增枚举值。查看:取消原因、订单查询、取消订单、历史订单、订单回调 |
| v1.2.6 | 2026-10-08 | 完善中英文响应字段说明,补充商品、下单、订单查询、历史订单、商户资金、WSS 及回调字段的含义、类型、枚举、空值与条件返回规则;明确 ID 区别、分页类型、时间戳单位及 provisional_time 当前返回行为与语义限制;修正已完成订单示例中的 cancel_type 为 null。本次为文档补充与示例修正,不涉及接口行为变更。查看:商品查询、下单、订单查询、历史订单、商户资金、WSS、订单回调 |
| v1.2.5 | 2026-09-22 | 取消原因新增 12(收货后保护期内卖家撤销)、13(买家撤销)。查询、历史订单及回调使用统一含义;原有枚举不变。请兼容未知枚举值,取消操作方不等于责任方。查看:取消原因、订单查询、历史订单、订单回调 |
| v1.2.4 | 2026-08-18 | 商品查询、商品全量同步和 WSS 商品推送中,Doppler / Gamma Doppler 商品新增 is_doppler、family、style、label 字段。查看:商品查询字段、商品全量同步、WSS 商品推送 |
| v1.2.3 | 2026-08-14 | 新增订单状态回调通知说明,补充回调报文结构、回调签名规则、响应成功判定和未配置回调地址时的处理口径。查看:订单状态回调通知 |
| v1.2.2 | 2026-08-13 | 订单状态查询、取消订单返回和历史订单查询新增 withdrawn_flag、withdrawal_liability_status 字段,用于返回下游订单撤回状态和撤回判责。查看:订单查询、取消订单、历史订单 |
| v1.2.1 | 2026-08-12 | 所有包含金额的商品、订单、商户资金和 WSS 商品对象新增 currency 字段,明确标识当前对象金额币种,取值为 CNY 或 USD。查看:币种与金额口径 |
| v1.2.0 | 2026-08-11 | 新增美元结算口径说明:商品价格、下单价格、订单金额、商户资金和 WSS 商品推送金额均按渠道账户结算币种返回;美元渠道下单价格按最新汇率校验。查看:币种与金额口径 |
| v1.1.0 | 2026-08-07 | 订单查询字段 cancle_type 更名为 cancel_type;取消原因枚举更新为 12 项(1-11、100),仅 status=1 时有值。查看:取消原因、订单查询字段 |
| v1.0.1 | 2026-08-04 | 新增对外 WSS 接入说明、商品发货模式字段、delivery_type 类型说明和本地商品全量同步接口。查看:WSS 接入、商品字段、商品全量同步 |
| v1.0.0 | 2026-07-28 | 第一版。发布 Mighty Shield API 对外接口文档,覆盖接入签名、统一响应、业务接口、订单状态说明和返回示例。 |
订单状态说明
orderStatus=FINISHED 且 settleStatus=1 才认为订单已完成结算,并对外返回 4;其他未结算完成状态仍可能继续变化。
| 状态码 | 含义 | 说明 |
|---|---|---|
0 | 结算中 | 买家已收货或下游已完成交易动作,但尚未完成结算;平台内部状态为 FINISHED 且 settleStatus!=1 时对外按此状态返回。 |
1 | 已取消 | 订单取消类状态。平台内部状态 CANCELED 和 WITHDRAWN 撤回状态均对外按此状态返回。 |
2 | 待卖家发货 | 已创建订单,等待卖家发货;平台内部状态 PENDING 对应此状态。 |
3 | 待买家收货 | 卖家已发货,等待买家接收报价;平台内部状态 DELIVERING/DELIVERED 对应此状态。 |
4 | 已完成 | 交易已完成且结算已完成,状态不再主动轮询;平台内部状态必须满足 orderStatus=FINISHED 且 settleStatus=1。 |
99 | 其他 | 无法识别或暂未映射的下游状态。 |
cancel_type 仅订单取消状态(status=1)有值,其余状态返回 null。例如 {"status":1,"cancel_type":12} 表示收货后保护期内卖家撤销,{"status":1,"cancel_type":13} 表示买家撤销。这是订单数据字段片段,查询、历史订单和回调均适用。原因描述不等同于责任判定;无法准确归类时返回 100,客户端应兼容未知枚举值:
| 取消原因码 | 含义 |
|---|---|
1 | 未发货系统取消订单 |
2 | 未发货买家取消订单 |
3 | 未发货卖家取消订单 |
4 | 报价在Steam被取消 |
5 | 报价在Steam被修改 |
6 | 买家超时未收货系统取消订单 |
7 | 卖家已发货买家未收货,卖家取消订单 |
8 | 报价失效 |
9 | Steam账号异常取消 |
10 | 未支付系统取消 |
11 | 卖家已发货买家未收货,买家取消订单 |
12 | 买家收货后,交易保护期内卖家撤销交易 |
13 | 买家收货后,交易保护期内买家撤销交易 |
14 | 买家取消订单,发货阶段未明确;不表示买家承担责任 |
15 | 卖家取消订单,发货阶段未明确;不表示卖家承担责任 |
100 | 未知原因或无法准确归类 |
1. 接入与签名
| 项 | 说明 |
|---|---|
| 请求方式 | POST |
| Content-Type | 推荐 multipart/form-data;兼容 application/x-www-form-urlencoded |
| 字符编码 | UTF-8 |
| 参数位置 | 表单参数,服务端通过 @RequestParam 接收 |
公共参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
partner_key | string | 是 | 平台分配给商户/渠道的接入标识 |
t | integer/string | 是 | Unix 秒级时间戳 |
sign | string | 是 | RSA-SHA256 签名结果,Base64 编码 |
签名时还需要使用平台分配的 public_key 标识。public_key 参与签名,但通常不放入最终请求表单;服务端会根据 partner_key 查询并补入对应标识后验签。
可使用签名验证页面检查必填参数、待签名字符串和 RSA-SHA256 签名结果。页面仅用于测试,生产私钥不要提交或分享。
签名串按参数原始值拼接,不要先对参数值做 URL 编码;真正发起 HTTP 请求时必须按表单规则编码提交。尤其 fetch_track_link 这类值内包含 & 的参数,使用 application/x-www-form-urlencoded 时请逐字段 urlencode,例如 curl 使用 --data-urlencode,避免 &token=... 被解析成独立参数。
签名规则
| 步骤 | 说明 |
|---|---|
| 1 | 将业务参数、partner_key、t、public_key 放入同一个 Map |
| 2 | 排除 sign、null 值、空字符串 |
| 3 | 按参数名 ASCII/字典序升序排序 |
| 4 | 按 key=value 拼接,并用 & 连接 |
| 5 | 使用 PKCS#8 PEM 私钥执行 SHA256withRSA 签名,结果 Base64 编码 |
channel_order_no=test1323513&fetch_steam_uid=76561199257812355&fetch_track_link=https://steamcommunity.com/tradeoffer/new/?partner=1297546627&token=IFqH7wuh&partner_key=K0ydt9XA4jRkd3SwF5DYPjHIAIZRB2&public_key=1erte6a5052e492a8a26ab8e67f51a8a&t=1770000000&trade_id=2100365399&unit_price=0.39
统一响应与错误码
| code | message | 说明 |
|---|---|---|
1 | success | 成功 |
201001 | 参数错误 | 请求业务参数缺失、格式错误或不符合约束 |
201002 | 商品不可用 | 商品不存在、已失效或不可购买 |
201003 | 价格已失效 | 报价过期或与当前有效价格不符,请重新查询 |
201004 | 订单号已存在 | 商户订单号重复,请查询原订单 |
201005 | 订单不存在或无权限 | 订单不存在,或不属于当前渠道 |
201006 | 订单编号无效 | 订单编号不匹配或无法唯一定位 |
201007 | 订单结果待确认 | 请使用原商户订单号查询,不要重复下单 |
201008 | 下游请求失败 | 下游服务调用失败或返回失败 |
201009 | 余额不足 | 渠道账户可用余额不足 |
201010 | 系统异常 | 未预期的服务端异常 |
201011 | 服务暂不可用 | 服务暂时不可用,请稍后重试 |
201099 | 业务处理失败 | 未归类的业务异常 |
101001 | 公共参数错误 | 缺少公共参数或时间戳非法 |
101002 | 验签失败 | 签名校验未通过 |
101003 | 无权限 | 渠道账户不可用或缺少公钥 |
101006 | 接口过期 | 请求时间戳超出允许窗口 |
通用响应字段与读取约定
| 字段 | 类型 | 含义与返回说明 |
|---|---|---|
code | integer | 1 表示成功;201xxx 为业务错误,101xxx 为鉴权错误,具体含义见错误码表。 |
message | string | 结果说明;成功通常为 success,失败时为错误信息。 |
data | object / array / null | 业务数据,结构以各接口说明为准;失败时可能为空。 |
金额字符串应使用十进制方式处理;"0" 与 "0.00" 都表示零。null 表示未提供该值,不等于零、正常或已完成。ID 应无损保存;尤其是大整数 ID 和 P_ 开头的 trade_id,不要使用可能丢失精度的浮点数解析。时间戳的秒/毫秒单位以字段说明为准。
币种与金额口径
trade_buy 下单时,unit_price 应传入查询接口返回的美元价格,若与平台实时计算价格差异超过 0.5%,接口会返回失败并提示价格已失效,请重新拉取价格。quick_order 的 max_price 是客户可接受的最高价格,平台按下单时记录的汇率和实际成交价完成扣款。
2. 饰品在售列表单品类查询
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
app_id | integer | 是 | 游戏 ID,CS2/CSGO 为 730 |
market_hash_name | string | 是 | Steam 唯一名称 |
page_no | integer | 否 | 本地视图页码,从 1 开始,默认 1;其他查询模式忽略此值 |
page_size | integer | 否 | 本地视图每页数量,默认 20;其他查询模式忽略此值并返回全部匹配商品 |
delivery_type | integer | 否 | 1 自动发货,2 人工发货,3 人工快速发货 |
exterior_wear_start | number | 否 | 最小磨损 |
exterior_wear_end | number | 否 | 最大磨损 |
min_price | number | 否 | 最低价格,按渠道账户结算币种传入 |
max_price | number | 否 | 最高价格,按渠道账户结算币种传入 |
search_key | string | 否 | 搜索关键字 |
响应字段
data.products[] 返回饰品明细:name、assetid、icon_url、unit_price、currency、trade_id、market_hash_name、delivery_type、exterior_wear、paint_index、paint_seed。unit_price 按渠道账户结算币种返回,currency 明确标识当前商品价格币种,取值为 CNY 或 USD;delivery_type 的取值为 1 自动发货、2 人工发货、3 人工快速发货。本地视图按请求分页,data.page.page_no 返回当前页码,data.page.is_more 为数字 1 时需继续翻页,为 0 时结束;其他查询模式一次返回全部匹配商品,固定 page_no=1、is_more=0。
商品明细字段(products[])
| 字段 | 类型 | 含义与返回说明 |
|---|---|---|
name | string / null | 商品展示名称;不要用作具体在售商品的唯一标识。 |
assetid | string / null | Steam 资产 ID;可能未提供,不能替代下单使用的 trade_id。 |
icon_url | string / null | 商品图片地址;未提供时为 null。 |
unit_price | string | 当前商品报价,十进制金额字符串;下单时使用该报价。 |
currency | string | 商品价格币种:CNY 人民币、USD 美元。 |
trade_id | integer / string | 具体在售商品的下单标识;可能为数字或 P_ 开头的字符串,原样保存、签名并传回。 |
market_hash_name | string | Steam 市场标准品类名称;同一名称下可以有多个不同 trade_id。 |
delivery_type | integer | 发货类型:1 自动发货,2 人工发货,3 人工快速发货。 |
exterior_wear | string / null | 饰品磨损数值的十进制字符串;不适用或未提供时可能为空。 |
paint_index | integer / null | 皮肤涂装编号,用于区分涂装款式;未提供时可能为空。 |
paint_seed | integer / null | 图案模板编号(随机种子);未提供时可能为空,不是商品 ID。 |
is_doppler | boolean(条件返回) | Doppler 系列商品返回 true;非该系列不返回本字段。 |
family | string(条件返回) | Doppler 系列标识:DOPPLER 或 GAMMA_DOPPLER;非该系列不返回。 |
style | string(条件返回) | 款式代码,例如 RUBY;未识别到款式时不返回,即使 is_doppler=true。 |
label | string(条件返回) | 款式展示名称,例如“红宝石”;未识别到名称时不返回。 |
page.page_no | integer | 仅单品类查询返回的当前页码,从 1 开始。 |
page.is_more | integer | 单品类查询使用数字 1/0:1 有下一页,0 已结束。 |
上述商品字段说明适用于单品类查询、批量查询、商品全量同步和 WSS 商品明细。批量查询没有分页对象;全量同步的分页字段见对应章节。
{
"paint_index": 415,
"is_doppler": true,
"family": "DOPPLER",
"style": "RUBY",
"label": "红宝石"
}返回示例
{
"code": 1,
"message": "success",
"data": {
"products": [
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52375307516",
"icon_url": null,
"unit_price": "2769.11",
"currency": "CNY",
"trade_id": 4367083724629687919,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 1,
"exterior_wear": "0.0484905764460563",
"paint_index": 42,
"paint_seed": 315
},
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52880046415",
"icon_url": null,
"unit_price": "2794.39",
"currency": "CNY",
"trade_id": 1505071163657550713,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 2,
"exterior_wear": "0.04713385552167892",
"paint_index": 42,
"paint_seed": 183
},
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52827100695",
"icon_url": null,
"unit_price": "2831.47",
"currency": "CNY",
"trade_id": 5379122505345477793,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 3,
"exterior_wear": "0.023534592241048813",
"paint_index": 42,
"paint_seed": 557
}
],
"page": {
"page_no": 1,
"is_more": 0
}
}
}
2.1 单件商品详情查询
成功查询会同步更新商品库存信息,并沿用商品变更 WebSocket 通知机制。响应和推送价格均按接收渠道的溢价及结算币种计算。
使用 application/x-www-form-urlencoded 提交。公共参数 partner_key、t、sign 必填,签名沿用公共规则,trade_id 必须参与签名。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
trade_id | integer / string | 是 | 商品查询接口返回的具体在售商品标识,每次只传一个。当前支持正整数形式的商品 ID,须无损保存并原样签名、传回。 |
需渠道已开放对应商品源。此接口始终实时查询,不受列表本地查询配置影响。业务参数只需 trade_id,无需 app_id、market_hash_name 或分页参数。商品失效、不存在或不支持时,返回 code=201002、data=null 和错误说明;查询失败不会返回本地旧报价。
响应说明
成功返回 code=1、message=success;data 直接是单个商品对象,字段和空值规则与 trade_list 的 products[] 商品明细字段表一致,包括 Doppler 条件字段。没有 products、rows 或 page 包装。unit_price 已按渠道账户溢价及结算币种计算,currency 为 CNY 或 USD;delivery_type 为 1 自动发货、2 人工发货、3 人工快速发货,不返回 null。报价为查询时价格,不锁库存、不保证下单时价格不变。
请求示例
curl -X POST 'https://www.maiyidun.com/third/distribution/api/trade_info' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'trade_id=4367083724629687919' \
--data-urlencode 'partner_key=YOUR_PARTNER_KEY' \
--data-urlencode 't=TIMESTAMP_IN_SECONDS' \
--data-urlencode 'sign=SIGNATURE'成功示例
{
"code": 1,
"message": "success",
"data": {
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52375307516",
"icon_url": null,
"unit_price": "2769.11",
"currency": "CNY",
"trade_id": 4367083724629687919,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 1,
"exterior_wear": "0.0484905764460563",
"paint_index": 42,
"paint_seed": 315
}
}商品不可用示例
{"code":201002,"message":"商品已失效或不存在,请重新拉取列表","data":null}商品全量同步
该接口只读取平台本地商品库,不调用下游平台接口。接口使用游标分页,适用于渠道首次同步商品。
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
next_cursor | string | 否 | 上一批返回的最大商品 id。首次请求为空,从头开始查询。 |
page_size | integer | 否 | 每批数量,默认 100,最大 500。 |
app_id | integer | 否 | 游戏 ID,CS2/CSGO 为 730。当前仅支持 CS2,未传时默认 730。 |
服务端按商品 id ASC 查询,下一次请求使用 id > next_cursor。is_more=true 时继续请求,is_more=false 时同步结束。商品 unit_price 按渠道账户结算币种返回,同时商品对象返回 currency 字段表示金额币种。Doppler 商品额外字段同 trade_list。该接口仍使用公共 RSA-SHA256 签名规则,并通过 form/urlencode 提交。
响应 data.products[] 商品字段同 trade_list。其中 delivery_type 为整数:1 自动发货、2 人工发货、3 人工快速发货。
返回示例
{
"code": 1,
"message": "success",
"data": {
"products": [
{
"name": "Galil AR | Sage Spray (Field-Tested)",
"assetid": "51835031209",
"icon_url": null,
"unit_price": "0.07",
"currency": "CNY",
"trade_id": 3802387914421840091,
"market_hash_name": "Galil AR | Sage Spray (Field-Tested)",
"delivery_type": 2,
"exterior_wear": "0.3780631124973297",
"paint_index": 119,
"paint_seed": 517
}
],
"is_more": true,
"next_cursor": "2085000000123"
}
}
全量同步分页字段
| 字段 | 类型 | 含义与返回说明 |
|---|---|---|
products | array | 本批商品列表,无匹配商品时为空数组。 |
is_more | boolean | true 表示还有下一批,false 表示已结束;与 trade_list 的数字 1/0 不同。 |
next_cursor | string / null | 下一批请求使用的游标,必须使用本次响应值原样传回,不要用 trade_id 替代;无可用游标时为空。 |
调用示例
curl -X POST 'https://www.maiyidun.com/third/distribution/api/market_item_list' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'app_id=730' \
--data-urlencode 'page_size=100' \
--data-urlencode 'next_cursor=' \
--data-urlencode 'partner_key=YOUR_PARTNER_KEY' \
--data-urlencode 't=1770000000' \
--data-urlencode 'sign=YOUR_SIGNATURE'
3. 饰品在售列表批量查询
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
app_id | integer | 是 | 游戏 ID,CS2/CSGO 为 730 |
market_hash_name | string | 是 | JSON 数组字符串,最多 100 个名称,例如 ["AWP | Asiimov (Field-Tested)"] |
一次返回所有请求名称的全部匹配商品,不分页,不受 page_no 或 page_size 限制。响应 data.products[] 字段同 trade_list,包含商品级别的 currency 字段,不返回 page 或 is_more。任一名称查询失败时返回错误,不返回部分商品。
商品的 delivery_type 为整数:1 自动发货、2 人工发货、3 人工快速发货。
返回示例
{
"code": 1,
"message": "success",
"data": {
"products": [
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52375307516",
"icon_url": null,
"unit_price": "2769.11",
"currency": "CNY",
"trade_id": 4367083724629687919,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 1,
"exterior_wear": "0.0484905764460563",
"paint_index": 42,
"paint_seed": 315
},
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52880046415",
"icon_url": null,
"unit_price": "2794.39",
"currency": "CNY",
"trade_id": 1505071163657550713,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 2,
"exterior_wear": "0.04713385552167892",
"paint_index": 42,
"paint_seed": 183
}
]
}
}
4. 指定饰品购买
如果请求超时或未拿到结果,建议 2 分钟后通过 get_order_by_channel_no 查询结果,避免重复下单。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
channel_order_no | string | 是 | 商户订单号,需保证幂等唯一 |
trade_id | integer/string | 是 | 饰品 ID,来自查询接口。可能为数字或 P_ 开头的字符串,必须原样保存、签名及传回,不得转为整数 |
unit_price | number | 是 | 下单价格,按渠道账户结算币种传入,两位小数。美元渠道应传入查询接口返回的美元价格。 |
fetch_track_link | string | 是 | 收货人 Steam 交易链接。该值通常包含 &token=...,提交请求时必须按表单规则编码。 |
fetch_steam_uid | string | 是 | 收货人 Steam UID |
下单响应字段(data)
| 字段 | 类型 | 含义与返回说明 |
|---|---|---|
channel_order_no | string | 渠道提交的商户订单号,用于关联本方订单及查询结果。 |
total_amount | string / null | 本次订单总金额,币种由 currency 指定。 |
currency | string | 本次订单金额币种:CNY 或 USD。 |
total_qty | integer / null | 本次订单购买总数量。 |
order_number | integer / null | 平台主订单号;与渠道提交的 channel_order_no、子订单 order_id 含义不同。 |
order_list | array | 本次创建的子订单列表。 |
order_list[].order_id | integer / null | 平台子订单 ID,用于子订单查询或取消;不是商品 trade_id。 |
order_list[].amount | string / null | 该子订单金额。 |
order_list[].currency | string | 该子订单金额币种:CNY 或 USD。 |
order_list[].qty | integer / null | 该子订单购买数量。 |
响应 data 包含 channel_order_no、total_amount、currency、total_qty、order_number 和 order_list[]。子订单字段为 order_id、amount、currency、qty。金额字段按渠道账户结算币种返回。
返回示例
{
"code": 1,
"message": "success",
"data": {
"channel_order_no": "test1322",
"total_amount": "0.03",
"currency": "CNY",
"total_qty": 1,
"order_number": 123,
"order_list": [
{
"order_id": 21146389,
"amount": "0.03",
"currency": "CNY",
"qty": 1
}
]
}
}
4.1 按条件快速下单
公共认证字段 partner_key、t、sign 必填。所有实际传入的业务参数(包括可选磨损字段)都应按公共签名规则参与签名。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
channel_order_no | string | 是 | 客户订单号,必须唯一;超时后使用原订单号查询,不能换号重试。 |
market_hash_name | string | 是 | 商品完整英文名称,须精确匹配。 |
max_price | number | 是 | 客户愿意支付的最高金额,按账户结算币种传入,已包含平台售价规则,必须大于0且最多两位小数。账户余额必须严格大于此金额,等于时也不允许下单。 |
fetch_track_link | string | 是 | 收货人 Steam 交易链接,按表单规则编码。 |
fetch_steam_uid | string | 是 | 收货人 Steam UID。 |
exterior_wear_start | number | 否 | 最小磨损,最多18位小数;与 exterior_wear_end 同时传入或同时省略。 |
exterior_wear_end | number | 否 | 最大磨损,满足 0 ≤ start ≤ end ≤ 1,最多18位小数。 |
不传 trade_id 或 unit_price;每次只购买一件。max_price 是价格上限,不是实际扣款金额;提交后会先冻结 max_price,成功后按实际成交商品的平台售价扣款并释放未使用的冻结额度,金额不超过 max_price。美元订单固定本次下单读取的汇率,响应和后续查询沿用订单金额快照。
无符合条件的商品、最高价不足、余额不足或渠道未开放该购买方式时返回失败。超时或结果待确认时,2分钟后使用原 channel_order_no 调用 get_order_by_channel_no 查询,勿重新购买。查询、取消、历史和回调沿用现有接口。
curl -X POST 'https://www.maiyidun.com/third/distribution/api/quick_order' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'channel_order_no=condition-demo-001' \
--data-urlencode 'market_hash_name=M4A1-S | Leaded Glass (Factory New)' \
--data-urlencode 'max_price=10.00' \
--data-urlencode 'exterior_wear_start=0' \
--data-urlencode 'exterior_wear_end=0.07' \
--data-urlencode 'fetch_track_link=https://steamcommunity.com/tradeoffer/new/?partner=123&token=EXAMPLE' \
--data-urlencode 'fetch_steam_uid=76561198000000000' \
--data-urlencode 'partner_key=YOUR_PARTNER_KEY' \
--data-urlencode 't=TIMESTAMP_IN_SECONDS' \
--data-urlencode 'sign=SIGNATURE'响应字段及类型与 trade_buy 相同,total_amount、order_list[].amount 均为实际金额,currency 为账户结算币种。成功 code=1;业务错误返回对应的 201xxx 错误码和 message,鉴权错误沿用 101xxx 公共错误码。例:最高价10.00,实际扣款9.27:
{
"code": 1,
"message": "success",
"data": {
"channel_order_no": "condition-demo-001",
"total_amount": "9.27",
"currency": "USD",
"total_qty": 1,
"order_number": 123,
"order_list": [{"order_id": 123, "amount": "9.27", "currency": "USD", "qty": 1}]
}
}5. 订单状态信息查询
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
channel_order_no | string | 否 | 商户订单号;与 order_id 二选一 |
order_id | integer/string | 否 | 平台子订单 ID;与 channel_order_no 二选一 |
响应 data.rows[] 包含 status、channel_order_no、fetch_steam_uid、withdrawn_flag、withdrawal_liability_status、order_id、provisional_time、qty、penalty_amount、amount、currency、create_time、cancel_type、trade_offer、original_amount、order_number、service_charge、order_type。金额字段按渠道账户结算币种返回;美元渠道返回订单下单时记录的美元实付金额快照。
withdrawn_flag:0 正常,1 已撤回;withdrawal_liability_status:0 暂无,1 买家,2 卖家,3 双方无责,4 暂未判责;平台未返回时为 null。
provisional_time:交易保护期相关时间。本查询接口当前固定返回 null,表示暂未提供该时间信息,不代表订单不存在交易保护期或保护期已结束。目前尚未约定非空值的具体含义、格式及单位,请勿用此字段判断保护期是否结束。
订单明细字段(data.rows[])
| 字段 | 类型 | 含义与返回说明 |
|---|---|---|
status | integer / null | 订单状态:0 结算中,1 已取消,2 待卖家发货,3 待买家收货,4 已完成结算,99 其他;空值表示未提供状态。 |
channel_order_no | string / null | 渠道下单时提交的商户订单号。 |
fetch_steam_uid | string / null | 收货人的 Steam UID,不是卖家 UID。 |
withdrawn_flag | string / integer / null | 撤回标记:0 正常,1 已撤回;空值表示未提供。 |
withdrawal_liability_status | string / integer / null | 撤回判责:0 暂无,1 买家,2 卖家,3 双方无责,4 暂未判责;空值表示未提供。 |
order_id | integer / null | 平台子订单 ID;可用于本接口查询及申请取消订单。 |
provisional_time | null(当前查询接口) | 交易保护期相关时间;当前查询接口固定为空,不能用于判断保护期是否存在或结束。 |
qty | integer / null | 该子订单饰品数量。 |
penalty_amount | string | 订单处罚金额,币种见 currency;零表示当前响应未列出处罚金额。 |
amount | string / null | 当前订单行返回的金额,币种见 currency。 |
currency | string | 该订单行金额币种:CNY 或 USD。 |
create_time | string / null | 订单创建时间,格式 yyyy-MM-dd HH:mm:ss;未提供时为空。 |
cancel_type | integer / null | 取消原因码,见“订单状态说明”的取消原因表;未取消时为空。 |
trade_offer | string / null | Steam 交易报价(Trade Offer)ID;未生成或未提供时为空,不是完整交易链接。 |
original_amount | string / null | 原价字段,作为服务费计算的基准金额;不是利润或退款金额。 |
order_number | integer / null | 平台主订单号,关联该订单行所属的主订单。 |
service_charge | string | 服务费字段;当前查询按 amount 与 original_amount 的差额返回,已取消订单返回零。 |
order_type | integer | 订单类型兼容字段,当前固定返回 1,其他值尚未定义。 |
该接口只能查询当前 partner_key 对应渠道自己的订单,查询其他渠道订单会返回 订单无权限。
订单状态定义:0 结算中,1 已取消,2 待卖家发货,3 待买家收货,4 已完成结算,99 其他。平台内部 WITHDRAWN 撤回状态对外按 1 已取消返回;平台仅在 orderStatus=FINISHED 且 settleStatus=1 时对外返回 4。
返回示例
{
"code": 1,
"message": "success",
"data": {
"rows": [
{
"status": 1,
"channel_order_no": "TEST-TRADE-8419155627264995664",
"fetch_steam_uid": "76561198099332339",
"withdrawn_flag": "0",
"withdrawal_liability_status": "0",
"order_id": 2077642587203555328,
"provisional_time": null,
"qty": 1,
"penalty_amount": "0",
"amount": "2.01",
"currency": "CNY",
"create_time": "2026-07-16 14:32:48",
"cancel_type": 1,
"trade_offer": null,
"original_amount": "2.01",
"order_number": 2077642587203555328,
"service_charge": "0",
"order_type": 1
}
]
}
}
取消申请受理不代表订单已取消;请通过订单查询或通知确认最终状态。订单号存在歧义时,需补传 channel_order_no;同时提供商户订单号和子订单号时,两者必须属于同一订单。
6. 申请取消订单
接口路径固定为 apply_cancle_order。取消是否最终成功以订单状态查询结果为准。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
order_id | integer/string | 是 | 平台子订单 ID |
channel_order_no | string | 否 | 商户订单号;子订单编号有歧义时必填 |
返回订单详情结构;仅受理申请时 rows 可能为空,请继续查询最终状态。
响应 data.rows[] 的字段含义与订单状态查询相同;code=1 不保证 status=1,请以实际返回的订单状态确认是否取消。
该接口只能取消当前 partner_key 对应渠道自己的订单,取消其他渠道订单会返回 订单无权限。
返回示例
{
"code": 1,
"message": "success",
"data": {
"rows": [
{
"status": 4,
"channel_order_no": "TEST-TRADE-5977148147654219206",
"fetch_steam_uid": "76561198099332339",
"withdrawn_flag": "0",
"withdrawal_liability_status": "0",
"order_id": 2079823602818842624,
"provisional_time": null,
"qty": 1,
"penalty_amount": "0",
"amount": "0.59",
"currency": "CNY",
"create_time": "2026-07-22 14:59:26",
"cancel_type": 1,
"trade_offer": null,
"original_amount": "0.59",
"order_number": 2079823602818842624,
"service_charge": "0.00",
"order_type": 1
}
]
}
}
7. 历史订单记录查询
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
start_time | string | 是 | 开始时间,格式 yyyy-MM-dd HH:mm:ss |
end_time | string | 是 | 结束时间,格式 yyyy-MM-dd HH:mm:ss |
time_type | integer | 是 | 1 按创建时间,2 按结算/结束时间 |
page_size | integer | 是 | 每页数量,最大 100;本地视图默认 20 |
page_no | integer | 是 | 页码,从 1 开始 |
status | integer | 否 | 订单状态,不传则查询全部状态 |
状态值同订单状态信息查询。平台内部撤回状态对外按 1 已取消返回,只有已完成且已结算的订单对外返回 4。
响应 data.rows[] 包含订单金额、原价、currency、Steam UID、撤回状态、撤回判责、创建/结束时间、秒级时间戳、子订单 ID、处罚金额、取消原因、主订单号、服务费和订单类型。金额字段按渠道账户结算币种返回;美元渠道返回订单下单时记录的美元实付金额快照。分页信息在 data.page。
历史订单字段差异与分页
| 字段 | 类型 | 含义与返回说明 |
|---|---|---|
rows | array | 历史子订单列表;status、channel_order_no、amount、original_amount、currency、fetch_steam_uid、withdrawn_flag、withdrawal_liability_status、order_id、penalty_amount、cancel_type、order_number、service_charge、order_type 的基本含义见订单明细字段表。 |
rows[].created | string / null | 创建时间,格式 yyyy-MM-dd HH:mm:ss;本接口字段名为 created,不是 create_time。 |
rows[].end_time | string / null | 优先返回完成或取消时间;未有结束时间时可能返回最近更新时间,不能仅据此判断已结束,应结合 status。 |
rows[].created_timestamp | string / null | created 对应的 Unix 秒级时间戳字符串;不是毫秒。 |
rows[].end_time_timestamp | string / null | end_time 对应的 Unix 秒级时间戳字符串,含义与 end_time 一致。 |
rows[].original_amount | string / null | 本历史接口当前与 amount 使用相同金额。 |
rows[].service_charge | string | 本历史接口当前返回零。 |
page.page_no | integer | 当前页码,从 1 开始。 |
page.is_more | boolean | true 有下一页,false 已结束;与 trade_list 的数字 1/0 不同。 |
历史订单行不返回 qty、trade_offer、provisional_time,不要直接套用订单查询接口的完整字段集合。
该接口只返回当前 partner_key 对应渠道自己的历史订单。
返回示例
{
"code": 1,
"message": "success",
"data": {
"rows": [
{
"status": 4,
"channel_order_no": "TEST-TRADE-1651620685707114623",
"amount": "1.82",
"original_amount": "1.82",
"currency": "CNY",
"fetch_steam_uid": "76561198099332339",
"withdrawn_flag": "0",
"withdrawal_liability_status": "0",
"created": "2026-07-18 23:21:17",
"end_time": "2026-07-19 11:11:24",
"created_timestamp": "1784388077",
"end_time_timestamp": "1784430684",
"order_id": 2078500345364721664,
"penalty_amount": "0",
"cancel_type": null,
"order_number": 2078500345364721664,
"service_charge": "0.00",
"order_type": 1
}
],
"page": {
"page_no": 1,
"is_more": false
}
}
}
8. 商户信息查询
商户字段(data[])
| 字段 | 类型 | 含义与返回说明 |
|---|---|---|
username | string | 账户展示名称。 |
lock_cash | string | 账户锁定金额,币种由 currency 指定。 |
balance | string | 账户余额,币种由 currency 指定;不是累计流水。 |
currency | string | 账户金额币种:CNY 或 USD。 |
该接口只需要公共参数。余额和锁定金额按渠道账户结算币种返回,账户对象中返回 currency 字段标识币种。
返回示例
{
"code": 1,
"message": "success",
"data": [
{
"username": "渠道A",
"lock_cash": "0.00",
"balance": "27.57",
"currency": "CNY"
}
]
}
9. 调用示例
curl -X POST 'https://www.maiyidun.com/third/distribution/api/trade_buy' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'partner_key=K0ydt9XA4jRkd3SwF5DYPjHIAIZRB2' \
--data-urlencode 't=1770000000' \
--data-urlencode 'channel_order_no=test1323513' \
--data-urlencode 'trade_id=2100365399' \
--data-urlencode 'unit_price=0.39' \
--data-urlencode 'fetch_track_link=https://steamcommunity.com/tradeoffer/new/?partner=1297546627&token=IFqH7wuh' \
--data-urlencode 'fetch_steam_uid=76561199257812355' \
--data-urlencode 'sign=Base64EncodedSignature'
10. WSS 接入说明
AUTH 消息完成鉴权;鉴权成功后平台返回 AUTH_ACK,随后才能正常接收推送消息。鉴权失败会返回 ERROR 并关闭连接;首条消息不是 AUTH 时也会关闭连接。1008,关闭原因是 duplicate channel account connection。鉴权字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
appId | string | 是 | 渠道账户 ID,即 channel_account.id |
partner_key | string | 是 | 渠道合作 Key,即 channel_account.partner_key |
WSS 鉴权消息字段
| 字段 | 类型 | 含义与返回说明 |
|---|---|---|
type | string | 消息类型:客户端鉴权为 AUTH,成功响应为 AUTH_ACK,错误响应为 ERROR;心跳使用 PING/PONG。 |
reqId | string | 客户端可选的请求关联标识;响应回传该值,未传时为空字符串。 |
data | object / string | AUTH 请求为包含 appId、partner_key 的对象;AUTH_ACK 为 success 字符串;ERROR 为错误说明字符串。 |
serverTime | integer | AUTH_ACK 中的服务器当前 Unix 毫秒时间戳;不是秒。 |
WSS 的 data.appId 是平台分配的渠道账户 ID;与商品查询中的游戏 app_id=730 不同。
鉴权请求示例
{
"type": "AUTH",
"reqId": "auth-001",
"data": {
"appId": "10001",
"partner_key": "K0ydt9XA4jRkd3SwF5DYPjHIAIZRB2"
}
}鉴权成功响应
{
"type": "AUTH_ACK",
"reqId": "auth-001",
"data": "success",
"serverTime": 1785801600000
}鉴权失败响应
{
"type": "ERROR",
"reqId": "auth-001",
"data": "auth failed"
}心跳
| 方向 | 示例 |
|---|---|
| 客户端发送 | {"type":"PING"} |
| 服务端响应 | {"type":"PONG"} |
服务端也兼容客户端发送纯文本 ping,统一返回 {"type":"PONG"}。建议客户端保持周期性心跳;平台不会补发连接断开期间错过的商品事件。
商品变更推送格式
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 market_item_change |
event_id | string | 事件唯一 ID |
event_time | integer | 事件时间戳,毫秒 |
action | string | 变更类型:new 新增、change 更新、remove 移除在售商品 |
data | object | 商品数据,字段结构与 trade_list / batch_query_trade 中单个商品返回字段一致 |
当前没有在线渠道连接时,商品事件不会缓存;WSS 断开期间的事件不会在重连后补推。推送商品的 unit_price 按对应渠道账户结算币种返回,商品对象同时带有 currency 字段标识当前金额币种。
商品的 delivery_type 表示发货类型:1 为自动发货,2 为人工发货,3 为人工快速发货。
WSS 商品推送中的 Doppler 额外字段同 trade_list;非 Doppler 商品不返回 is_doppler、family、style、label。
推送示例
{
"type": "market_item_change",
"event_id": "evt-20260804-001",
"event_time": 1785801600000,
"action": "change",
"data": {
"name": "Galil AR | Sage Spray (Field-Tested)",
"assetid": "51835031209",
"icon_url": null,
"unit_price": "0.07",
"currency": "CNY",
"trade_id": 3802387914421840091,
"market_hash_name": "Galil AR | Sage Spray (Field-Tested)",
"delivery_type": 2,
"exterior_wear": "0.3780631124973297",
"paint_index": 119,
"paint_seed": 517
}
}11. 订单状态回调通知
回调外层结构
| 字段 | 类型 | 说明 |
|---|---|---|
eventId | string | 回调事件唯一 ID |
timestamp | integer | Unix 秒级时间戳 |
signature | string | 回调签名,HmacSHA256 + Base64 |
payload | string | 业务载荷 JSON 字符串,验签时使用原始字符串 |
回调签名规则
| 步骤 | 说明 |
|---|---|
| 1 | 取外层字段 eventId、timestamp、payload |
| 2 | 按 eventId.timestamp.payload 拼接待签名字符串,中间使用英文点号 . |
| 3 | 使用渠道账户的 partner_key 作为 HMAC 密钥 |
| 4 | 执行 HmacSHA256,结果做 Base64 编码后与 signature 比较 |
sign_source = eventId + "." + timestamp + "." + payload
signature = Base64(HmacSHA256(sign_source, partner_key))payload 结构
| 字段 | 类型 | 说明 |
|---|---|---|
eventTime | integer | 订单状态变化时间,毫秒时间戳 |
fromStatus | integer | 变化前订单状态,状态定义同订单查询接口 |
toStatus | integer | 变化后订单状态,状态定义同订单查询接口 |
data | object | 订单数据,字段与订单状态查询接口返回的订单行保持一致;金额字段按渠道账户结算币种返回,且只返回实付金额口径 |
回调订单字段的补充约定
| 字段 | 类型 | 含义与返回说明 |
|---|---|---|
fromStatus | integer / null | 变化前状态,未记录时可为空;不能将空值当作状态 0。 |
data.provisional_time | string / null | 回调携带已记录的保护期原始值,未记录时为空;非空值的具体语义、格式及单位尚未统一约定,不用于判断保护期结束。与当前查询接口固定为空的行为不同。 |
data.original_amount | string | 回调中与 data.amount 同为实付金额口径。 |
data.service_charge | string | 回调当前固定返回零。 |
回调的 data 是单个订单对象,不包含 rows 包装;其余字段含义见订单明细表。订单字段可能为空时,空值表示未提供,不应自行替换为业务状态。
渠道响应要求
success。否则平台认为通知失败,并按重试策略重试;超过最大重试次数后停止通知。回调示例
{
"eventId": "9f8e7d6c5b4a3210",
"timestamp": 1786809600,
"signature": "Base64HmacSha256Signature",
"payload": "{\"eventTime\":1786809600123,\"fromStatus\":2,\"toStatus\":3,\"data\":{\"status\":3,\"channel_order_no\":\"TEST-TRADE-3887739355590701087\",\"fetch_steam_uid\":\"76561198099332339\",\"withdrawn_flag\":\"0\",\"withdrawal_liability_status\":\"0\",\"order_id\":2087205070163476480,\"provisional_time\":null,\"qty\":1,\"penalty_amount\":\"0\",\"amount\":\"0.07\",\"currency\":\"CNY\",\"create_time\":\"2026-08-14 12:00:00\",\"cancel_type\":null,\"trade_offer\":\"1234567890\",\"original_amount\":\"0.07\",\"order_number\":2087205070163476480,\"service_charge\":\"0\",\"order_type\":1}}"
}Mighty Shield API Documentation
This page is the external documentation for Mighty Shield API, including shared authentication, RSA signature rules, response format, business endpoints, and response examples. It is served by the API module at https://www.maiyidun.com/third/ig-compatible-api.html. The service domain is https://www.maiyidun.com; use the full endpoint paths shown in this document.
Version History
| Version | Date | Changes |
|---|---|---|
| v1.2.11 | 2026-10-21 | Added 201xxx codes for channel business errors, distinguishing parameter, product, price, order, balance, downstream and system failures. Authentication codes remain unchanged. See: Unified Responses And Error Codes |
| v1.2.10 | 2026-10-19 | Added trade_info for live lookup of one listed item by trade_id. data is a single product object with the same fields, currency and pricing rules as a trade_list product. Added signing, availability, error semantics and bilingual examples. See: Single Listed Item Details |
| v1.2.9 | 2026-10-16 | Added quick_order to buy one item by name, maximum price and optional wear range. Balance must strictly exceed the cap; the cap is held while the result is pending and only the actual selling price is charged on success. Added signing, currency, response and timeout guidance. Existing purchase APIs are unchanged. See: Quick Order by Conditions |
| v1.2.7 | 2026-10-08 | Added cancellation reasons 14 (buyer cancelled, delivery stage unspecified) and 15 (seller cancelled, delivery stage unspecified) to preserve the known cancellation initiator. Order queries, cancellation responses, history, and callbacks use these meanings consistently. Existing enum meanings are unchanged; clients should support the new values. See: Cancellation Reasons, Order Query, Cancel Order, Order History, Order Callback |
| v1.2.6 | 2026-10-08 | Expanded Chinese and English response field definitions for products, purchases, order queries, order history, merchant balances, WSS, and callbacks, including meanings, types, enums, null values, and conditional fields. Clarified ID distinctions, pagination types, timestamp units, and the current behavior and semantic limitations of provisional_time. Corrected cancel_type to null in the completed-order example. Documentation and example updates only; no API behavior changes. See: Product Query, Purchase, Order Query, Order History, Merchant Balance, WSS, Order Callback |
| v1.2.5 | 2026-09-22 | Added cancellation reasons 12 (seller reversal after receipt) and 13 (buyer reversal after receipt) during trade protection. Queries, history and callbacks use the same meanings. Existing codes are unchanged. Handle unknown codes gracefully; the initiator does not establish liability. See: Cancellation Reasons, Order Query, Order History, Order Callback |
| v1.2.4 | 2026-08-18 | Added is_doppler, family, style, and label fields for Doppler / Gamma Doppler products in product queries, full product sync, and WSS product pushes. See: Product Fields, Full Product Sync, WSS Product Push |
| v1.2.3 | 2026-08-14 | Added order status callback documentation, including callback envelope, HMAC signature rules, success response criteria, and behavior when no callback URL is configured. See: Order Status Callback |
| v1.2.2 | 2026-08-13 | Added withdrawn_flag and withdrawal_liability_status to order status query, cancel-order response, and order history responses for downstream withdrawal status and liability result. See: Order Query, Cancel Order, Order History |
| v1.2.1 | 2026-08-12 | Added per-object currency field to all amount-bearing product, order, merchant balance, and WSS product payloads. Currency values are CNY or USD. See: Currency And Amount Semantics |
| v1.2.0 | 2026-08-11 | Added USD settlement semantics. Product prices, order prices, order amounts, merchant balances, and WSS product prices are returned by channel settlement currency. USD order prices are validated against the latest exchange rate. See: Currency And Amount Semantics |
| v1.1.0 | 2026-08-07 | Renamed order query field cancle_type to cancel_type. Updated cancellation reason enum to 12 values (1-11, 100), returned only when status=1. See: Cancellation Reasons, Order Query Fields |
| v1.0.1 | 2026-08-04 | Added external WSS access documentation, shipping mode fields, delivery_type descriptions, and the local full product sync endpoint. See: WSS Access, Product Fields, Full Product Sync |
| v1.0.0 | 2026-07-28 | Initial release. Published the Mighty Shield API external documentation, covering access signature, common response format, business endpoints, order status semantics, and response examples. |
Order Status Semantics
orderStatus=FINISHED and settleStatus=1; only then is 4 returned externally. Other unsettled states may still change.
| Status | Meaning | Description |
|---|---|---|
0 | Settling | The buyer has received the item or the downstream trade action is complete, but settlement is not complete. Internal platform status FINISHED with settleStatus!=1 is returned externally as this status. |
1 | Cancelled | Cancellation-class state. Internal platform status CANCELED and WITHDRAWN are both returned externally as this status. |
2 | Waiting For Seller Delivery | The order has been created and is waiting for seller delivery. Internal platform status PENDING maps to this status. |
3 | Waiting For Buyer Receipt | The seller has delivered and the buyer is expected to accept the trade offer. Internal platform status DELIVERING/DELIVERED maps to this status. |
4 | Completed | The trade and settlement are complete, and active polling stops. This requires internal platform status orderStatus=FINISHED and settleStatus=1. |
99 | Other | Unknown or unmapped downstream status. |
cancel_type is present only when the order is cancelled (status=1); other statuses return null. Field examples: {"status":1,"cancel_type":12} means seller reversal after receipt during trade protection; {"status":1,"cancel_type":13} means buyer reversal. These order-data fragments apply to queries, history and callbacks. Reasons do not establish liability. Unclassifiable reasons return 100; clients must tolerate unknown enum values:
| Cancel Reason | Meaning |
|---|---|
1 | System cancelled the order before delivery |
2 | Buyer cancelled the order before delivery |
3 | Seller cancelled the order before delivery |
4 | Offer cancelled on Steam |
5 | Offer modified on Steam |
6 | Buyer timed out receiving, system cancelled the order |
7 | Seller delivered but buyer did not receive, seller cancelled the order |
8 | Offer expired |
9 | Steam account abnormal, cancelled |
10 | Unpaid, system cancelled |
11 | Seller delivered but buyer did not receive, buyer cancelled the order |
12 | Seller reversed the trade during the protection period after buyer receipt |
13 | Buyer reversed the trade during the protection period after buyer receipt |
14 | Buyer cancelled the order; delivery stage unspecified. This does not establish buyer liability |
15 | Seller cancelled the order; delivery stage unspecified. This does not establish seller liability |
100 | Unknown or cannot be classified accurately |
1. Access And Signature
| Item | Description |
|---|---|
| Method | POST |
| Content-Type | Recommended multipart/form-data; application/x-www-form-urlencoded is also supported |
| Encoding | UTF-8 |
| Parameters | Form parameters, received by the server through @RequestParam |
Common Parameters
| Name | Type | Required | Description |
|---|---|---|---|
partner_key | string | Yes | Merchant/channel access key assigned by the platform |
t | integer/string | Yes | Unix timestamp in seconds |
sign | string | Yes | RSA-SHA256 signature, Base64 encoded |
The assigned public_key identifier must be included when calculating the signature. public_key participates in signing but is normally not sent in the final form body. The server resolves it by partner_key before verification.
Use the signature check page to validate required parameters, the canonical sign string, and RSA-SHA256 signatures. It is for testing only; never submit or share a production private key.
Build the signature string from the original parameter values; do not URL-encode values before signing. When sending the actual HTTP request, submit parameters with proper form encoding. This is required for values such as fetch_track_link that contain &; with application/x-www-form-urlencoded, encode each field separately, for example by using curl --data-urlencode, so &token=... is not parsed as a separate parameter.
Signature Rules
| Step | Description |
|---|---|
| 1 | Put business parameters, partner_key, t, and public_key into one map |
| 2 | Exclude sign, null values, and empty strings |
| 3 | Sort by parameter name in ascending ASCII/dictionary order |
| 4 | Join entries as key=value, separated by & |
| 5 | Sign with a PKCS#8 PEM private key using SHA256withRSA, then Base64 encode the result |
channel_order_no=test1323513&fetch_steam_uid=76561199257812355&fetch_track_link=https://steamcommunity.com/tradeoffer/new/?partner=1297546627&token=IFqH7wuh&partner_key=K0ydt9XA4jRkd3SwF5DYPjHIAIZRB2&public_key=1erte6a5052e492a8a26ab8e67f51a8a&t=1770000000&trade_id=2100365399&unit_price=0.39
Unified Responses And Error Codes
| code | message | Description |
|---|---|---|
1 | success | Success |
201001 | Invalid parameter | Missing, malformed or constraint-violating business parameters |
201002 | Product unavailable | Product does not exist, is expired or cannot be purchased |
201003 | Price expired | Quote expired or differs from the current valid price; query again |
201004 | Order number already exists | Duplicate merchant order number; query the original order |
201005 | Order not found or forbidden | Order does not exist or does not belong to this channel |
201006 | Invalid order reference | Order references do not match or do not identify a unique order |
201007 | Order result pending | Query using the original merchant order number; do not submit again |
201008 | Downstream request failed | Downstream service call failed or returned a failure |
201009 | Insufficient balance | Insufficient available channel balance |
201010 | System error | Unexpected server-side error |
201011 | Service unavailable | Service is temporarily unavailable; retry later |
201099 | Business operation failed | Unclassified business exception |
101001 | Common parameter error | Missing common parameters or invalid timestamp |
101002 | Signature verification failed | The signature is invalid |
101003 | No permission | The channel account is unavailable or has no public key |
101006 | API expired | The request timestamp is outside the allowed window |
Common Response Fields And Reading Conventions
| Field | Type | Meaning And Availability |
|---|---|---|
code | integer | 1 means success; 201xxx indicates a business error and 101xxx an authentication error. See the error table above. |
message | string | Result description; normally success on success, or an error message on failure. |
data | object / array / null | Business data. Its structure depends on the endpoint and may be null on failure. |
Use decimal arithmetic for monetary strings; "0" and "0.00" both mean zero. null means a value is not provided, not zero, normal, or completed. Preserve IDs without loss, especially large integer IDs and trade_id values starting with P_; avoid floating-point parsing that loses precision. Timestamp units are specified per field.
Currency And Amount Semantics
unit_price in trade_buy must be the USD price returned by the product query APIs. If it differs from the platform's current calculated price by more than 0.5%, the request fails and the client should pull the latest price again. The max_price of quick_order is the customer's price cap; the platform charges using the rate captured at order creation and the actual purchase price.
2. Single Market Listing Query
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
app_id | integer | Yes | Game ID. CS2/CSGO is 730 |
market_hash_name | string | Yes | Steam market hash name |
page_no | integer | No | Page number for the local view, starting from 1 and defaulting to 1. Ignored in other query modes |
page_size | integer | No | Page size for the local view, defaulting to 20. Ignored in other query modes, which return all matching products |
delivery_type | integer | No | 1 auto delivery, 2 manual delivery, 3 fast manual delivery |
exterior_wear_start | number | No | Minimum wear |
exterior_wear_end | number | No | Maximum wear |
min_price | number | No | Minimum price in the channel account settlement currency |
max_price | number | No | Maximum price in the channel account settlement currency |
search_key | string | No | Search keyword |
Response Fields
data.products[] returns name, assetid, icon_url, unit_price, currency, trade_id, market_hash_name, delivery_type, exterior_wear, paint_index, and paint_seed. unit_price is returned in the channel account settlement currency, and currency is CNY or USD. delivery_type values are 1 auto delivery, 2 manual delivery, and 3 fast manual delivery. The local view uses request pagination: data.page.page_no is the current page and data.page.is_more is the number 1 when another page is available, or 0 otherwise. Other query modes return all matching products together with page_no=1 and is_more=0.
Product Fields (products[])
| Field | Type | Meaning And Availability |
|---|---|---|
name | string / null | Product display name; not a unique identifier for a listing. |
assetid | string / null | Steam asset ID; may be unavailable and does not replace trade_id when buying. |
icon_url | string / null | Product image URL; null when unavailable. |
unit_price | string | Current quoted unit price as a decimal string; use this quote when buying. |
currency | string | Price currency: CNY (Chinese yuan) or USD (US dollar). |
trade_id | integer / string | Identifier of the listing used for purchase; may be numeric or a string starting with P_. Preserve, sign, and submit it unchanged. |
market_hash_name | string | Steam market hash name identifying the item category; multiple listings can share the same name. |
delivery_type | integer | Delivery type: 1 automatic, 2 manual, 3 fast manual. |
exterior_wear | string / null | Item wear value as a decimal string; may be null when unavailable or not applicable. |
paint_index | integer / null | Paint index identifying the skin finish; may be null when unavailable. |
paint_seed | integer / null | Pattern seed; may be null when unavailable. This is not a listing ID. |
is_doppler | boolean (conditional) | Returned as true for Doppler-family products; omitted for other products. |
family | string (conditional) | Doppler family: DOPPLER or GAMMA_DOPPLER; omitted for other products. |
style | string (conditional) | Style code, for example RUBY; omitted when no style is identified, even if is_doppler=true. |
label | string (conditional) | Style display label, for example 红宝石 (Ruby); omitted when unavailable. |
page.page_no | integer | Current page number for the single-category listing endpoint, starting at 1. |
page.is_more | integer | The single-category listing endpoint uses numeric 1/0: 1 means another page exists; 0 means finished. |
These product field definitions apply to single and batch listing queries, full product sync, and WSS product data. Batch queries have no pagination object; full sync pagination is defined in its own section.
{
"paint_index": 415,
"is_doppler": true,
"family": "DOPPLER",
"style": "RUBY",
"label": "红宝石"
}Response Example
{
"code": 1,
"message": "success",
"data": {
"products": [
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52375307516",
"icon_url": null,
"unit_price": "2769.11",
"currency": "CNY",
"trade_id": 4367083724629687919,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 1,
"exterior_wear": "0.0484905764460563",
"paint_index": 42,
"paint_seed": 315
},
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52880046415",
"icon_url": null,
"unit_price": "2794.39",
"currency": "CNY",
"trade_id": 1505071163657550713,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 2,
"exterior_wear": "0.04713385552167892",
"paint_index": 42,
"paint_seed": 183
},
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52827100695",
"icon_url": null,
"unit_price": "2831.47",
"currency": "CNY",
"trade_id": 5379122505345477793,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 3,
"exterior_wear": "0.023534592241048813",
"paint_index": 42,
"paint_seed": 557
}
],
"page": {
"page_no": 1,
"is_more": 0
}
}
}
2.1 Single Listed Item Details
A successful query refreshes the inventory record and uses the existing WebSocket product change notification mechanism. Response and notification prices include the receiving channel's premium and use its settlement currency.
Submit as application/x-www-form-urlencoded. Common parameters partner_key, t and sign are required. Use the common signing rules and include trade_id in the signature.
| Parameter | Type | Required | Description |
|---|---|---|---|
trade_id | integer / string | Yes | One listed item ID returned by a product query. Currently supports positive integer IDs only. Preserve, sign and submit the ID without precision loss. |
The account must have access to the relevant product source. This endpoint always performs a live lookup, regardless of the local listing query setting. trade_id is the only business parameter required; app_id, market_hash_name and pagination parameters are unnecessary. An unavailable, missing or unsupported item returns code=201002, data=null and an error message. Query failures never return a stale local quote.
Response
Success returns code=1 and message=success. data is a single product object, using the same fields and null rules as the trade_list products[] field table, including conditional Doppler fields. There is no products, rows or page wrapper. unit_price includes account pricing and is denominated in the account settlement currency; currency is CNY or USD. delivery_type is 1 automatic, 2 manual, or 3 fast manual delivery, never null. A quote does not reserve inventory or guarantee the price at purchase time.
Request Example
curl -X POST 'https://www.maiyidun.com/third/distribution/api/trade_info' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'trade_id=4367083724629687919' \
--data-urlencode 'partner_key=YOUR_PARTNER_KEY' \
--data-urlencode 't=TIMESTAMP_IN_SECONDS' \
--data-urlencode 'sign=SIGNATURE'Success Example
{
"code": 1,
"message": "success",
"data": {
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52375307516",
"icon_url": null,
"unit_price": "2769.11",
"currency": "CNY",
"trade_id": 4367083724629687919,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 1,
"exterior_wear": "0.0484905764460563",
"paint_index": 42,
"paint_seed": 315
}
}Unavailable Item Example
{"code":201002,"message":"商品已失效或不存在,请重新拉取列表","data":null}Full Product Sync
This endpoint reads only the platform's local product database. It does not call a downstream platform API.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
next_cursor | string | No | The maximum product id returned by the previous batch. Empty on the first request. |
page_size | integer | No | Items per batch. Defaults to 100 and is limited to 500. |
app_id | integer | No | Game ID. CS2/CSGO is 730. Currently only CS2 is supported, defaults to 730 when omitted. |
Products are queried in ascending id order. The next request uses id > next_cursor. Continue while is_more=true. Product unit_price is returned in the channel account settlement currency, and the product-level currency field is returned as CNY or USD. Doppler extra fields are the same as trade_list. This endpoint uses the common RSA-SHA256 signature rules and form/urlencode submission.
Product fields in data.products[] match trade_list. delivery_type is an integer: 1 auto delivery, 2 manual delivery, or 3 fast manual delivery.
Response Example
{
"code": 1,
"message": "success",
"data": {
"products": [
{
"name": "Galil AR | Sage Spray (Field-Tested)",
"assetid": "51835031209",
"icon_url": null,
"unit_price": "0.07",
"currency": "CNY",
"trade_id": 3802387914421840091,
"market_hash_name": "Galil AR | Sage Spray (Field-Tested)",
"delivery_type": 2,
"exterior_wear": "0.3780631124973297",
"paint_index": 119,
"paint_seed": 517
}
],
"is_more": true,
"next_cursor": "2085000000123"
}
}
Full Sync Pagination Fields
| Field | Type | Meaning And Availability |
|---|---|---|
products | array | Products in the current batch; an empty array when no products match. |
is_more | boolean | true means another batch exists; false means finished. Unlike trade_list, this is not numeric 1/0. |
next_cursor | string / null | Cursor for the next request. Submit the returned value unchanged; do not substitute trade_id. Null when no cursor is available. |
Example Request
curl -X POST 'https://www.maiyidun.com/third/distribution/api/market_item_list' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'app_id=730' \
--data-urlencode 'page_size=100' \
--data-urlencode 'next_cursor=' \
--data-urlencode 'partner_key=YOUR_PARTNER_KEY' \
--data-urlencode 't=1770000000' \
--data-urlencode 'sign=YOUR_SIGNATURE'
3. Batch Market Listing Query
| Name | Type | Required | Description |
|---|---|---|---|
app_id | integer | Yes | Game ID. CS2/CSGO is 730 |
market_hash_name | string | Yes | JSON array string, up to 100 names, for example ["AWP | Asiimov (Field-Tested)"] |
The response field data.products[] uses the same structure as trade_list, including the product-level currency field.
Product delivery_type is an integer: 1 auto delivery, 2 manual delivery, or 3 fast manual delivery.
Response Example
{
"code": 1,
"message": "success",
"data": {
"products": [
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52375307516",
"icon_url": null,
"unit_price": "2769.11",
"currency": "CNY",
"trade_id": 4367083724629687919,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 1,
"exterior_wear": "0.0484905764460563",
"paint_index": 42,
"paint_seed": 315
},
{
"name": "★ Bayonet | Blue Steel (Factory New)",
"assetid": "52880046415",
"icon_url": null,
"unit_price": "2794.39",
"currency": "CNY",
"trade_id": 1505071163657550713,
"market_hash_name": "★ Bayonet | Blue Steel (Factory New)",
"delivery_type": 2,
"exterior_wear": "0.04713385552167892",
"paint_index": 42,
"paint_seed": 183
}
]
}
}
4. Buy Specific Item
If the request times out or returns no result, query get_order_by_channel_no after about 2 minutes to avoid duplicate orders.
| Name | Type | Required | Description |
|---|---|---|---|
channel_order_no | string | Yes | Merchant order number. Must be unique for idempotency |
trade_id | integer/string | Yes | Item ID returned by listing APIs. May be a number or a P_-prefixed string; preserve it unchanged for storage, signing and purchase requests. Do not convert it to an integer |
unit_price | number | Yes | Purchase price in the channel account settlement currency, two decimals. USD channels should pass the USD price returned by the product query APIs. |
fetch_track_link | string | Yes | Recipient Steam trade URL. This value usually contains &token=... and must be form-encoded when sending the request. |
fetch_steam_uid | string | Yes | Recipient Steam UID |
Purchase Response Fields (data)
| Field | Type | Meaning And Availability |
|---|---|---|
channel_order_no | string | Merchant order number supplied by the channel, used to correlate requests and results. |
total_amount | string / null | Total order amount in the currency specified by currency. |
currency | string | Order amount currency: CNY or USD. |
total_qty | integer / null | Total quantity purchased in this order. |
order_number | integer / null | Platform parent order number; distinct from the channel-supplied channel_order_no and the child order_id. |
order_list | array | List of child orders created by this purchase. |
order_list[].order_id | integer / null | Platform child order ID for querying or cancelling a child order; not the product trade_id. |
order_list[].amount | string / null | Amount of this child order. |
order_list[].currency | string | Child order currency: CNY or USD. |
order_list[].qty | integer / null | Quantity purchased in this child order. |
data contains channel_order_no, total_amount, currency, total_qty, order_number, and order_list[]. Each sub-order has order_id, amount, currency, and qty. Amount fields are returned in the channel account settlement currency.
Response Example
{
"code": 1,
"message": "success",
"data": {
"channel_order_no": "test1322",
"total_amount": "0.03",
"currency": "CNY",
"total_qty": 1,
"order_number": 123,
"order_list": [
{
"order_id": 21146389,
"amount": "0.03",
"currency": "CNY",
"qty": 1
}
]
}
}
4.1 Quick Order by Conditions
The common authentication fields partner_key, t and sign are required. Sign all supplied business parameters, including optional wear parameters, using the common signature rules.
| Parameter | Type | Required | Description |
|---|---|---|---|
channel_order_no | string | Yes | Unique client order number. Query with the same number after a timeout; do not retry with a new number. |
market_hash_name | string | Yes | Full English market hash name; exact match. |
max_price | number | Yes | Maximum inclusive customer price in the account settlement currency. Positive, up to two decimal places. Account balance must be strictly greater than this amount; equality is rejected. |
fetch_track_link | string | Yes | Recipient Steam trade URL, form-encoded. |
fetch_steam_uid | string | Yes | Recipient Steam UID. |
exterior_wear_start | number | No | Minimum wear, up to 18 decimal places. Send both wear parameters or omit both. |
exterior_wear_end | number | No | Maximum wear; 0 ≤ start ≤ end ≤ 1, up to 18 decimal places. |
Do not send trade_id or unit_price. Each request purchases one item. max_price is a cap, not the charged amount. The cap is held after submission; a successful purchase charges the actual platform selling price and releases any unused held amount, never exceeding max_price. USD orders use the exchange rate captured at submission; responses and subsequent queries use stored amounts.
No matching item, insufficient maximum price or balance, or an unavailable purchase mode returns a failure. For a timeout or unconfirmed result, query get_order_by_channel_no with the original channel_order_no after two minutes; do not purchase again. Existing query, cancellation, history and callback APIs apply.
curl -X POST 'https://www.maiyidun.com/third/distribution/api/quick_order' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'channel_order_no=condition-demo-001' \
--data-urlencode 'market_hash_name=M4A1-S | Leaded Glass (Factory New)' \
--data-urlencode 'max_price=10.00' \
--data-urlencode 'exterior_wear_start=0' \
--data-urlencode 'exterior_wear_end=0.07' \
--data-urlencode 'fetch_track_link=https://steamcommunity.com/tradeoffer/new/?partner=123&token=EXAMPLE' \
--data-urlencode 'fetch_steam_uid=76561198000000000' \
--data-urlencode 'partner_key=YOUR_PARTNER_KEY' \
--data-urlencode 't=TIMESTAMP_IN_SECONDS' \
--data-urlencode 'sign=SIGNATURE'Response fields and types match trade_buy. total_amount and order_list[].amount are actual charged amounts; currency is the account settlement currency. Success uses code=1; business errors return the corresponding 201xxx code and message, while authentication errors use the common 101xxx codes. Example: cap 10.00, actual charge 9.27:
{
"code": 1,
"message": "success",
"data": {
"channel_order_no": "condition-demo-001",
"total_amount": "9.27",
"currency": "USD",
"total_qty": 1,
"order_number": 123,
"order_list": [{"order_id": 123, "amount": "9.27", "currency": "USD", "qty": 1}]
}
}5. Query Order Status
| Name | Type | Required | Description |
|---|---|---|---|
channel_order_no | string | No | Merchant order number. Required if order_id is absent |
order_id | integer/string | No | Platform sub-order ID. Required if channel_order_no is absent |
data.rows[] contains status, channel_order_no, fetch_steam_uid, withdrawn_flag, withdrawal_liability_status, order_id, provisional_time, qty, penalty_amount, amount, currency, create_time, cancel_type, trade_offer, original_amount, order_number, service_charge, and order_type. Amount fields are returned in the channel account settlement currency. For USD channels, the order's USD paid amount snapshot is returned.
withdrawn_flag: 0 normal, 1 withdrawn. withdrawal_liability_status: 0 none, 1 buyer, 2 seller, 3 no liability, 4 pending liability. Returned as null when not provided by the platform.
provisional_time: Time information related to the trade protection period. This query endpoint currently always returns null, meaning that this time information is not provided. It does not mean that the order has no protection period or that the period has ended. The specific meaning, format, and unit of a non-null value have not yet been defined. Do not use this field to determine whether the protection period has ended.
Order Detail Fields (data.rows[])
| Field | Type | Meaning And Availability |
|---|---|---|
status | integer / null | Order status: 0 settling, 1 cancelled, 2 awaiting seller delivery, 3 awaiting buyer receipt, 4 settled, 99 other; null means unavailable. |
channel_order_no | string / null | Merchant order number supplied by the channel when buying. |
fetch_steam_uid | string / null | Recipient's Steam UID, not the seller's UID. |
withdrawn_flag | string / integer / null | Withdrawal flag: 0 normal, 1 withdrawn; null when unavailable. |
withdrawal_liability_status | string / integer / null | Withdrawal liability: 0 none, 1 buyer, 2 seller, 3 neither party, 4 pending; null when unavailable. |
order_id | integer / null | Platform child order ID; usable for querying and requesting cancellation. |
provisional_time | null (current query) | Trade protection time information; currently always null in this query endpoint. It cannot establish whether protection exists or has ended. |
qty | integer / null | Item quantity in the child order. |
penalty_amount | string | Order penalty amount in currency; zero means no penalty amount is reported in this response. |
amount | string / null | Amount returned for this order row, denominated in currency. |
currency | string | Currency for this order row: CNY or USD. |
create_time | string / null | Order creation time in yyyy-MM-dd HH:mm:ss format; null when unavailable. |
cancel_type | integer / null | Cancellation reason code; see the cancellation reason table. Null for orders that are not cancelled. |
trade_offer | string / null | Steam Trade Offer ID; null when not created or unavailable. This is not a full trade URL. |
original_amount | string / null | Original amount used as the service charge basis; not a profit or refund amount. |
order_number | integer / null | Platform parent order number associated with this child order. |
service_charge | string | Service charge; the query returns amount minus original_amount, or zero for cancelled orders. |
order_type | integer | Order type compatibility field; currently always 1. Other values are not defined. |
This endpoint can query only orders that belong to the current partner_key. Requests for other channels' orders return 订单无权限.
Order status definition: 0 settling, 1 cancelled, 2 waiting for seller delivery, 3 waiting for buyer receipt, 4 completed and settled, and 99 other. Internal platform status WITHDRAWN is returned externally as 1 cancelled. The platform returns 4 only when orderStatus=FINISHED and settleStatus=1.
Response Example
{
"code": 1,
"message": "success",
"data": {
"rows": [
{
"status": 1,
"channel_order_no": "TEST-TRADE-8419155627264995664",
"fetch_steam_uid": "76561198099332339",
"withdrawn_flag": "0",
"withdrawal_liability_status": "0",
"order_id": 2077642587203555328,
"provisional_time": null,
"qty": 1,
"penalty_amount": "0",
"amount": "2.01",
"currency": "CNY",
"create_time": "2026-07-16 14:32:48",
"cancel_type": 1,
"trade_offer": null,
"original_amount": "2.01",
"order_number": 2077642587203555328,
"service_charge": "0",
"order_type": 1
}
]
}
}
Acceptance of a cancellation request does not mean the order is cancelled. Confirm final status through order queries or notifications. Supply channel_order_no if order_id is ambiguous; both identifiers must refer to the same order when supplied together.
6. Apply To Cancel Order
The endpoint path is fixed as apply_cancle_order. The final result must be confirmed by querying order status.
| Name | Type | Required | Description |
|---|---|---|---|
order_id | integer/string | Yes | Platform sub-order ID |
channel_order_no | string | No | Merchant order number; required to disambiguate colliding sub-order IDs |
Returns the order detail structure. rows may be empty when only the application was accepted; query the final status separately.
Fields in data.rows[] have the same meanings as the order status query. code=1 does not guarantee status=1; use the returned order status to confirm cancellation.
This endpoint can cancel only orders that belong to the current partner_key. Requests for other channels' orders return 订单无权限.
Response Example
{
"code": 1,
"message": "success",
"data": {
"rows": [
{
"status": 4,
"channel_order_no": "TEST-TRADE-5977148147654219206",
"fetch_steam_uid": "76561198099332339",
"withdrawn_flag": "0",
"withdrawal_liability_status": "0",
"order_id": 2079823602818842624,
"provisional_time": null,
"qty": 1,
"penalty_amount": "0",
"amount": "0.59",
"currency": "CNY",
"create_time": "2026-07-22 14:59:26",
"cancel_type": 1,
"trade_offer": null,
"original_amount": "0.59",
"order_number": 2079823602818842624,
"service_charge": "0.00",
"order_type": 1
}
]
}
}
7. Query Historical Orders
| Name | Type | Required | Description |
|---|---|---|---|
start_time | string | Yes | Start time, format yyyy-MM-dd HH:mm:ss |
end_time | string | Yes | End time, format yyyy-MM-dd HH:mm:ss |
time_type | integer | Yes | 1 by creation time, 2 by settlement/end time |
page_size | integer | Yes | Page size. Maximum 100; local view defaults to 20 |
page_no | integer | Yes | Page number, starting from 1 |
status | integer | No | Order status. If omitted, all statuses are returned |
Status values are the same as the order status query. Internal platform withdrawn orders are returned externally as 1 cancelled, and only completed-and-settled orders are returned as 4.
data.rows[] contains amount, original amount, currency, Steam UID, withdrawal status, withdrawal liability status, created/end time, Unix timestamps, sub-order ID, penalty amount, cancellation reason, main order number, service charge, and order type. Amount fields are returned in the channel account settlement currency. For USD channels, the order's USD paid amount snapshot is returned. Pagination is returned in data.page.
Historical Order Field Differences And Pagination
| Field | Type | Meaning And Availability |
|---|---|---|
rows | array | Historical child orders. Basic definitions for status, channel_order_no, amount, original_amount, currency, fetch_steam_uid, withdrawn_flag, withdrawal_liability_status, order_id, penalty_amount, cancel_type, order_number, service_charge, and order_type are in the order detail table. |
rows[].created | string / null | Creation time in yyyy-MM-dd HH:mm:ss format; this endpoint uses created rather than create_time. |
rows[].end_time | string / null | Completion or cancellation time when available; otherwise it may contain the latest update time. Use status to determine whether the order has ended. |
rows[].created_timestamp | string / null | Unix timestamp in seconds corresponding to created, returned as a string, not milliseconds. |
rows[].end_time_timestamp | string / null | Unix timestamp in seconds corresponding to end_time, returned as a string with the same semantics. |
rows[].original_amount | string / null | This history endpoint currently returns the same amount as amount. |
rows[].service_charge | string | This history endpoint currently returns zero. |
page.page_no | integer | Current page number, starting at 1. |
page.is_more | boolean | true means another page exists; false means finished. Unlike trade_list, this is not numeric 1/0. |
History rows do not return qty, trade_offer, or provisional_time. Do not assume they contain every field from the order query response.
This endpoint returns only historical orders that belong to the current partner_key.
Response Example
{
"code": 1,
"message": "success",
"data": {
"rows": [
{
"status": 4,
"channel_order_no": "TEST-TRADE-1651620685707114623",
"amount": "1.82",
"original_amount": "1.82",
"currency": "CNY",
"fetch_steam_uid": "76561198099332339",
"withdrawn_flag": "0",
"withdrawal_liability_status": "0",
"created": "2026-07-18 23:21:17",
"end_time": "2026-07-19 11:11:24",
"created_timestamp": "1784388077",
"end_time_timestamp": "1784430684",
"order_id": 2078500345364721664,
"penalty_amount": "0",
"cancel_type": null,
"order_number": 2078500345364721664,
"service_charge": "0.00",
"order_type": 1
}
],
"page": {
"page_no": 1,
"is_more": false
}
}
}
8. Merchant Info Query
Merchant Fields (data[])
| Field | Type | Meaning And Availability |
|---|---|---|
username | string | Account display name. |
lock_cash | string | Locked account funds in the currency specified by currency. |
balance | string | Account balance in currency; not cumulative turnover. |
currency | string | Account currency: CNY or USD. |
This endpoint only requires the common authentication parameters. Balance and locked balance are returned in the channel account settlement currency, and the account object includes a currency field.
Response Example
{
"code": 1,
"message": "success",
"data": [
{
"username": "Channel A",
"lock_cash": "0.00",
"balance": "27.57",
"currency": "CNY"
}
]
}
9. Example Request
curl -X POST 'https://www.maiyidun.com/third/distribution/api/trade_buy' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'partner_key=K0ydt9XA4jRkd3SwF5DYPjHIAIZRB2' \
--data-urlencode 't=1770000000' \
--data-urlencode 'channel_order_no=test1323513' \
--data-urlencode 'trade_id=2100365399' \
--data-urlencode 'unit_price=0.39' \
--data-urlencode 'fetch_track_link=https://steamcommunity.com/tradeoffer/new/?partner=1297546627&token=IFqH7wuh' \
--data-urlencode 'fetch_steam_uid=76561199257812355' \
--data-urlencode 'sign=Base64EncodedSignature'
10. WSS Access
AUTH message first. The platform returns AUTH_ACK after successful authentication, and only then starts normal push delivery. Failed authentication returns ERROR and closes the socket; a first message other than AUTH also closes the socket.1008 and reason duplicate channel account connection.Auth Fields
| Field | Type | Required | Description |
|---|---|---|---|
appId | string | Yes | Channel account ID, that is channel_account.id |
partner_key | string | Yes | Channel partner key, that is channel_account.partner_key |
WSS Authentication Message Fields
| Field | Type | Meaning And Availability |
|---|---|---|
type | string | Message type: AUTH for authentication requests, AUTH_ACK for success, ERROR for errors, and PING/PONG for heartbeats. |
reqId | string | Optional client correlation ID; echoed in the response, or an empty string when omitted. |
data | object / string | For AUTH, an object containing appId and partner_key; for AUTH_ACK, the string success; for ERROR, an error description string. |
serverTime | integer | Current server Unix timestamp in milliseconds in AUTH_ACK, not seconds. |
WSS data.appId is the assigned channel account ID, not the game app_id=730 used in product queries.
Auth Request Example
{
"type": "AUTH",
"reqId": "auth-001",
"data": {
"appId": "10001",
"partner_key": "K0ydt9XA4jRkd3SwF5DYPjHIAIZRB2"
}
}Auth Success Response
{
"type": "AUTH_ACK",
"reqId": "auth-001",
"data": "success",
"serverTime": 1785801600000
}Auth Failure Response
{
"type": "ERROR",
"reqId": "auth-001",
"data": "auth failed"
}Heartbeat
| Direction | Example |
|---|---|
| Client to server | {"type":"PING"} |
| Server to client | {"type":"PONG"} |
The server also accepts plain-text ping and returns {"type":"PONG"}. Clients should send heartbeats periodically. Events missed while disconnected are not replayed after reconnect.
Market Item Change Envelope
| Field | Type | Description |
|---|---|---|
type | string | Always market_item_change |
event_id | string | Unique event ID |
event_time | integer | Event timestamp in milliseconds |
action | string | Change type: new adds a listing, change updates it, and remove removes it from sale |
data | object | Product payload. The field structure matches a single product entry returned by trade_list / batch_query_trade |
Product events are pushed in real time. When no channel is online, events are not cached. Events missed during a WSS disconnect are not replayed after reconnect. Product unit_price is returned in the receiving channel account settlement currency, and the product object includes a currency field.
For products, delivery_type indicates the delivery type: 1 means auto delivery, 2 manual delivery, and 3 fast manual delivery.
Doppler extra fields in WSS product pushes are the same as trade_list. Non-Doppler products do not return is_doppler, family, style, or label.
Push Example
{
"type": "market_item_change",
"event_id": "evt-20260804-001",
"event_time": 1785801600000,
"action": "change",
"data": {
"name": "Galil AR | Sage Spray (Field-Tested)",
"assetid": "51835031209",
"icon_url": null,
"unit_price": "0.07",
"currency": "CNY",
"trade_id": 3802387914421840091,
"market_hash_name": "Galil AR | Sage Spray (Field-Tested)",
"delivery_type": 2,
"exterior_wear": "0.3780631124973297",
"paint_index": 119,
"paint_seed": 517
}
}11. Order Status Callback
Callback Envelope
| Field | Type | Description |
|---|---|---|
eventId | string | Unique callback event ID |
timestamp | integer | Unix timestamp in seconds |
signature | string | Callback signature, HmacSHA256 + Base64 |
payload | string | Business payload as a JSON string. Use the original string for signature verification |
Callback Signature Rules
| Step | Description |
|---|---|
| 1 | Read envelope fields eventId, timestamp, and payload |
| 2 | Build the sign source as eventId.timestamp.payload, separated by the dot character . |
| 3 | Use the channel account partner_key as the HMAC secret |
| 4 | Run HmacSHA256, Base64 encode the result, and compare it with signature |
sign_source = eventId + "." + timestamp + "." + payload
signature = Base64(HmacSHA256(sign_source, partner_key))Payload Structure
| Field | Type | Description |
|---|---|---|
eventTime | integer | Status change time in milliseconds |
fromStatus | integer | Previous order status. Semantics match the order query API |
toStatus | integer | New order status. Semantics match the order query API |
data | object | Order data. Fields match one order row returned by the order status query API. Amount fields use the channel account settlement currency and paid amount semantics |
Callback Order Field Notes
| Field | Type | Meaning And Availability |
|---|---|---|
fromStatus | integer / null | Previous status; may be null when unavailable. Null must not be interpreted as status 0. |
data.provisional_time | string / null | Callback carries the recorded protection-time value, or null if unavailable. Non-null semantics, format, and unit are not yet standardized; do not use it to determine protection expiry. Unlike the current query endpoint, this field is not forced to null. |
data.original_amount | string | In callbacks, uses the same paid-amount basis as data.amount. |
data.service_charge | string | Currently always zero in callbacks. |
Callback data is one order object without a rows wrapper. Other field meanings are in the order detail table. A null value means unavailable and should not be replaced with a business status.
Channel Response Requirement
success. Otherwise the platform treats the callback as failed and retries it. After all retries are exhausted, the platform stops retrying.Callback Example
{
"eventId": "9f8e7d6c5b4a3210",
"timestamp": 1786809600,
"signature": "Base64HmacSha256Signature",
"payload": "{\"eventTime\":1786809600123,\"fromStatus\":2,\"toStatus\":3,\"data\":{\"status\":3,\"channel_order_no\":\"TEST-TRADE-3887739355590701087\",\"fetch_steam_uid\":\"76561198099332339\",\"withdrawn_flag\":\"0\",\"withdrawal_liability_status\":\"0\",\"order_id\":2087205070163476480,\"provisional_time\":null,\"qty\":1,\"penalty_amount\":\"0\",\"amount\":\"0.07\",\"currency\":\"CNY\",\"create_time\":\"2026-08-14 12:00:00\",\"cancel_type\":null,\"trade_offer\":\"1234567890\",\"original_amount\":\"0.07\",\"order_number\":2087205070163476480,\"service_charge\":\"0\",\"order_type\":1}}"
}