仰望星辰工作室

better-staridc-MNBT

better-staridc-MNBT/ docs/integration/qmzl-domain.md 3.8 KB · 151 行 原始文件
Z zfhsh first commit 1 天前
1---
2title: 域名注册 API 对接
3description: 第三方域名注册商 API 对接文档,含域名查询、价格、信息模板、购物车与下单完整流程(基于 idcsmart 域名模块)
4---
5
6# 域名注册 API 对接
7
8## 基本信息
9
10| 项目 | 说明 |
11|------|------|
12| **Base URL** | `{host}/console/v1` |
13| **认证方式** | `Authorization: Bearer {token}` |
14| **Content-Type** | `application/json`(文件上传用 `multipart/form-data`) |
15| **响应格式** | `{ status: 200, msg: "...", data: {...} }` |
16
17---
18
19## 1. 域名配置
20
21### 获取域名配置
22
23`GET /idcsmart_domain/config`
24
25返回系统配置:域名注册/信息服务协议链接、可搜索后缀列表、默认搜索后缀。
26
27---
28
29## 2. 域名查询
30
31### 查询域名可注册状态
32
33`GET /idcsmart_domain/check_domain`
34
35| 参数 | 类型 | 必填 | 说明 |
36|------|------|------|------|
37| `domain` | string | 是 | 域名前缀(不含后缀) |
38| `suffix` | string | 是 | 后缀(含点号,如 `.com`) |
39| `host_id` | int | 是 | 固定 `0` |
40
41响应 `data[]` 每项:`name`(完整域名)、`avail`(1=可注册, 0=已注册)。
42
43---
44
45## 3. 域名价格
46
47### 获取域名注册价格
48
49`GET /idcsmart_domain/get_price`
50
51| 参数 | 说明 |
52|------|------|
53| `name` | 完整域名 |
54| `host_id` | 固定 `0` |
55
56响应:按年限的 `buyyear` / `buyprice` 数组。
57
58---
59
60## 4. 信息模板
61
62模板状态:`0` 未认证、`1` 已认证、`2` 审核中、`3` 认证失败、`4` 异常。
63
64| 方法 | 路径 | 说明 |
65|------|------|------|
66| GET | `/idcsmart_domain/info_template` | 模板列表 |
67| GET | `/idcsmart_domain/info_template/{id}` | 模板详情 |
68| POST | `/idcsmart_domain/info_template` | 创建模板(multipart/form-data) |
69| PUT | `/idcsmart_domain/info_template/{id}` | 更新模板 |
70| DELETE | `/idcsmart_domain/info_template/{id}` | 删除模板 |
71| POST | `/idcsmart_domain/info_template/{id}/certifications` | 提交实名认证 |
72
73证件类型:`SFZ`(身份证)、`HZ`(护照)、`YYZZ`(营业执照)、`ORG`(组织机构代码证)、`TYDM`(统一社会信用代码证)等。
74
75---
76
77## 5. 购物车与下单
78
79### 加入购物车
80
81`POST /cart`
82
83```json
84{
85 "product_id": 12,
86 "config_options": { "domain": "mydomain.com", "year": 3 },
87 "qty": 1,
88 "customfield": { "is_domain": 1 }
89}
90```
91
92### 结算创建订单
93
94`POST /cart/settle`
95
96```json
97{
98 "positions": [0],
99 "customfield": {
100 "auto_renew": 1,
101 "lock_status": 1,
102 "c_sysid": "1",
103 "host_id": 0
104 }
105}
106```
107
108响应 `{ "status": 200, "data": { "order_id": "..." } }`。
109
110下单成功后跳转支付:`/console/payment?orderId={id}&amount={金额}&gateway={网关}`
111
112---
113
114## 6. 已购域名列表
115
116`GET /host?page={n}&limit={n}`
117
118status 枚举:`Active`(正常)、`Suspended`(已暂停)、`Pending`(处理中)、`Expired`(已过期)、`Deleted`(已删除)。
119
120---
121
122## 7. 辅助接口
123
124| 方法 | 路径 | 说明 |
125|------|------|------|
126| GET | `/product/group/first` | 一级产品分组 |
127| GET | `/product/group/second?id={id}` | 二级产品分组 |
128| GET | `/product?keywords=域名` | 搜索域名产品 |
129| GET | `/gateway` | 支付网关列表 |
130
131---
132
133## 完整注册流程
134
135```
1361. GET /idcsmart_domain/config → 获取配置
1372. GET /idcsmart_domain/check_domain → 查询域名
1383. GET /idcsmart_domain/get_price → 获取价格
1394. GET /idcsmart_domain/info_template → 获取模板列表
1405. POST /cart → 加入购物车
1416. POST /cart/settle → 结算创建订单
1427. 跳转 /console/payment → 支付页面
143```
144
145---
146
147## 错误处理
148
149统一格式:`{ "status": 400, "msg": "错误描述" }`
150
151> 完整原始文档见 `app_plugins/qmzl_domain/域名注册API对接文档.md`