Primary domain/DNS change causing issues with API get request.

Shopify Partner
7 0 0

We recently made our store live and updated the Primary Domain/DNS. 

 

The store has different URL's for the front end and the back end. One being store.co.nz and the other being mystore-development.myshopify.com

 

We have an API request getting data from that store which posts it to our ERP. It was working fine and getting order and customer data. That was right up until we updated the DNS for the store and updated the store front URL to the store.co.nz domain.

 

When the primary domain for the store was changed, the GET request stopped returning the orders array with data in it and started simply returning an empty Array. 

 

That get request is -  https://my-store.myshopify.com/admin/api/2019-10/orders.xml?created_at_min=2020-04-20T06:26:45+12:00

 

Has anyone run into the issue where The APIs (Customer and Order) stop responding the way they should after the primary domain for a store has been changed? 

 

 

0 Likes
Highlighted
Excursionist
14 0 0

May I know where is your server located? Seems this is related to https://community.shopify.com/c/Shopify-APIs-SDKs/API-Connection-Timed-Out/m-p/712349#M47959

0 Likes
Highlighted
Shopify Partner
7 0 0

I am not sure it is the same issue as we are still getting a response from the call, it is just empty now. 

 

Response.PNG

 

I am wondering if there is a correlation between the change in domains from the shopify managed domain to a new primary domain for the store. But can't really understand why that may be. Perhaps it is a coincidence. 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
619 76 139

Hey @Daomon_Kelly,

 

Any changes to the online store domain won't affect API responses, as someone else mentioned the timing of that change is most likely a coincidence.

 

In order to investigate further, can you kindly provide the X-Request-ID from the response headers of your call? I will use this to check our logs and hopefully spot why you're getting an empty response.

 

As well, for troubleshooting purposes can you try making the same call to the JSON endpoint instead of XML, and let me know if you get the expected response? You can use an HTTP client like [Insomnia](https://insomnia.rest/) or [Postman](https://www.postman.com/) to make the call.

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

1 Like
Highlighted
Shopify Partner
7 0 0

Thanks @_JB

 

I have been using Postman - awesome tool :)

 

So when making the request with a JSON end point we get the same issue, where the call doesn't hit any errors and we are we are returned an empty array.

 

Upon inspection, each new call creates a new X-Request-ID so here are two, one for a request that got a response and one that didn't. But please let me know if I have given you the correct information here.

 

An X-Request-ID For a successful request: 08abd8af-07f0-41d1-bbeb-37cb3a4e3b98

An X-Request-ID for a failed request: 54b80040-84bb-4119-a805-51802ae44272

 

Really appreciate you taking the time to look into this issue further for us :)

0 Likes
Highlighted
Shopify Partner
7 0 0

Hey @_JB 

 

It looks like this might have solved its self. Can we keep this thread open for the next 48 hours and if we don't see this happen again then I will go ahead and close it.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
619 76 139

Hey @Daomon_Kelly,

 

I think I've spotted the issue. I checked those 2 request_ids you provided, and on both of them the timestamp used was invalid:

 

/admin/api/2019-10/orders.xml?created_at_min=2020-04-20T010:36:45+12:00

You can see there's an extra 0 in the hour position.

 

Also wanted to point out the request doesn't include the status=any parameter, so the response is expected to include only open (non-archived) orders. You were retrieving orders from the current day so they were likely open anyways, but just wanted to mention for anyone else reading along.

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

0 Likes
Highlighted
Shopify Partner
7 0 0

Hey @_JB 

 

You are correct, I was using postman and playing with that field so that time stamp I gave was incorrect. Here is a request ID with a correct timestamp from a real time request we made only a few moments ago that still returned an empty array : 76564938-0e75-45c0-8d27-6c13d0087b9a

 

Also roger roger re adding &status=any, will discuss with devs why we may not be using that in this instance. 

 

Do you think you could have a look at that response request_id and let me know your thoughts? 

 

Interestingly, we seem to be noticing that consistently we do not get a response from any requests we make roughly 13 hours behind  the current time. 

 

So for example if I make a request at 4pm New Zealand time, I can only see requests from 1.00am.

 

I would be very keen to provide more data on the issue to get more help, but would be keen to offer that information in a private setting. Is there any way we can do that?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
619 76 139

Hi @Daomon_Kelly,

 

Thanks for those details, I've spotted the issue. It looks like we're not handling the + properly in the URL, so the timestamp is being stripped from the request. I'll raise this with our developers so they can begin to investigate a fix.

 

In the meantime, I've confirmed that replacing the + symbol with the URL encoded version %2B will allow your query to complete as expected (eg. /admin/customers.xml?created_at_min=2020-04-22T10:17:26%2B12:00)

 

As soon as I have an update on a fix I'll post back here to let you know, please don't hesitate to reach out if there are any questions in the meantime.

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

1 Like