Mighty Shield API 接口文档

本文档为 Mighty Shield API 对外接口文档,包含公共签名规则、统一响应格式、业务接口和返回示例。页面部署在 API 模块静态资源下,可通过 https://www.maiyidun.com/third/ig-compatible-api.html 访问;服务域名为 https://www.maiyidun.com,各接口路径以文档中 URL 为准。

版本记录

后续如接口路径、请求参数、签名规则、响应字段、状态口径或返回示例有调整,必须同步更新本文档,并递增版本号、记录修改内容。
版本日期修改内容
v1.2.112026-10-21为渠道业务错误新增 201xxx 错误码,区分参数、商品、价格、订单、余额、下游及系统异常;鉴权错误码保持不变。查看:统一响应与错误码
v1.2.102026-10-19新增 trade_info,按 trade_id 实时查询单件在售商品,data 直接返回商品对象,字段、币种及报价口径与 trade_list 的商品明细一致;补充请求签名、适用范围、异常行为及中英文示例。查看:单件商品详情查询
v1.2.92026-10-16新增 quick_order,按商品名称、最高价及可选磨损范围购买一件商品;余额须严格大于最高价,待确认期间冻结最高价,成交后按实际成交售价扣款。补充签名、币种、响应和超时查询说明;原有下单接口不变。查看:按条件快速下单
v1.2.72026-10-08取消原因新增 14(买家取消订单,发货阶段未明确)、15(卖家取消订单,发货阶段未明确),保留已知取消方信息。订单查询、取消响应、历史订单及回调统一使用;原有枚举含义不变,请兼容新增枚举值。查看:取消原因、订单查询、取消订单、历史订单、订单回调
v1.2.62026-10-08完善中英文响应字段说明,补充商品、下单、订单查询、历史订单、商户资金、WSS 及回调字段的含义、类型、枚举、空值与条件返回规则;明确 ID 区别、分页类型、时间戳单位及 provisional_time 当前返回行为与语义限制;修正已完成订单示例中的 cancel_type 为 null。本次为文档补充与示例修正,不涉及接口行为变更。查看:商品查询、下单、订单查询、历史订单、商户资金、WSS、订单回调
v1.2.52026-09-22取消原因新增 12(收货后保护期内卖家撤销)、13(买家撤销)。查询、历史订单及回调使用统一含义;原有枚举不变。请兼容未知枚举值,取消操作方不等于责任方。查看:取消原因、订单查询、历史订单、订单回调
v1.2.42026-08-18商品查询、商品全量同步和 WSS 商品推送中,Doppler / Gamma Doppler 商品新增 is_doppler、family、style、label 字段。查看:商品查询字段、商品全量同步、WSS 商品推送
v1.2.32026-08-14新增订单状态回调通知说明,补充回调报文结构、回调签名规则、响应成功判定和未配置回调地址时的处理口径。查看:订单状态回调通知
v1.2.22026-08-13订单状态查询、取消订单返回和历史订单查询新增 withdrawn_flag、withdrawal_liability_status 字段,用于返回下游订单撤回状态和撤回判责。查看:订单查询、取消订单、历史订单
v1.2.12026-08-12所有包含金额的商品、订单、商户资金和 WSS 商品对象新增 currency 字段,明确标识当前对象金额币种,取值为 CNY 或 USD。查看:币种与金额口径
v1.2.02026-08-11新增美元结算口径说明:商品价格、下单价格、订单金额、商户资金和 WSS 商品推送金额均按渠道账户结算币种返回;美元渠道下单价格按最新汇率校验。查看:币种与金额口径
v1.1.02026-08-07订单查询字段 cancle_type 更名为 cancel_type;取消原因枚举更新为 12 项(1-11、100),仅 status=1 时有值。查看:取消原因、订单查询字段
v1.0.12026-08-04新增对外 WSS 接入说明、商品发货模式字段、delivery_type 类型说明和本地商品全量同步接口。查看:WSS 接入、商品字段、商品全量同步
v1.0.02026-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报价失效
9Steam账号异常取消
10未支付系统取消
11卖家已发货买家未收货,买家取消订单
12买家收货后,交易保护期内卖家撤销交易
13买家收货后,交易保护期内买家撤销交易
14买家取消订单,发货阶段未明确;不表示买家承担责任
15卖家取消订单,发货阶段未明确;不表示卖家承担责任
100未知原因或无法准确归类

1. 接入与签名

项说明
请求方式POST
Content-Type推荐 multipart/form-data;兼容 application/x-www-form-urlencoded
字符编码UTF-8
参数位置表单参数,服务端通过 @RequestParam 接收

公共参数

参数名类型必填说明
partner_keystring是平台分配给商户/渠道的接入标识
tinteger/string是Unix 秒级时间戳
signstring是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

统一响应与错误码

