对接文档重构:两种发货对接方式分开展示
- 左侧目录按分组展示:基础接口 / 发货链接模式 / 自建发货页模式 / 回调 / 附录 - 概述页发货对接方式对比表强化(适用场景/接口顺序/建议) - 创建订单响应示例 data 统一为约定字段,补充 201/200 状态说明 - 对外响应字段 upstream_order 更名为 delivery(result_data 存储键兼容旧数据)
This commit is contained in:
@@ -67,7 +67,7 @@ const orderResponseExample = `{
|
||||
"amount": 105,
|
||||
"currency": "POINT",
|
||||
"buyer_reference": "buyer-001",
|
||||
"data": { "server": "ios-wechat", "uid": "player-id" },
|
||||
"data": { "game_account": "4808146277", "game_channel": "ios-wechat" },
|
||||
"provider_order_no": "",
|
||||
"failure_reason": "",
|
||||
"created_at": "2026-07-30T10:00:00+08:00",
|
||||
@@ -133,7 +133,7 @@ const deliverySubmitResponseExample = `{
|
||||
"game_account": "4808146277",
|
||||
"game_account_role_name": "巫师哈丁12"
|
||||
},
|
||||
"upstream_order": {
|
||||
"delivery": {
|
||||
"order_no": "provider-1"
|
||||
}
|
||||
}
|
||||
@@ -142,6 +142,7 @@ const deliverySubmitResponseExample = `{
|
||||
export const endpoints: EndpointSpec[] = [
|
||||
{
|
||||
key: 'list-products',
|
||||
group: 'basic',
|
||||
method: 'GET',
|
||||
path: '/api/client/v1/products',
|
||||
title: '商品列表',
|
||||
@@ -187,6 +188,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
},
|
||||
{
|
||||
key: 'create-order',
|
||||
group: 'basic',
|
||||
method: 'POST',
|
||||
path: '/api/client/v1/orders',
|
||||
title: '创建订单',
|
||||
@@ -225,7 +227,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
"amount": 105,
|
||||
"currency": "POINT",
|
||||
"buyer_reference": "buyer-001",
|
||||
"data": { "server": "ios-wechat", "uid": "player-id" },
|
||||
"data": { "game_account": "4808146277", "game_channel": "ios-wechat" },
|
||||
"provider_order_no": "",
|
||||
"failure_reason": "",
|
||||
"created_at": "2026-07-30T10:00:00+08:00",
|
||||
@@ -239,6 +241,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
{ name: 'order', type: 'object', desc: '订单完整对象,字段见下方「订单字段说明」' },
|
||||
],
|
||||
notes: [
|
||||
'成功创建返回 HTTP 201;命中幂等(client_order_no 已存在)返回 HTTP 200 且 idempotent=true。',
|
||||
'client_order_no 是唯一幂等单号,请保证同一商户下不重复;重复请求不会重复扣款,返回 idempotent=true 及既有订单。',
|
||||
'当前无真实支付流程,下单成功即扣款并进入 order_status=paid,余额不足返回 400。',
|
||||
'下单成功后请保存 order_no,后续查询/发货/回调均以 order_no 为准;client_order_no 仅用于幂等。',
|
||||
@@ -247,6 +250,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
},
|
||||
{
|
||||
key: 'query-order',
|
||||
group: 'basic',
|
||||
method: 'GET',
|
||||
path: '/api/client/v1/orders/{order_no}',
|
||||
title: '查询订单',
|
||||
@@ -258,6 +262,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
},
|
||||
{
|
||||
key: 'cancel-order',
|
||||
group: 'basic',
|
||||
method: 'POST',
|
||||
path: '/api/client/v1/orders/{order_no}/cancel',
|
||||
title: '取消订单',
|
||||
@@ -275,6 +280,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
},
|
||||
{
|
||||
key: 'delivery-link',
|
||||
group: 'delivery-link',
|
||||
method: 'GET',
|
||||
path: '/api/client/v1/orders/{order_no}/delivery-link',
|
||||
title: '获取发货链接',
|
||||
@@ -296,6 +302,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
},
|
||||
{
|
||||
key: 'delivery-order',
|
||||
group: 'delivery-self',
|
||||
method: 'GET',
|
||||
path: '/api/client/v1/orders/{order_no}/delivery',
|
||||
title: '查询发货数据',
|
||||
@@ -328,6 +335,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
},
|
||||
{
|
||||
key: 'delivery-bind',
|
||||
group: 'delivery-self',
|
||||
method: 'POST',
|
||||
path: '/api/client/v1/orders/{order_no}/delivery/bind',
|
||||
title: '发起绑定',
|
||||
@@ -353,6 +361,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
},
|
||||
{
|
||||
key: 'delivery-submit',
|
||||
group: 'delivery-self',
|
||||
method: 'POST',
|
||||
path: '/api/client/v1/orders/{order_no}/delivery/submit',
|
||||
title: '提交发货',
|
||||
@@ -374,7 +383,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
{ name: 'message', type: 'string', desc: '处理结果说明' },
|
||||
{ name: 'provider_order_no', type: 'string', desc: '平台发货单号' },
|
||||
{ name: 'game_account', type: 'object', desc: '账号绑定结果' },
|
||||
{ name: 'upstream_order', type: 'object', desc: '发货提交结果' },
|
||||
{ name: 'delivery', type: 'object', desc: '发货提交结果' },
|
||||
],
|
||||
notes: [
|
||||
'同一订单重复提交应直接返回已有结果,不应重复发起发货。',
|
||||
@@ -383,6 +392,7 @@ export const endpoints: EndpointSpec[] = [
|
||||
},
|
||||
{
|
||||
key: 'get-wallet',
|
||||
group: 'basic',
|
||||
method: 'GET',
|
||||
path: '/api/client/v1/wallet',
|
||||
title: '余额查询',
|
||||
|
||||
@@ -16,6 +16,8 @@ export const endpointSections = [
|
||||
export interface EndpointSpec {
|
||||
/** 唯一 key,用于折叠面板与锚点 */
|
||||
key: string
|
||||
/** 接口分组:basic 基础 / delivery-link 发货链接模式 / delivery-self 自建发货页模式 */
|
||||
group: 'basic' | 'delivery-link' | 'delivery-self'
|
||||
/** HTTP 方法 */
|
||||
method: HttpMethod
|
||||
/** 接口路径,路径参数用 {name} 表示 */
|
||||
|
||||
Reference in New Issue
Block a user