Posting fraud risk via api doesn't return correct response

Highlighted
Shopify Partner
5 0 0

Hi there,

We're attempting to test the fraud risk functionality in shopify. To do this, we raise an order on Shopify, then I GET the orders through the API, find the ID of the order, then use the POST fraud risk endpoint to add a risk manually. We then use our application's import process to test our code.
However, for some reason, when trying to do the POST request, instead of an actual response, I just get redirected to a login page. This seems incorrect. For reference, the expected response is thus:

HTTP/1.1 201 Created
{
"risk": {
"id": 700140151,
"order_id": 450789469,
"checkout_id": 901414060,
"source": "External",
"score": "1.0",
"recommendation": "cancel",
"display": true,
"cause_cancel": true,
"message": "This order came from an anonymous proxy",
"merchant_message": "This order came from an anonymous proxy"
}
}

The request is as such:

{
"risk": {
"message": "This order came from an anonymous proxy",
"recommendation": "cancel",
"score": 1.0,
"source": "External",
"cause_cancel": true,
"display": true
}
}


and the auth details etc are the same as on the GET so should be functional.
Is this a known issue?
Thanks.

0 Likes
Shopify Expert
9981 85 1492

How are you doing the POST - as in from what system/stack.


I'd assume you're doing this via the browser (which is a little worrying in itself) so you will be sending cookies in the request. POSTs with cookies will be rejected for security so would explain that error.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Shopify Partner
5 0 0

This is from Insomnia, sorry for being unclear.

image.png

0 Likes
Shopify Partner
5 0 0

Bump, this is still happening and is preventing us from testing a fix

0 Likes