codemessage说明
1success成功
201001参数错误请求业务参数缺失、格式错误或不符合约束
201002商品不可用商品不存在、已失效或不可购买
201003价格已失效报价过期或与当前有效价格不符,请重新查询
201004订单号已存在商户订单号重复,请查询原订单
201005订单不存在或无权限订单不存在,或不属于当前渠道
201006订单编号无效订单编号不匹配或无法唯一定位
201007订单结果待确认请使用原商户订单号查询,不要重复下单
201008下游请求失败下游服务调用失败或返回失败
201009余额不足渠道账户可用余额不足
201010系统异常未预期的服务端异常
201011服务暂不可用服务暂时不可用,请稍后重试
201099业务处理失败未归类的业务异常
101001公共参数错误缺少公共参数或时间戳非法
101002验签失败签名校验未通过
101003无权限渠道账户不可用或缺少公钥
101006接口过期请求时间戳超出允许窗口

通用响应字段与读取约定

字段类型含义与返回说明
codeinteger1 表示成功;201xxx 为业务错误,101xxx 为鉴权错误,具体含义见错误码表。
messagestring结果说明;成功通常为 success,失败时为错误信息。
dataobject / array / null业务数据,结构以各接口说明为准;失败时可能为空。

金额字符串应使用十进制方式处理;"0" 与 "0.00" 都表示零。null 表示未提供该值,不等于零、正常或已完成。ID 应无损保存;尤其是大整数 ID 和 P_ 开头的 trade_id,不要使用可能丢失精度的浮点数解析。时间戳的秒/毫秒单位以字段说明为准。

币种与金额口径

每个渠道账户有固定结算币种,创建后不可修改。人民币渠道所有金额字段返回人民币;美元渠道商品查询、商品全量同步、WSS 商品推送、下单响应、订单查询、取消订单、历史订单和商户资金接口中的金额字段均返回美元金额。美元金额按平台最新美元汇率和渠道价格规则计算,保留 2 位小数;美元渠道通过 trade_buy 下单时,unit_price 应传入查询接口返回的美元价格,若与平台实时计算价格差异超过 0.5%,接口会返回失败并提示价格已失效,请重新拉取价格。quick_order 的 max_price 是客户可接受的最高价格,平台按下单时记录的汇率和实际成交价完成扣款。

2. 饰品在售列表单品类查询

URL/third/distribution/api/trade_list
MethodPOST
用途按单个 market_hash_name 查询在售饰品

请求参数

参数名类型必填说明
app_idinteger是游戏 ID,CS2/CSGO 为 730
market_hash_namestring是Steam 唯一名称
page_nointeger否本地视图页码,从 1 开始,默认 1;其他查询模式忽略此值
page_sizeinteger否本地视图每页数量,默认 20;其他查询模式忽略此值并返回全部匹配商品
delivery_typeinteger否1 自动发货,2 人工发货,3 人工快速发货
exterior_wear_startnumber否最小磨损
exterior_wear_endnumber否最大磨损
min_pricenumber否最低价格,按渠道账户结算币种传入
max_pricenumber否最高价格,按渠道账户结算币种传入
search_keystring否搜索关键字

响应字段

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[])

字段类型含义与返回说明
namestring / null商品展示名称;不要用作具体在售商品的唯一标识。
assetidstring / nullSteam 资产 ID;可能未提供,不能替代下单使用的 trade_id。
icon_urlstring / null商品图片地址;未提供时为 null。
unit_pricestring当前商品报价,十进制金额字符串;下单时使用该报价。
currencystring商品价格币种:CNY 人民币、USD 美元。
trade_idinteger / string具体在售商品的下单标识;可能为数字或 P_ 开头的字符串,原样保存、签名并传回。
market_hash_namestringSteam 市场标准品类名称;同一名称下可以有多个不同 trade_id。
delivery_typeinteger发货类型:1 自动发货,2 人工发货,3 人工快速发货。
exterior_wearstring / null饰品磨损数值的十进制字符串;不适用或未提供时可能为空。
paint_indexinteger / null皮肤涂装编号,用于区分涂装款式;未提供时可能为空。
paint_seedinteger / null图案模板编号(随机种子);未提供时可能为空,不是商品 ID。
is_dopplerboolean(条件返回)Doppler 系列商品返回 true;非该系列不返回本字段。
familystring(条件返回)Doppler 系列标识:DOPPLER 或 GAMMA_DOPPLER;非该系列不返回。
stylestring(条件返回)款式代码,例如 RUBY;未识别到款式时不返回,即使 is_doppler=true。
labelstring(条件返回)款式展示名称,例如“红宝石”;未识别到名称时不返回。
page.page_nointeger仅单品类查询返回的当前页码,从 1 开始。
page.is_moreinteger单品类查询使用数字 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 通知机制。响应和推送价格均按接收渠道的溢价及结算币种计算。

URL/third/distribution/api/trade_info
MethodPOST
用途按 trade_id 实时查询单件在售商品

使用 application/x-www-form-urlencoded 提交。公共参数 partner_key、t、sign 必填,签名沿用公共规则,trade_id 必须参与签名。

参数名类型必填说明
trade_idinteger / 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}

商品全量同步

URL/third/distribution/api/market_item_list
MethodPOST
用途按游标分页读取本地商品库中的全部在售商品

该接口只读取平台本地商品库,不调用下游平台接口。接口使用游标分页,适用于渠道首次同步商品。

请求参数

参数名类型必填说明
next_cursorstring否上一批返回的最大商品 id。首次请求为空,从头开始查询。
page_sizeinteger否每批数量,默认 100,最大 500。
app_idinteger否游戏 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"
  }
}

全量同步分页字段

字段类型含义与返回说明
productsarray本批商品列表,无匹配商品时为空数组。
is_morebooleantrue 表示还有下一批,false 表示已结束;与 trade_list 的数字 1/0 不同。
next_cursorstring / 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. 饰品在售列表批量查询

URL/third/distribution/api/batch_query_trade
MethodPOST
用途批量查询多个品类在售饰品
参数名类型必填说明
app_idinteger是游戏 ID,CS2/CSGO 为 730
market_hash_namestring是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. 指定饰品购买

URL/third/distribution/api/trade_buy
MethodPOST
用途按唯一饰品 ID 创建采购订单

如果请求超时或未拿到结果,建议 2 分钟后通过 get_order_by_channel_no 查询结果,避免重复下单。

参数名类型必填说明
channel_order_nostring是商户订单号,需保证幂等唯一
trade_idinteger/string是饰品 ID,来自查询接口。可能为数字或 P_ 开头的字符串,必须原样保存、签名及传回,不得转为整数
unit_pricenumber是下单价格,按渠道账户结算币种传入,两位小数。美元渠道应传入查询接口返回的美元价格。
fetch_track_linkstring是收货人 Steam 交易链接。该值通常包含 &token=...,提交请求时必须按表单规则编码。
fetch_steam_uidstring是收货人 Steam UID

下单响应字段(data)

字段类型含义与返回说明
channel_order_nostring渠道提交的商户订单号,用于关联本方订单及查询结果。
total_amountstring / null本次订单总金额,币种由 currency 指定。
currencystring本次订单金额币种:CNY 或 USD。
total_qtyinteger / null本次订单购买总数量。
order_numberinteger / null平台主订单号;与渠道提交的 channel_order_no、子订单 order_id 含义不同。
order_listarray本次创建的子订单列表。
order_list[].order_idinteger / null平台子订单 ID,用于子订单查询或取消;不是商品 trade_id。
order_list[].amountstring / null该子订单金额。
order_list[].currencystring该子订单金额币种:CNY 或 USD。
order_list[].qtyinteger / 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 按条件快速下单

URL/third/distribution/api/quick_order
MethodPOST
说明按商品名称、最高价及可选磨损范围购买一件商品

公共认证字段 partner_key、t、sign 必填。所有实际传入的业务参数(包括可选磨损字段)都应按公共签名规则参与签名。

参数名类型必填说明
channel_order_nostring是客户订单号,必须唯一;超时后使用原订单号查询,不能换号重试。
market_hash_namestring是商品完整英文名称,须精确匹配。
max_pricenumber是客户愿意支付的最高金额,按账户结算币种传入,已包含平台售价规则,必须大于0且最多两位小数。账户余额必须严格大于此金额,等于时也不允许下单。
fetch_track_linkstring是收货人 Steam 交易链接,按表单规则编码。
fetch_steam_uidstring是收货人 Steam UID。
exterior_wear_startnumber否最小磨损,最多18位小数;与 exterior_wear_end 同时传入或同时省略。
exterior_wear_endnumber否最大磨损,满足 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. 订单状态信息查询

URL/third/distribution/api/get_order_by_channel_no
MethodPOST
用途查询订单最新状态
参数名类型必填说明
channel_order_nostring否商户订单号;与 order_id 二选一
order_idinteger/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[])

