Since version 2.5
Return Merchandise Authorization (RMA) provides a customer with the means to request a return of an order or part of an order. This guide explains how to integrate this feature into your application.
Return Merchandise Authorization (RMA)
Front-Commerce provides a base platform-agnostic module to support RMA. We also ship some platform-specific implementations for RMA. For now, Magento1EE and Magento2 Commerce are supported.
It is up to the integrator to either use one of our provided implementations or extend our base RMA module to add functionality to the specific platform.
Front-Commerce base RMA module
The base RMA module is located at src/server/modules/front-commerce/rma
it
contains the basic GraphQL schema and empty resolver implementation. This module
is all you need to know what is required to implement an RMA module that
supports your platform.
The frontend implementation
The frontend implementation of the RMA is shipped with the Front Commerce
themes. You can have a look at its implementation in
src/web/theme/pages/Account/Orders/Details/ReturnForm
should you need to
override its behaviour.
Implementing an RMA that suits you
To implement an RMA for a new platform, you have to provide the server
implementation of the Graph. Having a look at Front-Commerce's implementation
for Magento1 Enterprise RMA (src/server/modules/magento1ee/rma
) should help
give you some guidance. Here is a short summary of what is needed:
Extending necessary GraphQL enums
- Extend the
ReturnMerchandiseAuthorizationStatus
enum with all the possible statuses that an RMA could have. - Extend the
ReturnedItemStatus
enum with all the possible statuses a returned item can have.
Providing necessary resolver functions
- implement the
createReturnMerchandizeAuthorizationRequest
mutation. ThecreateReturnMerchandizeAuthorizationRequest
mutation will receive a variable calledinput
of typeCreateReturnMerchandizeAuthorizationRequestInput
and returns aCreateReturnMerchandizeAuthorizationOutput
which is aMutationSuccessInterface
with an extraorder
field representing the current order. - implement the field
returns
of the typeOrder
. This field should return all returned items belonging to this order. (please note that areturn
object hasitems
fields this is due to the fact that some products have bundled items and it is sometimes possible to return some of those items). - implement
isReturnable
field of the typeOrder
. This should return true in case the order has returnable items. - implement
isReturnable
field of the typeOrderItem
. This should return true in case the item is returnable. - implement
returnAttributes
field of the typeOrderItem
. Note: areturnAttribute
's type is the interfaceReturnAttribute
it is up to the integrator to resolve thereturnAttribute
's type. - implement
returns
field of the typeCustomer
this should return all returns belonging to the parent customer.
The create RMA page
We ship a page that is used to create an RMA. The link to this page will show up in the order details page after you have implemented resolvers related to RMA.