Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Error 400 on POST https://:custom_domain/admin/api/2019-04/orders/:order_id/refunds/calculate.json

Solved

Error 400 on POST https://:custom_domain/admin/api/2019-04/orders/:order_id/refunds/calculate.json

AfterShip1
Tourist
10 1 0

We are developers helping multiple clients to integrate with POST /refunds/calculate endpoint.

 

For some users (not all users getting this problem), we are getting the following error when POST https://:custom_domain/admin/api/2019-04/orders/:order_id/refunds/calculate.json no matter we provide a correct request payload or not.

 

Sample request payload:

```

{
  "refund": {
    "shipping": {
      "full_refund": false
    }
  }
}

```

 

Response status Code: 400 Bad Request

Response payload:

```

{
  "errors": {
    "id": "expected String to be a id"
  }
}

```

 

image.png

 

We talked with Shopify supports, they said we should post here to ask for helps. Thanks.

Accepted Solution (1)
Alex
Shopify Staff
1561 81 343

This is an accepted solution.

In that case, it could be actually. I'll make sure to report this, but I can say for sure that we don't intend for you to be posting to the custom domain. Maybe we should affix this into documentation somewhere if we're not going to explicitly support it (or maybe we've changed our tune, and we'll fix this, and move forward supporting requests to custom domains).

 

Cheers and thanks for the info.

 

For now, assume that using custom domains is not supported.

Alex | 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 the Shopify Help Center or the Shopify Blog

View solution in original post

Replies 8 (8)

Alex
Shopify Staff
1561 81 343

Would you mind sharing an X-Request-Id response header after replicating again? That will help me see the event in our logs, and I'll be able to take a closer look at your specific case.

 

Cheers.

Alex | 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 the Shopify Help Center or the Shopify Blog

AfterShip1
Tourist
10 1 0
Thanks. Here it is. 
X-Request-Id → 9010e323-aa24-491e-988d-40187bf3dfec
AfterShip1
Tourist
10 1 0

Hi~ Any updates~ Thanks.

Alex
Shopify Staff
1561 81 343

Hey @AfterShip1.

 

Referencing my logs, it looks like you're actually making a GET request. Is this intended? As you probably know, it's supposed to be a POST request. It is a bit confusing because your screen shot is showing me a POST request, which is also how you describe it. Maybe try a different client if all seems as it should be on your end?

Alex | 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 the Shopify Help Center or the Shopify Blog

AfterShip1
Tourist
10 1 0

We are petty sure that we are doing POST request. But we just do a POST request again and provide a new request ID. Please help to check. Thanks.

As it is public forum, we think it is not a good idea to provide the myshopify custom domain & order number here. If they are useful for investigation, please provide us a way to send direct message to you~ Thanks.

 

X-Request-ID: 8ff7d0a5-a6ad-43e8-a9d0-e2fe8d352ee4

 

image.png

AfterShip1
Tourist
10 1 0

We found back myshopify domain of user to do the POST /calculate request, then it is working.

So it is a problem only affecting POST /calculate on custom domain.

Would it be a bug in Shopify side?

Alex
Shopify Staff
1561 81 343

This is an accepted solution.

In that case, it could be actually. I'll make sure to report this, but I can say for sure that we don't intend for you to be posting to the custom domain. Maybe we should affix this into documentation somewhere if we're not going to explicitly support it (or maybe we've changed our tune, and we'll fix this, and move forward supporting requests to custom domains).

 

Cheers and thanks for the info.

 

For now, assume that using custom domains is not supported.

Alex | 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 the Shopify Help Center or the Shopify Blog

maratK1
Shopify Partner
1 0 1

Hey Alex

I'm wondering if this issue has been fixed or if there are any workarounds here?