字段类型含义与返回说明
statusinteger / null订单状态:0 结算中,1 已取消,2 待卖家发货,3 待买家收货,4 已完成结算,99 其他;空值表示未提供状态。
channel_order_nostring / null渠道下单时提交的商户订单号。
fetch_steam_uidstring / null收货人的 Steam UID,不是卖家 UID。
withdrawn_flagstring / integer / null撤回标记:0 正常,1 已撤回;空值表示未提供。
withdrawal_liability_statusstring / integer / null撤回判责:0 暂无,1 买家,2 卖家,3 双方无责,4 暂未判责;空值表示未提供。
order_idinteger / null平台子订单 ID;可用于本接口查询及申请取消订单。
provisional_timenull(当前查询接口)交易保护期相关时间;当前查询接口固定为空,不能用于判断保护期是否存在或结束。
qtyinteger / null该子订单饰品数量。
penalty_amountstring订单处罚金额,币种见 currency;零表示当前响应未列出处罚金额。
amountstring / null当前订单行返回的金额,币种见 currency。
currencystring该订单行金额币种:CNY 或 USD。
create_timestring / null订单创建时间,格式 yyyy-MM-dd HH:mm:ss;未提供时为空。
cancel_typeinteger / null取消原因码,见“订单状态说明”的取消原因表;未取消时为空。
trade_offerstring / nullSteam 交易报价(Trade Offer)ID;未生成或未提供时为空,不是完整交易链接。
original_amountstring / null原价字段,作为服务费计算的基准金额;不是利润或退款金额。
order_numberinteger / null平台主订单号,关联该订单行所属的主订单。
service_chargestring服务费字段;当前查询按 amount 与 original_amount 的差额返回,已取消订单返回零。
order_typeinteger订单类型兼容字段,当前固定返回 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. 申请取消订单

URL/third/distribution/api/apply_cancle_order
MethodPOST
用途对进行中的订单发起取消申请

接口路径固定为 apply_cancle_order。取消是否最终成功以订单状态查询结果为准。

参数名类型必填说明
order_idinteger/string是平台子订单 ID
channel_order_nostring否商户订单号;子订单编号有歧义时必填

返回订单详情结构;仅受理申请时 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. 历史订单记录查询

URL/third/distribution/api/order_history
MethodPOST
用途查询历史订单
参数名类型必填说明
start_timestring是开始时间,格式 yyyy-MM-dd HH:mm:ss
end_timestring是结束时间,格式 yyyy-MM-dd HH:mm:ss
time_typeinteger是1 按创建时间,2 按结算/结束时间
page_sizeinteger是每页数量,最大 100;本地视图默认 20
page_nointeger是页码,从 1 开始
statusinteger否订单状态,不传则查询全部状态

状态值同订单状态信息查询。平台内部撤回状态对外按 1 已取消返回,只有已完成且已结算的订单对外返回 4。

响应 data.rows[] 包含订单金额、原价、currency、Steam UID、撤回状态、撤回判责、创建/结束时间、秒级时间戳、子订单 ID、处罚金额、取消原因、主订单号、服务费和订单类型。金额字段按渠道账户结算币种返回;美元渠道返回订单下单时记录的美元实付金额快照。分页信息在 data.page。

历史订单字段差异与分页

字段类型含义与返回说明
rowsarray历史子订单列表;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[].createdstring / null创建时间,格式 yyyy-MM-dd HH:mm:ss;本接口字段名为 created,不是 create_time。
rows[].end_timestring / null优先返回完成或取消时间;未有结束时间时可能返回最近更新时间,不能仅据此判断已结束,应结合 status。
rows[].created_timestampstring / nullcreated 对应的 Unix 秒级时间戳字符串;不是毫秒。
rows[].end_time_timestampstring / nullend_time 对应的 Unix 秒级时间戳字符串,含义与 end_time 一致。
rows[].original_amountstring / null本历史接口当前与 amount 使用相同金额。
rows[].service_chargestring本历史接口当前返回零。
page.page_nointeger当前页码,从 1 开始。
page.is_morebooleantrue 有下一页,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. 商户信息查询

URL/third/distribution/api/info
MethodPOST
用途查询商户基础资金信息

商户字段(data[])

字段类型含义与返回说明
usernamestring账户展示名称。
lock_cashstring账户锁定金额,币种由 currency 指定。
balancestring账户余额,币种由 currency 指定;不是累计流水。
currencystring账户金额币种: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 接入说明

URLwss://www.maiyidun.com/third/distribution/ws/market
MethodWebSocket
用途实时接收商品变更推送
WSS 不再使用 URL 参数签名握手。连接建立成功后,渠道必须先发送 AUTH 消息完成鉴权;鉴权成功后平台返回 AUTH_ACK,随后才能正常接收推送消息。鉴权失败会返回 ERROR 并关闭连接;首条消息不是 AUTH 时也会关闭连接。
同一个渠道账户同时只保留一个 WSS 连接。相同账户建立新连接后,平台会踢掉旧连接,旧连接关闭码为 1008,关闭原因是 duplicate channel account connection。

鉴权字段

字段类型必填说明
appIdstring是渠道账户 ID,即 channel_account.id
partner_keystring是渠道合作 Key,即 channel_account.partner_key

WSS 鉴权消息字段

