Internal error. Looks like something went wrong on our end while trying to Edit Existing Order

Highlighted
Tourist
25 0 3

{"errors":[{"message":"Internal error. Looks like something went wrong on our end.\nRequest ID: cedfe621-10a2-4ae9-ab46-2e71fba0ef1b (include this in support requests).","extensions":{"code":"INTERNAL_SERVER_ERROR","requestId":"cedfe621-10a2-4ae9-ab46-2e71fba0ef1b"}}]}

0 Likes
Highlighted
Tourist
25 0 3

Hello Sopify Experts/Support,

 

Can you guys please check this as soon as possible?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
491 97 88

Hi @Milind2 

 

Can you post the body and variables of your call? The error that it is throwing is nil can't be coerced into Float. Can you let me know if you are still able to replicate? I know we pushed some changes that touched a similar aspect of the API. 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
Highlighted
Tourist
25 0 3

Hello @vix ,

Thanks for your reply.
I am using following PHP code for adding variant to the existing Order.

$token = "xxxxxxxxxxxxxx-my-store-token";

$webhook_url = "https://curbside-delivery-edz.myshopify.com/admin/api/2020-01/graphql.json";

$id = 'gid://shopify/Order/2172480225325';
$variantId = 'gid://shopify/ProductVariant/34492584820781';
$quantity = 1;
$update = <<<'json'
mutation orderEditAddVariant($id: ID!, $variantId: ID!, $quantity: Int!) {
orderEditAddVariant(id: $id, variantId: $variantId, quantity: $quantity) {
calculatedLineItem {
id
}
calculatedOrder {
id
}
userErrors {
field
message
}
}
}
json;
$post_data = [];
$vars = [];
$vars = ['id' => $id, 'variantId' => $variantId, 'quantity' => $quantity];
$post_data['query'] = $update;
$post_data['variables'] = $vars;
$post_data = json_encode($post_data);
$cURLConnection = curl_init();
curl_setopt($cURLConnection, CURLOPT_URL, $webhook_url);
curl_setopt($cURLConnection, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURLConnection, CURLOPT_POST, 1);

curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'X-Shopify-Access-Token: '.$token
));

$resp = curl_exec($cURLConnection);
curl_close($cURLConnection);
echo $resp;
$jsonArrayResponse = json_decode($resp);
die("Graphql Test");

 

 

0 Likes
Highlighted
Tourist
25 0 3

Hello @vix ,

Can you please check this.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
491 97 88

Hi @Milind2 

Can you reproduce in GraphiQL or an API client such as Postman / Insomnia? That way it will be easier to see if the error lies in your code vs. the API. You will also need to be sure you are following the guide correctly: https://shopify.dev/tutorials/edit-an-existing-order-with-admin-api for example, the ID should be a CalculatedOrder ID. 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes