Hi there,
I’m performing a bulk credit for a list of customers using the following doc: https://shopify.dev/docs/api/usage/bulk-operations/imports#upload-the-file-to-shopify
However, when running the same file with around 400+ rows, my test store works fine and completes in about 3 minutes, while our client’s store keeps encountering the following issue:
POST https://shopify-staged-uploads.storage.googleapis.com/ resulted in a 400 Bad Request response:
<?xml version='1.0' encoding='UTF-8'?>
<Error>
<Code>EntityTooSmall</Code>
<Message>Your proposed upload is smaller than th (truncated...)
</Error>
Has anyone run into this issue before?
Thanks in advance 
1 Like
Hi @Ph_m_Th_Thu_Ha,
This EntityTooSmall error is actually coming from Google Cloud Storage when trying to upload the JSONL file directly.
This error indicates the object body that actually arrived from the request was smaller than the policy’s minimum, and in practice means that the file size that was sent was 0 bytes, as the policy has "content-length-range",1,20971520 indicating the multipart form body sent needs to be between 1 and 20971520 bytes (20mb).
This can be confirmed by using Base64 to decode the policy string that is provided in response of the stagedUploadsCreate mutation.
Moving forward, to resolve this error I recommend checking for the following:
-
Ensure the JSONL file isn’t empty and is <= 20 MB.
-
Ensure you are building the multipart/form-data POST with:
- All of the values returned from
stagedUploadsCreate, unmodified, as the parameters in the form-data request.
- The
file parameter must be the last in the list.
- The
Content-Type parameter must be the exact value text/jsonl.
-
Don’t reuse stagedUploadsCreate params across shops or after they expire—create them on the client’s store right before upload.
-
If using Node/axios or fetch + form-data:
- Append params first, file last.
- Let the library set the multipart boundary header.
- Set Content-Length for the whole multipart body (avoid chunked uploads).
-
Sanity test with curl or a third party API client like Postman or Insomnia, using the client store’s stagedUploadsCreate response. If the call made with CURL or a 3rd party API client works, then the issue likely lies in the code you are using to build the form-data.
If this doesn’t help resolve the issue further, we can help look into it with more detail if you reach out to our Shopify Support Team via the Shopify Help Center.
If you do reach out to our Support Team, please be sure to have ready the full HTTP details from both the stagedUploadsCreate mutation, and the actual staged upload request, with all of the following details for both:
- The full plain text HTTP Request, including URL, Body, and Headers (no access tokens)
- The full plain text HTTP Response, including Body and Headers
1 Like
Thank you @Kellan-Shopify for sharing information about Store Credit.
You’re very welcome, I’m happy to help!