Posting multiple risks in one time

asokolov
Shopify Partner
1 0 0

Hello!

Is it possible to post many risk objects in one call? 

Do you have any plans to add such behavior If it isn't?

 

PS The most curious thing is that API endpoint looks like

POST /admin/api/2019-10/orders/#{order_id}/risks.json

but currently it returns an error if I'm trying to send an array.

0 Likes
_JB
Shopify Staff
Shopify Staff
822 97 178

Hey @asokolov,

 

Sending multiple order_risks in a single API call isn't currently supported. It's possible for an order to return multiple risks from the risks.json endpoint (which is why the resource name is pluralized), but only 1 risk can be created/updated per API POST/PUT. If you have a use-case that requires creating multiple order risks at once, kindly explain that in more detail. This will help me make a recommendation for other potential options you can use, or I can pass along feedback about your use-case to our developers if this sounds like something other merchants could take advantage of as well.

JB | Developer 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

0 Likes
JoesIdeas
Shopify Expert
1244 111 310

@_JB  do you have any examples where an order would have multiple risks?

I couldn't find any information about this in the docs, and in my tests all the orders returned only 1 risk.

Founder of Speed Boostr (Shopify optimization experts, theme customization, custom app development).
Creator of Shopify Analyzer (first performance analysis tool for Shopify sites, free for the Shopify community).
Creator of Order Automator (auto tag orders and customers + auto fulfillment + more automations).
More apps: Theme Scientist (A/B testing), Tip Jar (add a tip button), File Optimizer (optimize CSS, JS, Liquid).
0 Likes