订单风险

订单风险显示已完成订单的欺诈检查的结果。它们显示在Shopify管理员的订单详细信息页面的欺诈分析部分中。

应用程序的欺诈分析显示了应用程序已完成的订单风险所产生的每条消息。它还显示了订单的总体风险水平,该风险水平由具有最严格建议的订单风险确定。在确定订单的风险级别时,Shopify仅考虑将display属性设置为的那些订单风险true

您可以如何处理订单风险

Shopify API使您可以使用“订单风险”资源执行以下操作。这些常规操作的更详细的版本可能可用:

订单风险属性

原因_取消 plain "cause_cancel": false 此订单风险是否严重到足以强制取消订单。如果为true,则此订单风险包含在已取消订单的详细信息页面上显示的“已取消订单”消息中。
注意:将此属性设置为true不会取消订单。仅当您的应用使用“订单”资源自动取消订单时,才使用此属性。如果您的应用不会根据订单风险自动取消订单,请将该属性设置为false
checkout_id plain "checkout_id": 901414060 订单风险所属的结帐ID。
展示 plain "display": true 是否在Shopify管理员的订单详细信息页面上显示订单风险。如果为false,则当Shopify确定应用程序订单的整体风险级别时,将忽略此订单风险。
创建订单风险后无法更改此属性。
ID plain "id": 284138680 订单风险的唯一数字标识符。
商人讯息 不推荐使用 plain "merchant_message": "This order came from an anonymous proxy." 显示给商家的消息,指示欺诈检查的结果。仅当display设置为时,才显示该消息true
使用message代替。
信息 plain "message": "This order came from an anonymous proxy." 显示给商家的消息,指示欺诈检查的结果。仅当display设置为时,才显示该消息true
order_id plain "order_id": 450789469 订单风险所属的订单的ID。
推荐 plain "recommendation": "cancel" 向商家推荐的操作。有效值:
+ 取消:此订单存在欺诈风险。商家应取消订单。
+ 调查:此订单存在欺诈风险。商家应调查订单。
+ 接受:此订单存在欺诈风险很小。订单风险未发现欺诈迹象。
分数 plain "score": 1.0 仅限内部使用。分配给订单的0到1之间的数字。分数越接近1,订单就越有欺诈性。
来源 plain "source": "External" 订单风险的来源。

Endpoints

POST/admin/api/2021-01/orders/{order_id}/risks.json Creates an order risk for an order

Create an order risk showing a fraud risk for proxy detection

POST /admin/api/2021-01/orders/450789469/risks.json

{

“risk”: {

  1. "message": "This order came from an anonymous proxy",
  2. "recommendation": "cancel",
  3. "score": 1.0,
  4. "source": "External",
  5. "cause_cancel": true,
  6. "display": true

}

}

View Response

GET/admin/api/2021-01/orders/{order_id}/risks.json Retrieves a list of all order risks for an order. Note: As of version 2019-10, this endpoint implements pagination by using links that are provided in the response header. Sending the <font style="background-color:#F4F6F8;">page</font> parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.

Retrieve all order risks for an order

GET /admin/api/2021-01/orders/450789469/risks.json

View Response

GET/admin/api/2021-01/orders/{order_id}/risks/{risk_id}.json Retrieves a single order risk by its ID

Retrieve a single order risk

GET /admin/api/2021-01/orders/450789469/risks/284138680.json

View Response

PUT/admin/api/2021-01/orders/{order_id}/risks/{risk_id}.json

Updates an order risk

Note

You cannot modify an order risk that was created by another application.

Update an existing order risk for an order

PUT /admin/api/2021-01/orders/450789469/risks/284138680.json

{

“risk”: {

"id": 284138680,

"message": "After further review, this is a legitimate order",

"recommendation": "accept",

"source": "External",

"cause_cancel": false,

"score": 0.0

}

}

View Response

DELETE/admin/api/2021-01/orders/{order_id}/risks/{risk_id}.json

Deletes an order risk for an order

Note

You cannot delete an order risk that was created by another application.

Delete an order risk for an order

DELETE /admin/api/2021-01/orders/450789469/risks/284138680.json

View Response