字段类型含义与返回说明
typestring消息类型:客户端鉴权为 AUTH,成功响应为 AUTH_ACK,错误响应为 ERROR;心跳使用 PING/PONG。
reqIdstring客户端可选的请求关联标识;响应回传该值,未传时为空字符串。
dataobject / stringAUTH 请求为包含 appId、partner_key 的对象;AUTH_ACK 为 success 字符串;ERROR 为错误说明字符串。
serverTimeintegerAUTH_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"}。建议客户端保持周期性心跳;平台不会补发连接断开期间错过的商品事件。

商品变更推送格式

字段类型说明
typestring固定为 market_item_change
event_idstring事件唯一 ID
event_timeinteger事件时间戳,毫秒
actionstring变更类型:new 新增、change 更新、remove 移除在售商品
dataobject商品数据,字段结构与 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. 订单状态回调通知

方向平台通知渠道
MethodPOST
Content-Typeapplication/json;charset=UTF-8
渠道账户配置回调地址后,当订单状态发生变化时,平台会向该地址发送订单状态回调。若渠道账户未配置回调地址,平台不会发送回调,也不会对该事件进行重试。

回调外层结构

字段类型说明
eventIdstring回调事件唯一 ID
timestampintegerUnix 秒级时间戳
signaturestring回调签名,HmacSHA256 + Base64
payloadstring业务载荷 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 结构

字段类型说明
eventTimeinteger订单状态变化时间,毫秒时间戳
fromStatusinteger变化前订单状态,状态定义同订单查询接口
toStatusinteger变化后订单状态,状态定义同订单查询接口
dataobject订单数据,字段与订单状态查询接口返回的订单行保持一致;金额字段按渠道账户结算币种返回,且只返回实付金额口径

回调订单字段的补充约定

字段类型含义与返回说明
fromStatusinteger / null变化前状态,未记录时可为空;不能将空值当作状态 0。
data.provisional_timestring / null回调携带已记录的保护期原始值,未记录时为空;非空值的具体语义、格式及单位尚未统一约定,不用于判断保护期结束。与当前查询接口固定为空的行为不同。
data.original_amountstring回调中与 data.amount 同为实付金额口径。
data.service_chargestring回调当前固定返回零。

回调的 data 是单个订单对象,不包含 rows 包装;其余字段含义见订单明细表。订单字段可能为空时,空值表示未提供,不应自行替换为业务状态。

渠道响应要求

渠道接收并处理成功后,HTTP 状态码应返回 2xx,响应 body 必须为 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

Any future change to endpoint paths, request parameters, signature rules, response fields, status semantics, or response examples must be reflected in this document with a new version number and a clear change note.
VersionDateChanges
v1.2.112026-10-21Added 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.102026-10-19Added 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.92026-10-16Added 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.72026-10-08Added 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.62026-10-08Expanded 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.52026-09-22Added 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.42026-08-18Added 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.32026-08-14Added 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.22026-08-13Added 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.12026-08-12Added 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.02026-08-11Added 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.02026-08-07Renamed 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.12026-08-04Added 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.02026-07-28Initial 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

The external order status codes are defined below. In the platform's internal status mapping, an order is considered completed and settled only when orderStatus=FINISHED and settleStatus=1; only then is 4 returned externally. Other unsettled states may still change.
StatusMeaningDescription
0SettlingThe 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.
1CancelledCancellation-class state. Internal platform status CANCELED and WITHDRAWN are both returned externally as this status.
2Waiting For Seller DeliveryThe order has been created and is waiting for seller delivery. Internal platform status PENDING maps to this status.
3Waiting For Buyer ReceiptThe seller has delivered and the buyer is expected to accept the trade offer. Internal platform status DELIVERING/DELIVERED maps to this status.
4CompletedThe trade and settlement are complete, and active polling stops. This requires internal platform status orderStatus=FINISHED and settleStatus=1.
99OtherUnknown or unmapped downstream status.
The cancellation reason 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 ReasonMeaning
1System cancelled the order before delivery
2Buyer cancelled the order before delivery
3Seller cancelled the order before delivery
4Offer cancelled on Steam
5Offer modified on Steam
6Buyer timed out receiving, system cancelled the order
7Seller delivered but buyer did not receive, seller cancelled the order
8Offer expired
9Steam account abnormal, cancelled
10Unpaid, system cancelled
11Seller delivered but buyer did not receive, buyer cancelled the order
12Seller reversed the trade during the protection period after buyer receipt
13Buyer reversed the trade during the protection period after buyer receipt
14Buyer cancelled the order; delivery stage unspecified. This does not establish buyer liability
15Seller cancelled the order; delivery stage unspecified. This does not establish seller liability
100Unknown or cannot be classified accurately

1. Access And Signature

ItemDescription
MethodPOST
Content-TypeRecommended multipart/form-data; application/x-www-form-urlencoded is also supported
EncodingUTF-8
ParametersForm parameters, received by the server through @RequestParam

Common Parameters

NameTypeRequiredDescription
partner_keystringYesMerchant/channel access key assigned by the platform
tinteger/stringYesUnix timestamp in seconds
signstringYesRSA-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

StepDescription
1Put business parameters, partner_key, t, and public_key into one map
2Exclude sign, null values, and empty strings
3Sort by parameter name in ascending ASCII/dictionary order
4Join entries as key=value, separated by &
5Sign 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

codemessageDescription
1successSuccess
201001Invalid parameterMissing, malformed or constraint-violating business parameters
201002Product unavailableProduct does not exist, is expired or cannot be purchased
201003Price expiredQuote expired or differs from the current valid price; query again
201004Order number already existsDuplicate merchant order number; query the original order
201005Order not found or forbiddenOrder does not exist or does not belong to this channel
201006Invalid order referenceOrder references do not match or do not identify a unique order
201007Order result pendingQuery using the original merchant order number; do not submit again
201008Downstream request failedDownstream service call failed or returned a failure
201009Insufficient balanceInsufficient available channel balance
201010System errorUnexpected server-side error
201011Service unavailableService is temporarily unavailable; retry later
201099Business operation failedUnclassified business exception
101001Common parameter errorMissing common parameters or invalid timestamp
101002Signature verification failedThe signature is invalid
101003No permissionThe channel account is unavailable or has no public key
101006API expiredThe request timestamp is outside the allowed window

Common Response Fields And Reading Conventions

FieldTypeMeaning And Availability
codeinteger1 means success; 201xxx indicates a business error and 101xxx an authentication error. See the error table above.
messagestringResult description; normally success on success, or an error message on failure.
dataobject / array / nullBusiness 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

Each channel account has a fixed settlement currency that cannot be changed after creation. CNY channels receive all amount fields in CNY. USD channels receive amount fields in USD for product queries, full product sync, WSS product pushes, order creation responses, order queries, cancellation responses, order history, and merchant balance APIs. USD amounts are calculated from the latest platform USD exchange rate and channel pricing rules, with 2 decimal places. For USD channels, 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

URL/third/distribution/api/trade_list
MethodPOST
PurposeQuery listed items for one market_hash_name

Request Parameters

NameTypeRequiredDescription
app_idintegerYesGame ID. CS2/CSGO is 730
market_hash_namestringYesSteam market hash name
page_nointegerNoPage number for the local view, starting from 1 and defaulting to 1. Ignored in other query modes
page_sizeintegerNoPage size for the local view, defaulting to 20. Ignored in other query modes, which return all matching products
delivery_typeintegerNo1 auto delivery, 2 manual delivery, 3 fast manual delivery
exterior_wear_startnumberNoMinimum wear
exterior_wear_endnumberNoMaximum wear
min_pricenumberNoMinimum price in the channel account settlement currency
max_pricenumberNoMaximum price in the channel account settlement currency
search_keystringNoSearch 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[])

FieldTypeMeaning And Availability
namestring / nullProduct display name; not a unique identifier for a listing.
assetidstring / nullSteam asset ID; may be unavailable and does not replace trade_id when buying.
icon_urlstring / nullProduct image URL; null when unavailable.
unit_pricestringCurrent quoted unit price as a decimal string; use this quote when buying.
currencystringPrice currency: CNY (Chinese yuan) or USD (US dollar).
trade_idinteger / stringIdentifier of the listing used for purchase; may be numeric or a string starting with P_. Preserve, sign, and submit it unchanged.
market_hash_namestringSteam market hash name identifying the item category; multiple listings can share the same name.
delivery_typeintegerDelivery type: 1 automatic, 2 manual, 3 fast manual.
exterior_wearstring / nullItem wear value as a decimal string; may be null when unavailable or not applicable.
paint_indexinteger / nullPaint index identifying the skin finish; may be null when unavailable.
paint_seedinteger / nullPattern seed; may be null when unavailable. This is not a listing ID.
is_dopplerboolean (conditional)Returned as true for Doppler-family products; omitted for other products.
familystring (conditional)Doppler family: DOPPLER or GAMMA_DOPPLER; omitted for other products.
stylestring (conditional)Style code, for example RUBY; omitted when no style is identified, even if is_doppler=true.
labelstring (conditional)Style display label, for example 红宝石 (Ruby); omitted when unavailable.
page.page_nointegerCurrent page number for the single-category listing endpoint, starting at 1.
page.is_moreintegerThe 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.

URL/third/distribution/api/trade_info
MethodPOST
PurposeLook up one listed item by trade_id in real time

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.

ParameterTypeRequiredDescription
trade_idinteger / stringYesOne 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

URL/third/distribution/api/market_item_list
MethodPOST
PurposeRead all available products from the local product database using cursor pagination

This endpoint reads only the platform's local product database. It does not call a downstream platform API.

