Skip to content

Send a Return Message

About

The createCustomerReturnMessage mutation adds a customer message to the conversation thread of a return (RMA) request. The return must belong to the authenticated customer. The created message comes back flagged isAdmin: false.

Authentication

This mutation requires an authenticated customer — send the storefront key and a customer Bearer token. See the Authentication page.

Input Fields

FieldTypeRequiredDescription
returnIdInt!✅ YesId of the return to add the message to. Must belong to the authenticated customer.
messageString!✅ YesThe message text.

Possible Returns

FieldTypeDescription
customerReturnMessage._idInt!Numeric message id.
customerReturnMessage.rmaIdInt!Id of the return the message belongs to.
customerReturnMessage.messageString!The message text.
customerReturnMessage.isAdminBoolean!false — the message was sent by the customer.
customerReturnMessage.attachmentStringFile name as the customer uploaded it, or null when the message has no attachment.
customerReturnMessage.attachmentUrlStringPublic URL of the attachment, or null.
customerReturnMessage.createdAtDateTime!Message timestamp.

Attaching a File

A binary part cannot travel in a JSON GraphQL request, so a message that carries a file goes through the REST endpoint instead. Everything else is the same — the same fields, the same response, the same conversation thread:

bash
curl -X POST "https://your-store.com/api/shop/return-messages" \
  -H "X-STOREFRONT-KEY: pk_storefront_PvlE42nWGsKRVIf8bDlJngTPAdWAZbIy" \
  -H "Authorization: Bearer 438|aSV6JyFn299xuoR6wr5KKOodyIlMA26h0IgHiqLW" \
  -F "return_id=12" \
  -F "message=Photo of the broken zipper" \
  -F "file=@/home/john/Pictures/zipper.png"

One file per message, and any type the store accepts — a conversation attachment is not limited to the image types configured for return evidence. To send several files, post several messages. Read the thread back with customerReturnMessages as usual; attachment holds the name the customer uploaded and attachmentUrl the link to serve.

Released under the MIT License.