# 订单新增

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/order/create:
    post:
      summary: 订单新增
      deprecated: false
      description: 幂等接口
      tags:
        - 接口列表/订单接口
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                productId:
                  type: integer
                  description: 充值产品ID
                outOrderNo:
                  type: string
                  description: 商户侧订单号，最长32位(保证唯一性)
                buyNum:
                  type: integer
                  description: 购买数量，默认1
                remark:
                  type: string
                  description: 备注
                salesChannel:
                  type: string
                  description: 销售渠道（拼多多、淘宝、天猫、京东、苏宁、其他）（根据实际情况进行传递，如果产品有限制，会进行识别）
                safePrice:
                  type: number
                  description: 安全价格（单位：元）（防止接入亏本，不传不校验）
                finalPrice:
                  type: number
                  description: 最终成交价（单位：元）（如果限价产品，会拦截，不传不校验）
                notifyUrl:
                  type: string
                  description: 订单状态回调地址，为空则不回调
                extendParams:
                  type: object
                  properties:
                    account:
                      type: string
                  x-apifox-orders:
                    - account
                  description: 业务参数(以下属性为充值模板中key)
                buyerIp:
                  type: string
                  description: 用户终端IP
              required:
                - productId
                - outOrderNo
                - buyNum
                - salesChannel
                - notifyUrl
              x-apifox-orders:
                - productId
                - outOrderNo
                - extendParams
                - buyerIp
                - buyNum
                - remark
                - salesChannel
                - safePrice
                - finalPrice
                - notifyUrl
            example:
              productId: 194f445830a001
              outOrderNo: '2025022515013960953938350082'
              extendParams:
                account: '13666666666'
              buyerClientIp: 192.168.0.1
              buyNum: '3'
              remark: ''
              salesChannel: ''
              safePrice: '1'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      outOrderNo:
                        type: string
                        description: 商户侧订单号
                      orderNo:
                        type: string
                        description: 平台订单号
                      totalPrice:
                        type: integer
                        description: 订单金额（单位：元）
                    required:
                      - orderNo
                      - totalPrice
                      - outOrderNo
                    x-apifox-orders:
                      - orderNo
                      - totalPrice
                      - outOrderNo
                required:
                  - code
                  - msg
                  - data
                x-apifox-orders:
                  - code
                  - msg
                  - data
              examples:
                '1':
                  summary: 成功示例
                  value:
                    code: 200
                    msg: 操作成功
                    data:
                      orderNo: '2025021210589188810864250881'
                      totalPrice: 10
                      outOrderNo: '2025021210589188800898584577'
                '2':
                  summary: 异常示例
                  value:
                    code: 400
                    msg: 余额不足
                    data: null
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: 接口列表/订单接口
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5657281/apis/api-253578803-run
components:
  schemas: {}
  securitySchemes: {}
servers: []
security: []

```
