{
  "openapi": "3.0.3",
  "info": {
    "title": "OpenAPI 接口 - 会员开通",
    "version": "1.0.0",
    "description": "OpenAPI 接口相关接口文档"
  },
  "paths": {
    "/openapi/memberships/activate": {
      "post": {
        "summary": "会员开通",
        "description": "基于已支付订单为客户端用户开通会员资格，并自动同步会员用户记录和订单状态。",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "客户端登录令牌，格式为 Bearer TOKEN",
            "example": "Bearer {token}"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "memberType": {
                    "type": "string",
                    "description": "string｜必填，会员类型编码或名称，如 VIP"
                  },
                  "orderNo": {
                    "type": "string",
                    "description": "string｜必填，已支付订单号"
                  }
                },
                "required": [
                  "memberType",
                  "orderNo"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "example": {
                  "success": {
                    "code": "0000",
                    "message": "会员开通成功",
                    "data": {
                      "clientUser": {
                        "id": "GplqNHbkcmcFa0sj",
                        "code": "CU000009",
                        "phone": "18347432461",
                        "name": "Smkello"
                      },
                      "memberUser": {
                        "id": "toiUHzFoO1xtmSkI",
                        "memberType": "VIP"
                      },
                      "order": {
                        "orderNo": "ORD-20250115-0010",
                        "status": "COMPLETED"
                      }
                    }
                  },
                  "failure": {
                    "code": "1107",
                    "message": "订单尚未支付或已失效",
                    "data": null
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}