{
  "tags": [
    "订单"
  ],
  "description": "获取当前登录用户的一条订单。服务端始终以订单 ID 和当前登录用户 ID 联合查询；即使管理员登录，也不能通过此接口查看其他用户的订单。",
  "operationId": "user_get_v1_orders_order_id",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "成功、未登录和订单不存在/无权限均返回 HTTP 200。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "description": "业务状态码；0 表示成功。",
                    "enum": [
                      0
                    ]
                  },
                  "msg": {
                    "type": "string",
                    "description": "业务提示。",
                    "example": "获取成功"
                  },
                  "data": {
                    "type": "object",
                    "description": "订单记录。",
                    "required": [
                      "id",
                      "uid",
                      "type",
                      "des",
                      "data",
                      "create_at",
                      "pay_at",
                      "amount",
                      "real_amount",
                      "pay_type",
                      "mch_order_no",
                      "transaction_id",
                      "state"
                    ],
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "订单 ID。"
                      },
                      "uid": {
                        "type": "integer",
                        "nullable": true,
                        "description": "订单所属用户 ID。"
                      },
                      "type": {
                        "type": "string",
                        "nullable": true,
                        "description": "订单类型。"
                      },
                      "des": {
                        "type": "string",
                        "nullable": true,
                        "description": "订单说明。"
                      },
                      "data": {
                        "type": "string",
                        "nullable": true,
                        "description": "订单关联的业务数据文本。"
                      },
                      "create_at": {
                        "type": "string",
                        "nullable": true,
                        "description": "订单创建时间；由数据库日期时间字段序列化返回。"
                      },
                      "pay_at": {
                        "type": "string",
                        "nullable": true,
                        "description": "订单付款时间；由数据库日期时间字段序列化返回。"
                      },
                      "amount": {
                        "type": "integer",
                        "nullable": true,
                        "description": "订单应付金额，单位为系统最小货币单位。"
                      },
                      "real_amount": {
                        "type": "integer",
                        "nullable": true,
                        "description": "订单实付金额，单位为系统最小货币单位。"
                      },
                      "pay_type": {
                        "type": "string",
                        "nullable": true,
                        "description": "付款方式。"
                      },
                      "mch_order_no": {
                        "type": "string",
                        "nullable": true,
                        "description": "支付渠道商户订单号。"
                      },
                      "transaction_id": {
                        "type": "string",
                        "nullable": true,
                        "description": "支付渠道交易流水号。"
                      },
                      "state": {
                        "type": "string",
                        "nullable": true,
                        "description": "订单状态。"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "order-3",
                      "login_required"
                    ],
                    "description": "订单不存在、无权访问或未登录时的业务错误码。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "错误原因。",
                    "example": "订单不存在或无权限"
                  },
                  "data": {
                    "type": "string",
                    "description": "错误响应中的固定空字符串。",
                    "example": ""
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "examples": {
            "success": {
              "summary": "查询成功",
              "value": {
                "code": 0,
                "msg": "获取成功",
                "data": {
                  "id": 501,
                  "uid": 12,
                  "type": "充值",
                  "des": "账户余额充值",
                  "data": "",
                  "create_at": "Mon, 01 Jan 2026 12:00:00 GMT",
                  "pay_at": "Mon, 01 Jan 2026 12:01:00 GMT",
                  "amount": 1234,
                  "real_amount": 1234,
                  "pay_type": "alipay",
                  "mch_order_no": "REDACTED_ORDER_NO",
                  "transaction_id": "REDACTED_TRANSACTION_ID",
                  "state": "已付款"
                }
              }
            },
            "notFound": {
              "summary": "订单不存在或无权访问",
              "value": {
                "code": "order-3",
                "msg": "订单不存在或无权限",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "获取成功",
            "data": {
              "id": 501,
              "uid": 12,
              "type": "充值",
              "des": "账户余额充值",
              "data": "",
              "create_at": "Mon, 01 Jan 2026 12:00:00 GMT",
              "pay_at": "Mon, 01 Jan 2026 12:01:00 GMT",
              "amount": 1234,
              "real_amount": 1234,
              "pay_type": "alipay",
              "mch_order_no": "REDACTED_ORDER_NO",
              "transaction_id": "REDACTED_TRANSACTION_ID",
              "state": "已付款"
            }
          }
        }
      }
    }
  },
  "x-python-handler": "order.OrderAPI",
  "x-python-route-line": 671,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "order_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "integer",
        "minimum": 1,
        "example": 501
      },
      "description": "要查询的订单 ID。"
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "order.OrderAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 671
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "get",
  "path": "/v1/orders/{order_id}",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "获取订单详情",
    "description": {
      "content": "获取当前登录用户的一条订单。服务端始终以订单 ID 和当前登录用户 ID 联合查询；即使管理员登录，也不能通过此接口查看其他用户的订单。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "orders",
        ":order_id"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": [
        {
          "disabled": false,
          "description": {
            "content": "(Required) 要查询的订单 ID。",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "order_id"
        }
      ]
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "GET",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}