Request Parameters

NameTypeRequiredDescription
next_cursorstringNoThe maximum product id returned by the previous batch. Empty on the first request.
page_sizeintegerNoItems per batch. Defaults to 100 and is limited to 500.
app_idintegerNoGame 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

FieldTypeMeaning And Availability
productsarrayProducts in the current batch; an empty array when no products match.
is_morebooleantrue means another batch exists; false means finished. Unlike trade_list, this is not numeric 1/0.
next_cursorstring / nullCursor 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

URL/third/distribution/api/batch_query_trade
MethodPOST
PurposeQuery listings for multiple market names
NameTypeRequiredDescription
app_idintegerYesGame ID. CS2/CSGO is 730
market_hash_namestringYesJSON 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

URL/third/distribution/api/trade_buy
MethodPOST
PurposeCreate a purchase order by item ID

If the request times out or returns no result, query get_order_by_channel_no after about 2 minutes to avoid duplicate orders.

NameTypeRequiredDescription
channel_order_nostringYesMerchant order number. Must be unique for idempotency
trade_idinteger/stringYesItem 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_pricenumberYesPurchase price in the channel account settlement currency, two decimals. USD channels should pass the USD price returned by the product query APIs.
fetch_track_linkstringYesRecipient Steam trade URL. This value usually contains &token=... and must be form-encoded when sending the request.
fetch_steam_uidstringYesRecipient Steam UID

Purchase Response Fields (data)

FieldTypeMeaning And Availability
channel_order_nostringMerchant order number supplied by the channel, used to correlate requests and results.
total_amountstring / nullTotal order amount in the currency specified by currency.
currencystringOrder amount currency: CNY or USD.
total_qtyinteger / nullTotal quantity purchased in this order.
order_numberinteger / nullPlatform parent order number; distinct from the channel-supplied channel_order_no and the child order_id.
order_listarrayList of child orders created by this purchase.
order_list[].order_idinteger / nullPlatform child order ID for querying or cancelling a child order; not the product trade_id.
order_list[].amountstring / nullAmount of this child order.
order_list[].currencystringChild order currency: CNY or USD.
order_list[].qtyinteger / nullQuantity 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

URL/third/distribution/api/quick_order
MethodPOST
DescriptionBuy one item by name, maximum price and optional wear range

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.

ParameterTypeRequiredDescription
channel_order_nostringYesUnique client order number. Query with the same number after a timeout; do not retry with a new number.
market_hash_namestringYesFull English market hash name; exact match.
max_pricenumberYesMaximum 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_linkstringYesRecipient Steam trade URL, form-encoded.
fetch_steam_uidstringYesRecipient Steam UID.
exterior_wear_startnumberNoMinimum wear, up to 18 decimal places. Send both wear parameters or omit both.
exterior_wear_endnumberNoMaximum 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

URL/third/distribution/api/get_order_by_channel_no
MethodPOST
PurposeQuery the latest order status
NameTypeRequiredDescription
channel_order_nostringNoMerchant order number. Required if order_id is absent
order_idinteger/stringNoPlatform 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[])

FieldTypeMeaning And Availability
statusinteger / nullOrder status: 0 settling, 1 cancelled, 2 awaiting seller delivery, 3 awaiting buyer receipt, 4 settled, 99 other; null means unavailable.
channel_order_nostring / nullMerchant order number supplied by the channel when buying.
fetch_steam_uidstring / nullRecipient's Steam UID, not the seller's UID.
withdrawn_flagstring / integer / nullWithdrawal flag: 0 normal, 1 withdrawn; null when unavailable.
withdrawal_liability_statusstring / integer / nullWithdrawal liability: 0 none, 1 buyer, 2 seller, 3 neither party, 4 pending; null when unavailable.
order_idinteger / nullPlatform child order ID; usable for querying and requesting cancellation.
provisional_timenull (current query)Trade protection time information; currently always null in this query endpoint. It cannot establish whether protection exists or has ended.
qtyinteger / nullItem quantity in the child order.
penalty_amountstringOrder penalty amount in currency; zero means no penalty amount is reported in this response.
amountstring / nullAmount returned for this order row, denominated in currency.
currencystringCurrency for this order row: CNY or USD.
create_timestring / nullOrder creation time in yyyy-MM-dd HH:mm:ss format; null when unavailable.
cancel_typeinteger / nullCancellation reason code; see the cancellation reason table. Null for orders that are not cancelled.
trade_offerstring / nullSteam Trade Offer ID; null when not created or unavailable. This is not a full trade URL.
original_amountstring / nullOriginal amount used as the service charge basis; not a profit or refund amount.
order_numberinteger / nullPlatform parent order number associated with this child order.
service_chargestringService charge; the query returns amount minus original_amount, or zero for cancelled orders.
order_typeintegerOrder 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

