Modules:Magenx_Rma (returns engine, admin, REST, email) and Magenx_RmaGraphQl (storefront API) · forked from the MIT-licensed mage-os/module-rma 2.4.1
Return Merchandise Authorization. Customers request returns from their account; guests do it with their order number and email. Staff approve and handle them in the admin, with a comment thread and file attachments on each return. With the Help Desk installed, the storefront’s EU withdrawal form works too.
RMA Requests: the grid of all returns. Add New RMA creates one for an order: choose the order, reason and resolution, then the items, quantities and condition.
On a return you can change its status, reason, resolution and admin notes, and talk to the customer in the Comments thread. Tick off Visible to Customer for an internal note. Files can be attached by drag and drop.
Statuses, Reasons, Resolution Types and Item Conditions are editable lists. Reasons, resolutions and conditions feed the storefront’s return form.
Increment ID Prefix rma/general/increment_id_prefix
RMA-
Website
Text. Prefix for the RMA increment ID (e.g. RMA-).
Return Period (Days) rma/general/return_period
30
Website
Text. Number of days after order completion within which a return can be requested.
Policy
Setting
Default
Scope
Notes
Auto-Approve Returns rma/policy/auto_approve
No
Website
Yes/No. If enabled, new RMA requests will be automatically approved.
Allowed Order Statuses rma/policy/allowed_order_statuses
complete
Website
Multiple select. Only orders with these statuses can have a return request.
Right of Withdrawal (EU)
RMAs opened from a consumer withdrawal declaration. These ignore the Return Period and Allowed Order Statuses above.
Setting
Default
Scope
Notes
Create RMAs from Withdrawals rma/withdrawal/enabled
No
Website
Yes/No. When a withdrawal is declared, create an RMA for shipped items and cancel orders that have not shipped yet. Needs Enable RMA as well. When off, declarations are only recorded in the helpdesk.
Withdrawal Period (Days) rma/withdrawal/period_days
14
Website
Text. Shown when Create RMAs from Withdrawals = Yes. Counted from the last shipment of the order. A later declaration is still accepted, but its RMA is flagged for staff review.
Text. Shown when Create RMAs from Withdrawals = Yes. Added to the shipment date to approximate when the customer received the goods, since Magento records dispatch, not delivery.
Yes/No. Shown when Create RMAs from Withdrawals = Yes. Withdrawal RMAs start as Approved (Yes) or New Request (No). A withdrawal is a legal right, so approval only confirms the return logistics. Late declarations always start as New Request.
Email Notifications
Setting
Default
Scope
Notes
Email Sender rma/email/sender_identity
General Contact
Store view
Dropdown.
New RMA Email Template (Customer) rma/email/customer_new_template
Module's default template
Store view
Dropdown. Email sent to the customer when a new RMA is created.
Status Change Email Template (Customer) rma/email/customer_status_change_template
Module's default template
Store view
Dropdown. Email sent to the customer when the RMA status changes.
New RMA Email Template (Admin) rma/email/admin_new_template
Module's default template
Store view
Dropdown. Email sent to the admin when a new RMA is created.
REST API: /V1/rma, with items, comments and the lookup lists as sub-resources. All endpoints need an admin integration token.
Events for your own modules: rma_created_after, rma_status_change_after, and one per status: rma_approved_after, rma_rejected_after, rma_shipped_by_customer_after, rma_received_after, rma_canceled_after, rma_resolved_after.
Customer operations need a customer token and check the order belongs to them. Guest operations are authenticated by order number and email. returnAttributesMetadata is public: guests create returns too. Protect submitWithdrawal with Turnstile at the storefront proxy.
Queries
customerReturns(pageSize: Int = 20, currentPage: Int = 1, sort: CustomerReturnsSortInput): CustomerReturnsOutput
List return requests for the logged-in customer. Never cached: the answer is private to the signed-in customer.
Argument
Type
Description
pageSize
Int = 20
currentPage
Int = 1
sort
CustomerReturnsSortInput
customerReturn(rma_id: Int!): CustomerReturn
Get a single return request by ID for the logged-in customer. Never cached: the answer is private to the signed-in customer.
Declare withdrawal from a purchase (EU right of withdrawal). Records the declaration as submitted and emails a confirmation; staff then identify the order and handle the return. Open to guests.
Argument
Type
Description
input
SubmitWithdrawalInput!
Types
type CustomerReturn
Field
Type
Description
rma_id
Int
The RMA entity ID.
increment_id
String
The RMA increment ID (e.g. RMA-000001).
order_number
String
The associated order increment ID.
status
ReturnLookupValue
The current RMA status.
reason
ReturnLookupValue
The return reason.
resolution_type
ReturnLookupValue
The preferred resolution type.
items
[ReturnItem]
The items included in this return.
comments
[ReturnComment]
Customer-visible comments.
created_at
String
Creation date.
updated_at
String
Last update date.
is_withdrawal
Boolean
True when the return was opened from a withdrawal declaration.
withdrawal_declared_at
String
When the withdrawal declaration was received (UTC), for withdrawal returns.
helpdesk_ticket_code
String
The support ticket that records the withdrawal declaration.
return_carrier
String
Carrier of the return shipment, once known.
return_tracking_number
String
Tracking number of the return shipment, once known.
type ReturnItem
Field
Type
Description
item_id
Int
The RMA item entity ID.
order_item_id
Int
The original order item ID.
product_name
String
The product name.
product_sku
String
The product SKU.
qty_requested
Int
Quantity requested for return.
qty_approved
Int
Quantity approved.
qty_returned
Int
Quantity returned.
condition
ReturnLookupValue
Item condition.
type ReturnComment
Field
Type
Description
comment_id
Int
The comment entity ID.
author_type
String
Author type: customer or admin.
author_name
String
Author display name.
comment
String
Comment text.
created_at
String
Comment creation date.
type ReturnLookupValue
Field
Type
Description
id
Int
Entity ID.
code
String
Unique code.
label
String
Store-localized label.
type ReturnAttributesMetadata - The selectable lookup values used when creating a return.
Field
Type
Description
reasons
[ReturnLookupValue]
Active return reasons, ordered by sort order.
resolution_types
[ReturnLookupValue]
Active resolution types, ordered by sort order.
conditions
[ReturnLookupValue]
Active item conditions, ordered by sort order.
input CustomerReturnsSortInput - Specifies which field to sort return requests on, and in which direction.
Field
Type
Description
sort_field
CustomerReturnsSortableField!
sort_direction
SortEnum!
enum CustomerReturnsSortableField - The fields a customer's return requests can be sorted on.
Value
Description
CREATED_AT
Sorts return requests by the date they were created.
RMA_ID
Sorts return requests by their RMA id.
type CustomerReturnsOutput
Field
Type
Description
items
[CustomerReturn]
List of return requests.
total_count
Int
Total number of return requests.
page_info
SearchResultPageInfo
Pagination info.
type ReturnCommentsOutput
Field
Type
Description
items
[ReturnComment]
List of comments.
total_count
Int
Total number of comments.
page_info
SearchResultPageInfo
Pagination info.
type CreateReturnOutput
Field
Type
Description
return
CustomerReturn
The created return request.
input CreateReturnInput
Field
Type
Description
order_id
Int!
The order entity ID.
reason_id
Int!
The return reason ID.
resolution_type_id
Int!
The preferred resolution type ID.
items
[CreateReturnItemInput!]!
Items to return.
input CreateGuestReturnInput
Field
Type
Description
order_number
String!
The order increment ID.
email
String!
The order billing email.
reason_id
Int!
The return reason ID.
resolution_type_id
Int!
The preferred resolution type ID.
items
[CreateReturnItemInput!]!
Items to return.
input CreateReturnItemInput
Field
Type
Description
order_item_id
Int!
The order item ID.
qty_requested
Int!
Quantity to return.
condition_id
Int
Item condition ID.
input AddReturnCommentInput
Field
Type
Description
rma_id
Int!
The RMA entity ID.
comment
String!
Comment text.
input SubmitWithdrawalInput - A withdrawal declaration, as the consumer states it.
Field
Type
Description
email
String!
The declarant's email address. The confirmation is sent here.
name
String!
The declarant's name.
order_number
String!
The order number as the declarant gives it.
items
String
The products withdrawn from (names or SKUs), free text, at most 2000 characters. Empty means the whole order.
message
String
Optional free text, at most 2000 characters.
type SubmitWithdrawalOutput - The recorded declaration.
Field
Type
Description
ticket_code
String
Reference of the recorded declaration, to quote to customer service.
received_at
String
When the declaration was received (UTC, Y-m-d H:i:s).