We have an in-house app that uses the Shopify API.
We use it to fulfil orders.
Lately, when we try to fulfil an order, we get an error response:
403 Forbidden
For every order, we get this response 4-5 times, and then it works!
Successful fulfilment
During a successful fulfilment, there are these calls:
- GET /admin/api/2023-04/locations.json
- GET /admin/api/2023-04/orders/xxxxxxxxxxxxx/fulfillment_orders.json
- POST /admin/api/2023-04/fulfillments.json
A successful fulfilment also contains the header response:
X-Shopify-Stage: production
Unsuccessful fulfilment
An unsuccessful fulfilment only has the first call:
- GET /admin/api/2023-04/locations.json
This call is successful, but during the next one, get the above ‘403 Forbidden’ error message
However the header response is different:
X-Shopify-Stage: canary
Observations
We can infer that the problem may be when Shopify returns a response from
X-Shopify-Stage: canary
instead of
X-Shopify-Stage: production
then the subsequent call fails.
We can also infer that the problem occurs in the call to
GET /admin/api/2023-04/orders/xxxxxxxxxxxxx/fulfillment_orders.json

