Not able to edit order

identix
Excursionist
20 0 1

Hello,

 

When I am trying to edit the existing order then getting a null response in beginEdit from Shopify.
order_edit_begin call:

query => '
	mutation	beginEdit{
		orderEditBegin(id:"gid://shopify/Order/ORDER_ID"){
			calculatedOrder{
					id
			}
	}
}'

 API response:

Array
(
    [headers] => Array
        (
            [status] => HTTP/2 200 
            [date] => Wed, 14 Apr 2021 05:20:48 GMT
            [content-type] => application/json; charset=utf-8
            [x-sorting-hat-podid] => 180
            [x-sorting-hat-shopid] => 55959519413
            [vary] => Accept-Encoding
            [referrer-policy] => origin-when-cross-origin
            [x-frame-options] => DENY
            [x-shopid] => 55959519413
            [x-shardid] => 180
            [x-stats-userid] => 
            [x-stats-apiclientid] => 2441839
            [x-stats-apipermissionid] => 314596851893
            [x-shopify-api-version] => 2021-01
            [content-language] => en
            [strict-transport-security] => max-age=7889238
            [x-shopify-stage] => production
            [content-security-policy] => default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://js-agent.newrelic.com https://bam.nr-data.net https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f52b5669-01e2-4ac7-a31a-c4bd16f70a03
            [x-content-type-options] => nosniff
            [x-download-options] => noopen
            [x-permitted-cross-domain-policies] => none
            [x-xss-protection] => 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f52b5669-01e2-4ac7-a31a-c4bd16f70a03
            [x-dc] => gcp-asia-southeast1,gcp-us-central1,gcp-us-central1
            [nel] => {"report_to":"network-errors","max_age":2592000,"success_fraction":0.0001}
            [report-to] => {"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifysvc.com/v1/reports/nel/20190325/shopify"}]}
            [x-request-id] => f52b5669-01e2-4ac7-a31a-c4bd16f70a03
            [set-cookie] => _shopify_fs=2021-04-14T05%3A20%3A48Z; Expires=Thu, 14-Apr-22 05:20:48 GMT; Domain=popitfidgettoy1.myshopify.com; Path=/; SameSite=Lax
            [cf-cache-status] => DYNAMIC
            [cf-request-id] => 09706c408e00007351c3b83000000001
            [expect-ct] => max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
            [server] => cloudflare
            [cf-ray] => 63fa7cadba277351-BOM
            [alt-svc] => h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
        )

    [response] => {"data":{"orderEditBegin":{"calculatedOrder":null}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":990,"restoreRate":50.0}}}}
)

 

I have tested the same code in multiple stores but it's not working for one specific store. Can please explain to me what is the issue here? What I'm doing wrong here? 

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
293 36 47

Hey @identix 

Are you seeing an x-request-id returned in the headers? If so can you provide that for us? Thanks.

Kevin_A | 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
identix
Excursionist
20 0 1

Thanks for reply,

It's also available in post.
f52b5669-01e2-4ac7-a31a-c4bd16f70a03

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
293 36 47

Hey @identix 

Can you try adding the userErrors field to make sure you aren't getting any errors returned? It would look something like this:

query => '
	mutation	beginEdit{
		orderEditBegin(id:"gid://shopify/Order/ORDER_ID"){
			calculatedOrder{
					id
			}
            userErrors {
                    field
                    message
            }
	}
}'

Kevin_A | 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
identix
Excursionist
20 0 1

Thanks for the reply,

Array
(
    [headers] => Array
        (
            [status] => HTTP/2 200 
            [date] => Sat, 17 Apr 2021 04:23:34 GMT
            [content-type] => application/json; charset=utf-8
            [x-sorting-hat-podid] => 180
            [x-sorting-hat-shopid] => 55959519413
            [vary] => Accept-Encoding
            [referrer-policy] => origin-when-cross-origin
            [x-frame-options] => DENY
            [x-shopid] => 55959519413
            [x-shardid] => 180
            [x-stats-userid] => 
            [x-stats-apiclientid] => 2441839
            [x-stats-apipermissionid] => 314596851893
            [x-shopify-api-version] => 2021-01
            [content-language] => en
            [strict-transport-security] => max-age=7889238
            [x-shopify-stage] => production
            [content-security-policy] => default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://js-agent.newrelic.com https://bam.nr-data.net https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=24ef9a59-d29f-49f5-881d-237d53519884
            [x-content-type-options] => nosniff
            [x-download-options] => noopen
            [x-permitted-cross-domain-policies] => none
            [x-xss-protection] => 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=24ef9a59-d29f-49f5-881d-237d53519884
            [x-dc] => gcp-asia-southeast1,gcp-us-central1,gcp-us-central1
            [nel] => {"report_to":"network-errors","max_age":2592000,"success_fraction":0.0001}
            [report-to] => {"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifysvc.com/v1/reports/nel/20190325/shopify"}]}
            [x-request-id] => 24ef9a59-d29f-49f5-881d-237d53519884
            [set-cookie] => _shopify_fs=2021-04-17T04%3A23%3A34Z; Expires=Sun, 17-Apr-22 04:23:34 GMT; Domain=popitfidgettoy1.myshopify.com; Path=/; SameSite=Lax
            [cf-cache-status] => DYNAMIC
            [cf-request-id] => 097faaec9b0000710ae600e000000001
            [expect-ct] => max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
            [server] => cloudflare
            [cf-ray] => 6412e0f42f91710a-BOM
            [alt-svc] => h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
        )
    [response] => {"data":{"orderEditBegin":{"calculatedOrder":null,"userErrors":[{"field":null,"message":"The order cannot be edited."}]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":990,"restoreRate":50.0}}}}
)

 

We are using the 2021-01 Shopify API version.

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
293 36 47

Hey @identix 

Looks like that gives us our answer:

"message":"The order cannot be edited."}

This doc provides some more details around possible reasons why orders cannot be edited: https://help.shopify.com/en/manual/orders/edit-orders#editing-orders-faq

Kevin_A | 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