So I tried something new. I used the Shopify module to find an existing product. It does so successfully.
However, when I try to make changes and save the product, I’m getting an error code.
session = startShopifySession()
product = shopify.Product.find(9468056895783)
pprint(product.attributes)
endShopifySession()
{‘admin_graphql_api_id’: ‘gid://shopify/Product/9468056895783’,
‘body_html’: ‘’,
‘created_at’: ‘2024-07-19T12:12:00-04:00’,
‘handle’: ‘a’,
‘id’: 9468056895783,
‘image’: None,
‘images’: ,
‘options’: [option(11876717461799)],
‘product_type’: ‘’,
‘published_at’: None,
‘published_scope’: ‘web’,
‘status’: ‘draft’,
‘tags’: ‘’,
‘template_suffix’: ‘’,
‘title’: ‘a’,
‘updated_at’: ‘2024-07-19T12:28:26-04:00’,
‘variants’: [variant(48860058648871)],
‘vendor’: ‘Vendor’}
Process finished with exit code 0
Now when changing the product I get an error:
session = startShopifySession()
product = shopify.Product.find(9468056895783)
product.price = "9.99"
product.save()
pprint(product.attributes)
endShopifySession()
pyactiveresource.connection.Redirection: Response(code=301, body=“b’'”, headers={‘Date’: ‘Fri, 19 Jul 2024 18:39:19 GMT’, ‘Content-Type’: ‘text/html; charset=utf-8’, ‘Transfer-Encoding’: ‘chunked’, ‘Connection’: ‘close’, ‘X-Sorting-Hat-PodId’: ‘294’, ‘X-Sorting-Hat-ShopId’: ‘80191488295’, ‘referrer-policy’: ‘origin-when-cross-origin’, ‘x-frame-options’: ‘DENY’, ‘x-shopid’: ‘80191488295’, ‘x-shardid’: ‘294’, ‘location’: ‘https://711923-2.myshopify.com/admin/api/2022-07/products/9468056895783.json’, ‘strict-transport-security’: ‘max-age=7889238’, ‘set-cookie’: ‘request_method=PUT; path=/; SameSite=Lax’, ‘x-request-id’: ‘e8adfc04-1fbe-471e-b8c6-4ff2ba5c18b1-1721414359’, ‘server-timing’: ‘processing;dur=34, socket_queue;dur=3.042, edge;dur=2.045, util;dur=0.111, memcache;dur=6.135, redis;dur=0.0, db;dur=1.712, elasticsearch;dur=0.0, view;dur=0.0, externals;dur=7.847, graphql_lex;desc=“GraphQL Lexing”;dur=0.0, graphql_parse;desc=“GraphQL Parsing”;dur=0.0, graphql_execute;desc=“GraphQL Execution”;dur=0.0, graphql_analyze;desc=“GraphQL Analysis”;dur=0.0, graphql_validate;desc=“GraphQL Static Validation”;dur=0.0’, ‘server-timing-public’: ‘processing;dur=34’, ‘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://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 ‘self’ ‘unsafe-inline’ ‘unsafe-eval’; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=update&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=e8adfc04-1fbe-471e-b8c6-4ff2ba5c18b1-1721414359”, ‘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=update&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=e8adfc04-1fbe-471e-b8c6-4ff2ba5c18b1-1721414359’, ‘x-dc’: ‘gcp-us-east4,gcp-us-central1,gcp-us-central1’, ‘CF-Cache-Status’: ‘DYNAMIC’, ‘Report-To’: ‘{“endpoints”:[{“url”:“https:\/\/a.nel.cloudflare.com\/report\/v4?s=M5sw4C2u34o7gMg2tcbhAchfWcXCP0L0gTnCTh0oNkiz81%2FvFot8koSMcY%2FWrtxCSa5%2FMECPo3vKTaVGkOZp9bnD4RhnuOCmxNNIuxZf1s8N9qu3rrArnFbjgbiSu5q5Jx0vRn5KuKwytvC5K%2BU%3D”}],“group”:“cf-nel”,“max_age”:604800}’, ‘NEL’: ‘{“success_fraction”:0.01,“report_to”:“cf-nel”,“max_age”:604800}’, ‘Server-Timing’: ‘processing;dur=34, socket_queue;dur=3.042, edge;dur=2.045, util;dur=0.111, memcache;dur=6.135, redis;dur=0.0, db;dur=1.712, elasticsearch;dur=0.0, view;dur=0.0, externals;dur=7.847, graphql_lex;desc=“GraphQL Lexing”;dur=0.0, graphql_parse;desc=“GraphQL Parsing”;dur=0.0, graphql_execute;desc=“GraphQL Execution”;dur=0.0, graphql_analyze;desc=“GraphQL Analysis”;dur=0.0, graphql_validate;desc=“GraphQL Static Validation”;dur=0.0’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘8a5cd56108731438-PIT’, ‘alt-svc’: ‘h3=“:443”; ma=86400’}, msg=“Moved Permanently”)