**版本：202201**

# 创建Transaction

**POST** `/openapi/2022-01/orders/:id/transactions`

Creates a transaction for an order.

## 请求

**Path参数**

- `id` string (required)

  Order's ID

**application/json**

**请求体 | 示例**

**请求体**

- `transaction` object

  - `` object

```json
{
  "transaction": {}
}
```

## 响应

**200 | 400**

200

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `transaction` object

  - `id` string

    **示例：** `123`
  - `order_id` string

    **示例：** `7182105848352794526`
  - `payment_channel` string

    **示例：** `bogus`
  - `message` string

    **示例：**
  - `created_at` string

    **示例：** `2023-02-24 09:03:41`
  - `test` boolean

    **默认值：** `true`

    **示例：** `true`
  - `error_code` string

    **示例：**
  - `amount` string

    **示例：** `110.0000`
  - `currency` string

    **示例：** `USD`
  - `trade_id` string

    **示例：** `test_7182105848352794526`
  - `status` string

    **示例：** `success`
  - `payment_details` object

    - `card_number` string

      **示例：**
    - `card_month` string

      **示例：**
    - `card_year` string

      **示例：**
    - `card_first_name` string

      **示例：**
    - `card_last_name` string

      **示例：**
    - `card_first_fix` string

      **示例：**
    - `card_last_four` string

      **示例：**
    - `avs_result_code` string

      **示例：**
    - `cvv_result_code` string

      **示例：**
  - `payment_name` string

    **示例：**

```json
{
  "transaction": {
    "id": "123",
    "order_id": "7182105848352794526",
    "payment_channel": "bogus",
    "message": "",
    "created_at": "2023-02-24 09:03:41",
    "test": true,
    "error_code": "",
    "amount": "110.0000",
    "currency": "USD",
    "trade_id": "test_7182105848352794526",
    "status": "success",
    "payment_details": {
      "card_number": "",
      "card_month": "",
      "card_year": "",
      "card_first_name": "",
      "card_last_name": "",
      "card_first_fix": "",
      "card_last_four": "",
      "avs_result_code": "",
      "cvv_result_code": ""
    },
    "payment_name": ""
  }
}
```

```json
{
        "transaction": {
                "id": "123",
                "order_id": "7182105848352794526",
                "payment_channel": "bogus",
                "message": "",
                "created_at": "2023-02-24 09:03:41",
                "test": true,
                "error_code": "",
                "amount": "110.0000",
                "currency": "USD",
                "trade_id": "test_7182105848352794526",
                "status": "success",
                "payment_details": {
                        "card_number": "",
                        "card_month": "",
                        "card_year": "",
                        "card_first_name": "",
                        "card_last_name": "",
                        "card_first_fix": "",
                        "card_last_four": "",
                        "avs_result_code": "",
                        "cvv_result_code": ""
                },
                "payment_name": ""
        }
}
```

400

**application/json**

无 Schema
