Personalized checkout and custom promotions with Shopify Scripts
I am trying to migrate from the REST API over to the GraphQL. We are running everything on a Oracle server using UTL_HTTP. I need to update a status to Archived for duplicate products. Currently I just keep getting the following error and have rebuilt the payload every way we can think of. If anyone can see anything that might help, please let us know, and thanks in advance.
{"errors":{"query":"Required parameter missing or invalid"}}
The package (for the most part) is below:
G_URL := 'https://############.myshopify.com/admin/api/2025-04/graphql.json'; G_TOKEN := '######################################';
P_PRODUCT_ID := '###############'; G_PAYLOAD := '{' || '"query": "mutation ProductUpdate($input: ProductInput!) { productUpdate(input: $input) { product { id status } userErrors { field message } } }",' || '"variables":{' || '"input":{' || '"id":"gid://shopify/Product/' || P_PRODUCT_ID || '",' || '"status":"ARCHIVED"' || '}' || '}' || '}'; G_REQ := UTL_HTTP.begin_request( url => G_URL, method => 'POST', http_version => 'HTTP/1.1' ); UTL_HTTP.set_header(G_REQ, 'Content-Type', 'application/json'); UTL_HTTP.set_header(G_REQ, 'X-Shopify-Access-Token', G_TOKEN);
UTL_HTTP.write_text(G_REQ, G_PAYLOAD);
G_RESP := UTL_HTTP.GET_RESPONSE(G_REQ);
Thanks
Solved! Go to the solution
This is an accepted solution.
well found the issue, have to send a content length header. Added the following to the set_header stack and it works:
UTL_HTTP.set_header(G_REQ, 'Content-Length', TO_CHAR(DBMS_LOB.GETLENGTH(G_PAYLOAD)));
This is an accepted solution.
well found the issue, have to send a content length header. Added the following to the set_header stack and it works:
UTL_HTTP.set_header(G_REQ, 'Content-Length', TO_CHAR(DBMS_LOB.GETLENGTH(G_PAYLOAD)));
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025