Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Re: Testing fraud analysis is broken

Solved

Testing fraud analysis is broken

SSebastjan
Shopify Partner
5 0 2

Hi everyone,

is someone able to get the mocked High Risk order to reflect correctly though GraphQL API?

 

I read https://help.shopify.com/en/manual/orders/fraud-analysis and created a test order with shopify.test.high@shopify.com to get "HIGH" risk Order. It displays "HIGH" risk through Admin admin interface just fine.

Screenshot 2023-01-17 at 14.43.54.png
But I have an issue when trying to fetch the same order's "riskLevel" through GraphQL API:

query($id: ID!) {
     order(id: $id) {
       riskLevel
    }
}
{"data":{"order":{"riskLevel":"LOW"}}

Querying the same resource though Admin REST API also appears to work correctly:

https://xxxx.myshopify.com/admin/orders/xxxxx/risks.json

I get 

{"risks":[{"id":xxxx,"order_id":xxxx,"checkout_id":xxxx,"source":"Internal","score":"1.0","recommendation":"cancel","display":true,"cause_cancel":null,"message":"Shopify recommendation","merchant_message":"Shopify recommendation"}]}

"recommendation":"cancel" correctly. 


I cross referenced a production order with an actual "HIGH" risk and the status is correctly returned by GraphQL - Something is definitely broken when retrieving a mocked test order with GraphQL API.

Accepted Solution (1)
KB77
Shopify Staff
59 6 11

This is an accepted solution.

Hi @SSebastjan , just to update this. The risk level should be fixed in the API now going forward. Thanks again for taking the time and reaching out to us. 

KB77 | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 3 (3)

ShopifyDevSup
Shopify Staff
1453 239 535

Hi @SSebastjan, We were able to replicate this in our tests and have raised the issue with the relevant developer team. Thank you for taking the time to bring this to our attention we hope this can be resolved shortly. Thanks again. 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ShopifyDevSup
Shopify Staff
1453 239 535

(deleted)

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

KB77
Shopify Staff
59 6 11

This is an accepted solution.

Hi @SSebastjan , just to update this. The risk level should be fixed in the API now going forward. Thanks again for taking the time and reaching out to us. 

KB77 | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog