K
Future AI API 文档PHP / JSON Interface Reference
返回商城
API REFERENCE

主站与独立商家店铺接口

所有接口均由 api.php 提供。独立商家店铺使用 merchant 标识读取公开数据,已审核通过的店主使用独立商家管理接口。

当前接口基础地址http://futureaism.636.ltd/api.php?route={route}

调用规则

写入接口使用 JSON 请求体和 Content-Type: application/json。登录后可使用浏览器 Cookie,外部调用请传会话令牌。

Authorization: Bearer {sessionToken}
X-Session-Token: {sessionToken}
{
  "productId": 12,
  "quantity": 1,
  "payType": "alipay"
}

安全说明:这是商城自身的业务 API,不提供公开密钥。商户易支付密钥、SMTP 密码和卡密内容不会通过配置接口返回。

公开接口

访客可调用。独立商家店铺使用店铺标识获取与主站完全隔离的商品数据。

GEThttp://futureaism.636.ltd/api.php?route=health

检查 PHP、JSON 与数据文件是否可用。

权限:无需登录
GEThttp://futureaism.636.ltd/api.php?route=bootstrap

读取主站商品、公告、分类和登录状态。

权限:无需登录
GEThttp://futureaism.636.ltd/api.php?route=bootstrap&merchant={slug}

读取独立商家店铺的商品、公告和店铺信息。

权限:无需登录
GEThttp://futureaism.636.ltd/api.php?route=auth/captcha&purpose=login|register

获取登录或注册图形验证码。

权限:无需登录
POSThttp://futureaism.636.ltd/api.php?route=register

注册账号;启用邮箱验证时需提交邮箱验证码。

权限:无需登录
POSThttp://futureaism.636.ltd/api.php?route=login

用户登录并返回 sessionToken。

权限:无需登录
POSThttp://futureaism.636.ltd/api.php?route=admin/login

管理员登录。

权限:管理员账号
POSThttp://futureaism.636.ltd/api.php?route=auth/email-code

发送登录或注册邮箱验证码。

权限:按配置启用
GEThttp://futureaism.636.ltd/api.php?route=order-query&orderNo={orderNo}

按订单号查询公开订单状态。

权限:无需登录

用户接口

需要用户登录。创建商家店铺订单时,在请求中附带 merchantSlug

GEThttp://futureaism.636.ltd/api.php?route=orders

读取当前用户商品订单、充值和退款记录。

权限:已登录用户
POSThttp://futureaism.636.ltd/api.php?route=orders

创建订单;独立店铺订单传 merchantSlug。

权限:已登录或填写联系方式
POSThttp://futureaism.636.ltd/api.php?route=orders/cancel

取消尚未支付的订单。

权限:订单所属用户
POSThttp://futureaism.636.ltd/api.php?route=recharge

创建余额充值订单。

权限:已登录用户
POSThttp://futureaism.636.ltd/api.php?route=refunds

提交人工退款申请。

权限:已登录用户
GEThttp://futureaism.636.ltd/api.php?route=payment/status&order={orderNo}

读取订单或充值支付状态。

权限:订单所属用户
GEThttp://futureaism.636.ltd/api.php?route=merchants/mine

读取当前用户商家申请或店铺资料。

权限:已登录用户
POSThttp://futureaism.636.ltd/api.php?route=merchants

提交或更新商家入驻申请。

权限:已登录用户
POSThttp://futureaism.636.ltd/api.php?route=logout

退出并废弃当前会话。

权限:已登录用户

商家店铺下单示例

POST http://futureaism.636.ltd/api.php?route=orders
Authorization: Bearer {sessionToken}

{ "productId": 18, "quantity": 1, "payType": "alipay", "merchantSlug": "merchant-demo" }

商家分站(独立店铺)接口

店铺地址:http://futureaism.636.ltd/index.php?merchant={slug}。商家必须是店铺所有者且审核通过,商品、库存、订单、SMTP 和易支付配置均只作用于自己的店铺。

GEThttp://futureaism.636.ltd/api.php?route=merchant/dashboard

返回本店商品、订单、SMTP 和易支付状态。

权限:审核通过的店主
POSThttp://futureaism.636.ltd/api.php?route=merchant/settings

更新店铺名称、介绍、客服说明和公告。

权限:审核通过的店主
POSThttp://futureaism.636.ltd/api.php?route=merchant/products

新建或编辑自己的商品,不可操作主站商品。

权限:审核通过的店主
POSThttp://futureaism.636.ltd/api.php?route=merchant/products/delete

删除自己的商品。

权限:审核通过的店主
POSThttp://futureaism.636.ltd/api.php?route=merchant/product-stock

更新可售数量并录入卡密或链接。

权限:审核通过的店主
POSThttp://futureaism.636.ltd/api.php?route=merchant/smtp

保存或检测本店 SMTP,密码加密保存。

权限:审核通过的店主
POSThttp://futureaism.636.ltd/api.php?route=merchant/epay

保存本店易支付信息,密钥不会回传。

权限:审核通过的店主

读取独立店铺示例

GET http://futureaism.636.ltd/api.php?route=bootstrap&merchant=merchant-demo

管理员接口

需要管理员会话。管理员管理主站和商家审核;商家独立支付密钥不会在列表接口中返回。

GEThttp://futureaism.636.ltd/api.php?route=admin/bootstrap

读取后台汇总、商品、用户、订单和商家信息。

权限:管理员
POSThttp://futureaism.636.ltd/api.php?route=admin/products

新建或编辑主站商品。

权限:管理员
POSThttp://futureaism.636.ltd/api.php?route=admin/product-stock

维护主站商品卡密库存。

权限:管理员
POSThttp://futureaism.636.ltd/api.php?route=admin/groups

维护主站商品分组。

权限:管理员
POSThttp://futureaism.636.ltd/api.php?route=admin/users

编辑用户权限和余额。

权限:管理员
POSThttp://futureaism.636.ltd/api.php?route=admin/merchants

审核、停用或删除商家申请。

权限:管理员
POSThttp://futureaism.636.ltd/api.php?route=admin/settings

更新主站名称、公告和服务信息。

权限:管理员
POSThttp://futureaism.636.ltd/api.php?route=admin/smtp

保存或检测平台 SMTP。

权限:管理员

支付回调

支付渠道异步通知统一进入此入口。系统会根据订单归属使用主站或该商家店铺的密钥,验证商户 ID、MD5 签名、金额和交易状态。

POST http://futureaism.636.ltd/api.php?route=payment/notify
必填:pid、out_trade_no、trade_no、money、trade_status、sign、sign_type
成功响应:success

注意:不要手动模拟支付成功。订单仅在渠道异步通知通过验签后自动发货。