2026-07-31 14:57:09 +08:00
|
|
|
openapi: 3.0.3
|
|
|
|
|
info:
|
|
|
|
|
title: 柏悦头程订单 API
|
2026-08-01 10:17:20 +08:00
|
|
|
description: 业务成功和失败均使用 HTTP 200;仅响应体 code 为字符串 "200" 时表示成功,其他 code 表示失败。
|
2026-07-31 14:57:09 +08:00
|
|
|
version: 1.1.0
|
|
|
|
|
security:
|
|
|
|
|
- bearerAuth: []
|
|
|
|
|
paths:
|
|
|
|
|
/api/merchant/v1/orders/first-leg:
|
|
|
|
|
post:
|
|
|
|
|
summary: 创建订单草稿
|
|
|
|
|
parameters:
|
|
|
|
|
- $ref: '#/components/parameters/IdempotencyKey'
|
|
|
|
|
requestBody:
|
|
|
|
|
required: true
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
2026-08-01 10:17:20 +08:00
|
|
|
schema: {type: object}
|
2026-07-31 14:57:09 +08:00
|
|
|
responses:
|
2026-08-01 10:17:20 +08:00
|
|
|
'200': {description: 成功或业务失败,按响应体 code 判断}
|
2026-07-31 14:57:09 +08:00
|
|
|
/api/merchant/v1/orders/first-leg/{id}/submit:
|
|
|
|
|
post:
|
|
|
|
|
summary: 提交订单
|
|
|
|
|
parameters:
|
|
|
|
|
- $ref: '#/components/parameters/OrderId'
|
|
|
|
|
- $ref: '#/components/parameters/IdempotencyKey'
|
|
|
|
|
responses:
|
2026-08-01 10:17:20 +08:00
|
|
|
'200': {description: 成功或业务失败,按响应体 code 判断}
|
2026-07-31 16:53:07 +08:00
|
|
|
/api/platform/v1/orders/first-leg:
|
|
|
|
|
post:
|
|
|
|
|
summary: 平台代客创建订单草稿
|
|
|
|
|
parameters:
|
|
|
|
|
- $ref: '#/components/parameters/TenantId'
|
|
|
|
|
- $ref: '#/components/parameters/IdempotencyKey'
|
|
|
|
|
requestBody:
|
|
|
|
|
required: true
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
2026-08-01 10:17:20 +08:00
|
|
|
schema: {type: object}
|
2026-07-31 16:53:07 +08:00
|
|
|
responses:
|
2026-08-01 10:17:20 +08:00
|
|
|
'200': {description: 成功或业务失败,按响应体 code 判断}
|
|
|
|
|
'403': {description: 需要 platform:order:create 权限}
|
2026-07-31 16:53:07 +08:00
|
|
|
/api/platform/v1/orders/first-leg/{id}/submit:
|
|
|
|
|
post:
|
|
|
|
|
summary: 平台代客提交指定订单
|
|
|
|
|
parameters:
|
|
|
|
|
- $ref: '#/components/parameters/OrderId'
|
|
|
|
|
- $ref: '#/components/parameters/TenantId'
|
|
|
|
|
- $ref: '#/components/parameters/IdempotencyKey'
|
|
|
|
|
responses:
|
2026-08-01 10:17:20 +08:00
|
|
|
'200': {description: 成功或业务失败,按响应体 code 判断}
|
|
|
|
|
'403': {description: 需要 platform:order:submit 权限}
|
2026-07-31 16:53:07 +08:00
|
|
|
/api/platform/v1/orders/first-leg/{id}:
|
|
|
|
|
put:
|
|
|
|
|
summary: 平台编辑指定订单草稿
|
|
|
|
|
parameters:
|
|
|
|
|
- $ref: '#/components/parameters/OrderId'
|
|
|
|
|
- $ref: '#/components/parameters/TenantId'
|
|
|
|
|
requestBody:
|
|
|
|
|
required: true
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
2026-08-01 10:17:20 +08:00
|
|
|
schema: {type: object}
|
2026-07-31 16:53:07 +08:00
|
|
|
responses:
|
2026-08-01 10:17:20 +08:00
|
|
|
'200': {description: 成功或业务失败,按响应体 code 判断}
|
|
|
|
|
'403': {description: 需要 platform:order:edit 权限}
|
2026-07-31 14:57:09 +08:00
|
|
|
components:
|
|
|
|
|
securitySchemes:
|
|
|
|
|
bearerAuth:
|
|
|
|
|
type: http
|
|
|
|
|
scheme: bearer
|
|
|
|
|
bearerFormat: JWT
|
|
|
|
|
parameters:
|
2026-07-31 16:53:07 +08:00
|
|
|
TenantId:
|
|
|
|
|
name: tenantId
|
|
|
|
|
in: query
|
|
|
|
|
required: true
|
2026-08-01 10:17:20 +08:00
|
|
|
schema: {type: integer, format: int64}
|
2026-07-31 14:57:09 +08:00
|
|
|
OrderId:
|
|
|
|
|
name: id
|
|
|
|
|
in: path
|
|
|
|
|
required: true
|
2026-08-01 10:17:20 +08:00
|
|
|
schema: {type: integer, format: int64}
|
2026-07-31 14:57:09 +08:00
|
|
|
IdempotencyKey:
|
|
|
|
|
name: Idempotency-Key
|
|
|
|
|
in: header
|
|
|
|
|
required: true
|
|
|
|
|
description: 同一租户和操作者重试同一请求时必须保持不变
|
2026-08-01 10:17:20 +08:00
|
|
|
schema: {type: string, minLength: 1, maxLength: 128}
|