requestGuestReturn mutation
This mutation is part of the Storefront Compatibility Package. It will be added to Adobe Commerce 2.4.8-beta2.
The requestGuestReturn
mutation initiates a guest buyer's request to return an item for replacement or refund.
A confirmation email is sent to the guest provided email address with a link to confirm the return request and continue the process.
The following queries illustrate how to retrieve the token and item ID values needed to run the requestGuestReturn
mutation:
- Retrieve details about an order placed by a guest or customer who is not logged in
- Retrieve detailed information about a specific guest order
Use the storeConfig
query with the returns_enabled
attribute to determine whether returned merchandise authorization (RMAs) are enabled.
Syntax
Copied to your clipboardmutation {requestGuestReturn(input: RequestGuestReturnInput!): RequestReturnOutput}
Example usage
The following example requests a product return from a guest customer. Note that the return status after this request is UNCONFIRMED
, as guest users need to confirm the return request as stated above.
Request:
Copied to your clipboardmutation{requestGuestReturn(input: {token: "0:3:E2uahokr8ud2uV3/z/7ELF0yQGDtT6vHUbLEGCpM3wUfouCNWf7ZGaMUYEhRKnrbGCq9l4zDbpO8JMPqfA=="contact_email: "test1@example.com"comment_text: "I want to return the shirt because I don't like the texture of the fabric"items: {order_item_uid: "MTE="quantity_to_return: 1}}){return {uiditems {uidstatusrequest_quantityquantityorder_item {ideligible_for_returnproduct_skuproduct_skuproduct_typequantity_returnedstatus}}numberstatuscomments {uidauthor_nametextcreated_at}customer {firstnamelastname}}}}
Response:
Copied to your clipboard{"data": {"requestGuestReturn": {"return": {"uid": "Mw==","items": [{"uid": "Mw==","status": "PENDING","request_quantity": 1,"quantity": 0,"order_item": {"id": "MTE=","eligible_for_return": true,"product_sku": "MS09-M-Red","product_type": "configurable","quantity_returned": 0,"status": "Shipped"}}],"number": "000000003","status": "UNCONFIRMED","comments": [{"uid": "Ng==","author_name": "Bob Loblaw","text": "I want to return the shirt because I don't like the texture of the fabric","created_at": "2020-11-19 18:20:28"}],"customer": {"firstname": "Bob","lastname": "Loblaw","email": "test1@example.com"}}}}}
Returns attributes
The Returns
object contains an array of Return
objects and pagination information.
Attribute | Data Type | Description |
---|---|---|
items | [Return] | A list of return requests |
page_info SearchResultPageInfo | Pagination metadata | |
total_count | Int | The total number of return requests |
Related topics
confirmReturn
mutationaddReturnComment
mutationaddReturnTracking
mutationremoveReturnTracking
mutation