I am working on a remote fraud checking system for my company. So far so good but I am at a point where I cant really find an answer for my problem.
If a user on my interface accepts an order I want to either change the risk score of an order to 0.0 or just delete the existing order risks so the order is not flagged anymore in shopify admin dashboard. I’ve tried already to delete the existing order risks created by Shopify itself, but it seems like my app is not authorized to do so.
Unfortunately, you cannot modify or delete an order risk created by another application or Shopify itself. This restriction is noted in the Shopify API documentation.
However, you can create a new order risk with a low risk score and a recommendation to “accept” the order. This way, your app will provide additional information to the merchant, indicating that the order has been reviewed and is legitimate. Here’s an example of how to create a new order risk with a low score using the REST API:
POST /admin/api/2023-04/orders/{order_id}/risks.json
{
"risk": {
"message": "After further review, this is a legitimate order",
"recommendation": "accept",
"score": 0.0,
"source": "External",
"cause_cancel": false,
"display": true
}
}
This new order risk will be visible to the merchant alongside the existing risks, and they can make a decision based on the information provided. Remember to replace {order_id} with the actual order ID in your API call.