App reviews, troubleshooting, and recommendations
Hi everyone!
I'm setting up a Shopify store to sell software online. The purchased software comes with an activation key/license.
Upon order payment, a Shopify webhook is sent to an AWS Lambda that takes care of:
I’m doing some tests to implement point 3 by simply trying to upload a local file to Shopify using the GraphQL API, but I’m having some issues.
To upload the file I’m using 2 calls to the GraphQL Admin API:
Both calls go through correctly and I don’t get any error message in my python script, however, if I keep checked the file page in the Shopify Admin, the file seems to take forever to upload (it’s a 750 bytes xml…), as advised by a pop-up I get in the bottom right corner of the screen, and then the upload promptly fails with a very generic “FileName.xml Processing error” message, with the pop-up replacing the previous one
Any idea of what’s going on?
The following are the specific mutations I’m calling:
mutation stagedUploadsCreate($input: [StagedUploadInput!]!) {
stagedUploadsCreate(input: $input) {
stagedTargets {
url
resourceUrl
parameters {
name
value
}
}
userErrors {
field
message
}
}
}
variables = {
"input":
{
"filename": "Prova.xml",
"fileSize": "1000",
"httpMethod": "POST",
"mimeType": "application/xml",
"resource": "FILE"
}
}
mutation fileCreate($files: [FileCreateInput!]!) {
fileCreate(files: $files) {
files {
alt
createdAt
}
userErrors {
field
message
}
}
}
variables = {
"files": [
{
"alt": "License file",
"contentType": "FILE",
"originalSource": resource_url
}
]
}
With resource_url extracted by the response from the first mutation.
Thanks!
Learn 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, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025