URL/third/distribution/api/apply_cancle_order
MethodPOST
PurposeApply to cancel an in-progress order

The endpoint path is fixed as apply_cancle_order. The final result must be confirmed by querying order status.

NameTypeRequiredDescription
order_idinteger/stringYesPlatform sub-order ID
channel_order_nostringNoMerchant 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

URL/third/distribution/api/order_history
MethodPOST
PurposeQuery historical orders
NameTypeRequiredDescription
start_timestringYesStart time, format yyyy-MM-dd HH:mm:ss
end_timestringYesEnd time, format yyyy-MM-dd HH:mm:ss
time_typeintegerYes1 by creation time, 2 by settlement/end time
page_sizeintegerYesPage size. Maximum 100; local view defaults to 20
page_nointegerYesPage number, starting from 1
statusintegerNoOrder 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

FieldTypeMeaning And Availability
rowsarrayHistorical 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[].createdstring / nullCreation time in yyyy-MM-dd HH:mm:ss format; this endpoint uses created rather than create_time.
rows[].end_timestring / nullCompletion or cancellation time when available; otherwise it may contain the latest update time. Use status to determine whether the order has ended.
rows[].created_timestampstring / nullUnix timestamp in seconds corresponding to created, returned as a string, not milliseconds.
rows[].end_time_timestampstring / nullUnix timestamp in seconds corresponding to end_time, returned as a string with the same semantics.
rows[].original_amountstring / nullThis history endpoint currently returns the same amount as amount.
rows[].service_chargestringThis history endpoint currently returns zero.
page.page_nointegerCurrent page number, starting at 1.
page.is_morebooleantrue 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

URL/third/distribution/api/info
MethodPOST
PurposeQuery merchant balance information

Merchant Fields (data[])

FieldTypeMeaning And Availability
usernamestringAccount display name.
lock_cashstringLocked account funds in the currency specified by currency.
balancestringAccount balance in currency; not cumulative turnover.
currencystringAccount 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

URLwss://www.maiyidun.com/third/distribution/ws/market
MethodWebSocket
PurposeReceive realtime market item change events
WSS no longer uses URL signature parameters for handshake. After the socket is connected, the client must send an 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.
Only one WSS connection is allowed for each channel account. When a new connection is authenticated for the same account, the previous connection is kicked. The previous connection closes with code 1008 and reason duplicate channel account connection.

Auth Fields

FieldTypeRequiredDescription
appIdstringYesChannel account ID, that is channel_account.id
partner_keystringYesChannel partner key, that is channel_account.partner_key

WSS Authentication Message Fields

FieldTypeMeaning And Availability
typestringMessage type: AUTH for authentication requests, AUTH_ACK for success, ERROR for errors, and PING/PONG for heartbeats.
reqIdstringOptional client correlation ID; echoed in the response, or an empty string when omitted.
dataobject / stringFor AUTH, an object containing appId and partner_key; for AUTH_ACK, the string success; for ERROR, an error description string.
serverTimeintegerCurrent 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

DirectionExample
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

FieldTypeDescription
typestringAlways market_item_change
event_idstringUnique event ID
event_timeintegerEvent timestamp in milliseconds
actionstringChange type: new adds a listing, change updates it, and remove removes it from sale
dataobjectProduct 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

DirectionPlatform to channel
MethodPOST
Content-Typeapplication/json;charset=UTF-8
After a callback URL is configured for the channel account, the platform sends an order status callback whenever an order status changes. If no callback URL is configured, the platform does not send or retry that callback event.

Callback Envelope

FieldTypeDescription
eventIdstringUnique callback event ID
timestampintegerUnix timestamp in seconds
signaturestringCallback signature, HmacSHA256 + Base64
payloadstringBusiness payload as a JSON string. Use the original string for signature verification

Callback Signature Rules

StepDescription
1Read envelope fields eventId, timestamp, and payload
2Build the sign source as eventId.timestamp.payload, separated by the dot character .
3Use the channel account partner_key as the HMAC secret
4Run HmacSHA256, Base64 encode the result, and compare it with signature
sign_source = eventId + "." + timestamp + "." + payload
signature = Base64(HmacSHA256(sign_source, partner_key))

Payload Structure

FieldTypeDescription
eventTimeintegerStatus change time in milliseconds
fromStatusintegerPrevious order status. Semantics match the order query API
toStatusintegerNew order status. Semantics match the order query API
dataobjectOrder 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

FieldTypeMeaning And Availability
fromStatusinteger / nullPrevious status; may be null when unavailable. Null must not be interpreted as status 0.
data.provisional_timestring / nullCallback 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_amountstringIn callbacks, uses the same paid-amount basis as data.amount.
data.service_chargestringCurrently 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

After processing succeeds, return an HTTP 2xx status and body 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}}"
}