---
title: "更新订单风险欺诈"
description: "更新订单下指定的风险欺诈"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/order-management/update-order-risk-fraud'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/order-management/update-order-risk-fraud.md'
---
# 更新订单风险欺诈

更新订单下指定的风险欺诈

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_orders`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
PUT /orders/v2/:order_id/risks/:risk_id.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `write_orders`

## Request

### Path Parameters

* `order_id`

  string (required)

  订单号

* `risk_id`

  string (required)

  欺诈风险id

### Request Headers

* `Content-Type`

  string (required)

  字段值固定为 `application/json; charset=utf-8`。

* `Authorization`

  string (required)

  资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。

### Request Body

* `risk`

  object

  订单风险信息

  * `score`

    string

    欺诈风险得分，0.0-1.0，1为风险最高的得分

  * `source`

    string

    来源标识，固定为：External-外部

  * `cause_cancel`

    boolean

    取消订单标识, true-取消, false-不取消

  * `display`

    boolean

    是否在详情页展示标识, true-展示, false-不展示

  * `recommendation`

    string

    欺诈风险等级: cancel（高风险）、investigate（中风险）、accept（低风险）

  * `risk_detail_msg_list`

    array<object>

    欺诈风险详细信息节点

    * `risk_detail_level`

      string

      欺诈风险节点详细信息等级: cancel（高风险）、investigate（中风险）、accept（低风险）

    * `message`

      string

      欺诈风险节点详细信息

## Response

### Status Codes

* `200`

  更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。

### Response Body

#### 200

* `risk`

  object

  风险欺诈信息

  * `checkout_id`

    string

    订单关联的弃单ID

  * `id`

    string

    欺诈风险ID

  * `recommendation`

    string

    欺诈风险等级: cancel（高风险）、investigate（中风险）、accept（低风险）

  * `cause_cancel`

    boolean

    取消订单标识, true-取消, false-不取消

  * `display`

    boolean

    是否在详情页展示标识, true-展示, false-不展示

  * `score`

    string

    欺诈风险得分，0-1，1为风险最高的得分

  * `risk_detail_msg_list`

    array<object>

    欺诈风险详细信息节点

    * `message`

      string

      欺诈风险节点详细信息

    * `risk_detail_level`

      string

      欺诈风险节点详细信息等级: cancel（高风险）、investigate（中风险）、accept（低风险）

  * `source`

    string

    来源标识，Internal-内部、External-外部

  * `order_id`

    string

    订单序列号


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "更新订单下指定的风险欺诈",
  "externalDocs": {
    "description": "接口使用的权限点: `write_orders` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "Cijz1xYx",
  "parameters": [
    {
      "name": "order_id",
      "in": "path",
      "description": "订单号",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "order_id",
        "description": "订单号",
        "type": "string",
        "example": "\"21056863763067384710591058\""
      },
      "example": "\"21056863763067384710591058\""
    },
    {
      "name": "risk_id",
      "in": "path",
      "description": "欺诈风险id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "risk_id",
        "description": "欺诈风险id",
        "type": "string",
        "example": "\"2905687834858288060687\""
      },
      "example": "\"2905687834858288060687\""
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": "资源的访问令牌。请参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "risk": {
              "name": "risk",
              "description": "订单风险信息",
              "type": "object",
              "properties": {
                "score": {
                  "name": "score",
                  "description": "欺诈风险得分，0.0-1.0，1为风险最高的得分",
                  "type": "string",
                  "example": "0.9"
                },
                "source": {
                  "name": "source",
                  "description": "来源标识，固定为：External-外部",
                  "type": "string",
                  "example": "External"
                },
                "cause_cancel": {
                  "name": "cause_cancel",
                  "description": "取消订单标识, true-取消, false-不取消",
                  "type": "boolean",
                  "example": true
                },
                "display": {
                  "name": "display",
                  "description": "是否在详情页展示标识, true-展示, false-不展示",
                  "type": "boolean",
                  "example": true
                },
                "recommendation": {
                  "name": "recommendation",
                  "description": "欺诈风险等级: cancel（高风险）、investigate（中风险）、accept（低风险）",
                  "type": "string",
                  "example": "cancel"
                },
                "risk_detail_msg_list": {
                  "name": "risk_detail_msg_list",
                  "description": "欺诈风险详细信息节点",
                  "type": "array",
                  "items": {
                    "name": "risk_detail_msg_list",
                    "description": "欺诈风险详细信息节点",
                    "type": "object",
                    "properties": {
                      "risk_detail_level": {
                        "name": "risk_detail_level",
                        "description": "欺诈风险节点详细信息等级: cancel（高风险）、investigate（中风险）、accept（低风险）",
                        "type": "string",
                        "example": "cancel"
                      },
                      "message": {
                        "name": "message",
                        "description": "欺诈风险节点详细信息",
                        "type": "string",
                        "example": "risk detail message"
                      }
                    },
                    "required": [
                      "message",
                      "risk_detail_level"
                    ],
                    "example": {
                      "message": "risk detail message",
                      "risk_detail_level": "cancel"
                    }
                  },
                  "example": [
                    {
                      "message": "risk detail message",
                      "risk_detail_level": "cancel"
                    }
                  ]
                }
              },
              "example": {
                "source": "External",
                "cause_cancel": true,
                "display": true,
                "recommendation": "cancel",
                "risk_detail_msg_list": [
                  {
                    "message": "risk detail message",
                    "risk_detail_level": "cancel"
                  }
                ],
                "score": "0.9"
              }
            }
          },
          "required": [
            "risk"
          ],
          "example": {
            "risk": {
              "source": "External",
              "cause_cancel": true,
              "display": true,
              "recommendation": "cancel",
              "risk_detail_msg_list": [
                {
                  "message": "risk detail message",
                  "risk_detail_level": "cancel"
                }
              ],
              "score": "0.9"
            }
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。",
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "risk": {
                "name": "risk",
                "description": "风险欺诈信息",
                "type": "object",
                "properties": {
                  "checkout_id": {
                    "name": "checkout_id",
                    "description": "订单关联的弃单ID",
                    "type": "string",
                    "example": "\"2405664692071577423882\""
                  },
                  "id": {
                    "name": "id",
                    "description": "欺诈风险ID",
                    "type": "string",
                    "example": "\"2905664692071577423886\""
                  },
                  "recommendation": {
                    "name": "recommendation",
                    "description": "欺诈风险等级: cancel（高风险）、investigate（中风险）、accept（低风险）",
                    "type": "string",
                    "example": "\"cancel\""
                  },
                  "cause_cancel": {
                    "name": "cause_cancel",
                    "description": "取消订单标识, true-取消, false-不取消",
                    "type": "boolean",
                    "example": true
                  },
                  "display": {
                    "name": "display",
                    "description": "是否在详情页展示标识, true-展示, false-不展示",
                    "type": "boolean",
                    "example": true
                  },
                  "score": {
                    "name": "score",
                    "description": "欺诈风险得分，0-1，1为风险最高的得分",
                    "type": "string",
                    "example": "\"1.0\""
                  },
                  "risk_detail_msg_list": {
                    "name": "risk_detail_msg_list",
                    "description": "欺诈风险详细信息节点",
                    "type": "array",
                    "items": {
                      "name": "risk_detail_msg_list",
                      "description": "欺诈风险详细信息节点",
                      "type": "object",
                      "properties": {
                        "message": {
                          "name": "message",
                          "description": "欺诈风险节点详细信息",
                          "type": "string",
                          "example": "\"risk detail message\""
                        },
                        "risk_detail_level": {
                          "name": "risk_detail_level",
                          "description": "欺诈风险节点详细信息等级: cancel（高风险）、investigate（中风险）、accept（低风险）",
                          "type": "string",
                          "example": "cancel"
                        }
                      },
                      "example": {
                        "message": "\"risk detail message\"",
                        "risk_detail_level": "cancel"
                      }
                    },
                    "example": [
                      {
                        "message": "\"risk detail message\"",
                        "risk_detail_level": "cancel"
                      }
                    ]
                  },
                  "source": {
                    "name": "source",
                    "description": "来源标识，Internal-内部、External-外部",
                    "type": "string",
                    "example": "\"External\""
                  },
                  "order_id": {
                    "name": "order_id",
                    "description": "订单序列号",
                    "type": "string",
                    "example": "\"21056646934598417162363882\""
                  }
                },
                "example": {
                  "score": "\"1.0\"",
                  "checkout_id": "\"2405664692071577423882\"",
                  "recommendation": "\"cancel\"",
                  "source": "\"External\"",
                  "order_id": "\"21056646934598417162363882\"",
                  "cause_cancel": true,
                  "display": true,
                  "id": "\"2905664692071577423886\"",
                  "risk_detail_msg_list": [
                    {
                      "risk_detail_level": "cancel",
                      "message": "\"risk detail message\""
                    }
                  ]
                }
              }
            },
            "example": {
              "risk": {
                "source": "\"External\"",
                "recommendation": "\"cancel\"",
                "cause_cancel": true,
                "display": true,
                "order_id": "\"21056646934598417162363882\"",
                "score": "\"1.0\"",
                "risk_detail_msg_list": [
                  {
                    "message": "\"risk detail message\"",
                    "risk_detail_level": "cancel"
                  }
                ],
                "checkout_id": "\"2405664692071577423882\"",
                "id": "\"2905664692071577423886\""
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "put",
  "path": "/orders/v2/:order_id/risks/:risk_id.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "更新订单风险欺诈",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_orders"
  ]
}
```