OrderRisk always returning empty

JoesIdeas
Shopify Expert
2230 203 593

This API recently stopped working: https://shopify.dev/api/admin-rest/2022-07/resources/order-risk#get-orders-order-id-risks

 

Orders that are high risk are having risk level returned [].

 

Actually in testing, all orders are now returning [] for OrderRisk, Shopify is not returning risk level even on orders that show high risk in the Shopify admin.

 

I've tried in both REST and GraphQL, using the lates 2022-07 (and other versions), and the shopify_api_ruby gem 11.1.0.

 

Here are the requests:

 

# REST
risks = ShopifyAPI::OrderRisk.all(order_id: order_id)
puts risks # []


# GraphQL
query = <<~GQL
  query($items_count: Int, $order: ID!) {
    order(id: $order) {
      risks {
        level
        message
      }
    }
  }
GQL

 

Has anyone experienced this or know how to fix it?

 

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks
Replies 2 (2)

remy727
Shopify Partner
40 2 22

@JoesIdeas have you figured out this? I am having the same issue.

Looking for a Shopify App developer? Please visit: https://github.com/remy727
JoesIdeas
Shopify Expert
2230 203 593

@remy727 ya we had to change the way API calls were made for certain calls (like order risks).

 

So instead of risks = ShopifyAPI::OrderRisk.all(order_id: order_id), we now do something like this:

 

 

client = ShopifyAPI::Clients::Rest::Admin.new(session: session)
risks = client.get(path: "/admin/api/2022-07/orders/#{order_id}/risks.json")

 

 

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks