Edit in GitHubLog an issue

finishUpload mutation

The finishUpload mutation completes the file upload process initiated by the initiateUpload mutation. The finishUpload mutation requires the unique key generated during the initiation step as an input parameter. This key identifies the file that was uploaded to the Amazon S3 bucket.

When you call this mutation, Commerce verifies that the file associated with the provided key has been successfully uploaded to the S3 bucket. If the upload is confirmed, Commerce finalizes the upload process and makes the file available for use within the system. The response from the finishUpload mutation includes the unique key for the uploaded file. Use this key to reference the file in subsequent operations, such as associating it with a customer file or image attribute.

Syntax

Copied to your clipboard
mutation {
finishUpload(input: finishUploadInput!): finishUploadOutput
}

Example usage

The following examples show how to finalize an upload for different types of files.

Finalize an upload for a customer attribute file

The following mutation finalize an upload for a file with a key value of cat_106d42b2ee34de81db31d958.jpg.

Request:

Copied to your clipboard
mutation Finish($input: finishUploadInput!) {
finishUpload(input: $input) {
success
key
message
}
}

The $input variable contains:

Copied to your clipboard
{
"input": {
"key": "cat_106d42b2ee34de81db31d958.jpg",
"media_resource_type": "CUSTOMER_ATTRIBUTE_FILE"
}
}

Response:

Copied to your clipboard
{
"data": {
"finishUpload": {
"success": true,
"key": "cat_106d42b2ee34de81db31d958.jpg",
"message": "Upload completed successfully."
}
}
}

Finalize an upload for a negotiable quote attachment

The following mutation finalizes an upload for a file with a key value of test-document1_32cb1fe50dab390be841461e.txt.

Request:

Copied to your clipboard
mutation {
finishUpload(input: {
key: "test-document1_32cb1fe50dab390be841461e.txt",
media_resource_type: "NEGOTIABLE_QUOTE_ATTACHMENT"
}) {
success
key
message
}
}

Response:

Copied to your clipboard
{
"data": {
"finishUploadOutput": {
"success": true,
"key": "test-document1_32cb1fe50dab390be841461e.txt",
"message": "File upload confirmed successfully."
}
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.