Hello,
We are importing products from shopify to an ERP.
I am facing this issue while importing products from shopify using API.
With my other account I am not facing this error. Also when I paste this URL in my browser it will load json data but with GET API it is not working.
https://demo.myshopify.com/admin/products.json?limit=50&since_id=0&order=created_at+asc
Any suggestion will be helpful.
My shopify version for both the account is : 2020-01
Thanks,
Hey @poojaz
Can you grab the request id response header from the call that isn't working as expected?
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
Hello,
Please see GET request below. This is working with our existing shopify plus(created long ago) account and raising error with newly created shopify test account. Both accounts shopify version is same.
https://bista-demo.myshopify.com/admin/products.json?limit=50&since_id=0&order=created_at+asc
response we get:
Response(code=400, body="b'{"errors":{"order":"order cannot be passed when since_id is present."}}'", headers={'Date': 'Thu, 20 Aug 2020 07:16:22 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'Set-Cookie': '__cfduid=d3ddaab2d2f64a0102f17dedebca729901597907782; expires=Sat, 19-Sep-20 07:16:22 GMT; path=/; domain=.myshopify.com; HttpOnly; SameSite=Lax', 'X-Sorting-Hat-PodId': '157', 'X-Sorting-Hat-ShopId': '46430060702', 'Referrer-Policy': 'origin-when-cross-origin', 'X-Frame-Options': 'DENY', 'X-ShopId': '46430060702', 'X-ShardId': '157', 'X-Stats-UserId': '', 'X-Stats-ApiClientId': '4237139', 'X-Stats-ApiPermissionId': '275633799326', 'X-Shopify-API-Terms': 'By accessing or using the Shopify API you agree to the Shopify API License and Terms of Use at https://www.shopify.com/legal/api-terms', 'HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT': '1/40', 'X-Shopify-Shop-Api-Call-Limit': '1/40', 'X-Shopify-API-Version': '2019-10', '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.us.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=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Forders&source%5Bsection%5D=admin_api&source%5Buuid%5D=d8d13588-4f3c-45c9-9fa4-ff10a48ea93c", '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=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Forders&source%5Bsection%5D=admin_api&source%5Buuid%5D=d8d13588-4f3c-45c9-9fa4-ff10a48ea93c', 'X-Dc': 'gcp-us-central1,gcp-us-east1,gcp-us-east1', 'X-Request-ID': 'd8d13588-4f3c-45c9-9fa4-ff10a48ea93c', 'CF-Cache-Status': 'DYNAMIC', 'cf-request-id': '04ac52e3710000aae6d6875200000001', 'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Server': 'cloudflare', 'CF-RAY': '5c5a5418b84baae6-MAA', 'alt-svc': 'h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400'}, msg="Bad Request")
If I paste same link browser it will fetch data and display. PFA screenshot
Thanks,
Hey @poojaz
This seems to work fine if you paste it in your browser when you are authenticated into a Shopify admin, however, when doing it via API call it throws the error each time. Took a look at our REST documentation, and it doesn't look like the "order" parameter is valid for the product endpoint.
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
User | Count |
---|---|
13 | |
12 | |
8 | |
6 | |
4 |