Websphere Commerce Returns and Refunds

Websphere Commerce Returns and Refunds

WebSphere Commerce supports returns for available to promise (ATP) and non-ATP inventory-enabled stores using return merchandise authorization (RMA) functionality. A return is a record of a customer's request for a refund, to return merchandise, or both.
If a customer is not satisfied with their purchase, the merchant can offer a refund for the purchase. To return an order (or an order item or a product within an order), it must first be in one of the following states:
PRC (Processing)
CLS(Closed)

However, to return an order (or order item within an order) using the New Return wizard in the WebSphere Commerce Accelerator, both the order and order item within the order must be in:PRC or CLS state and have already been shipped

To return items in any state, use the ReturnItemAdd command.

Websphere commerce have Out of the box functionality of handling refunds on cancellation of an order and also returns. For e.g. you want to cancel only 2 items out of 5 items you ordered. Let’s say you have external Order management system configured with web sphere commerce.

Websphere commerce has provided  order status service which is used to communicate with external systems. Structure of order status can be found in Update_WCS_OrderStatus_30.dtd.Once we receive request XML that follows Update_WCS_OrderStatus_30 structure,websphere commerce will invoke command implementation for OrderStatusCmd.

Create a custom implementation EXOrderStatusCmdImpl and update CMDREG table.Ensure EXOrderStatusCmdImpl extends OrderStatusCmdImpl.Get refund policy id and refund payment method id .We can get all the values from the request xml by calling  super.getOsProp(). This will give return TypeProperties.XML  to  TypeProperties mapping is  done by going through sys_template.xml file.Then execute the below commands in sequence.

1.ReturnItemAddCmd
2.ReturnPrepareCmd
3.ReturnProcessCmd
4.ReturnCreditAndCloseScanCmd Scheduler.

ReturnItemAddCmd

This controller command is used to used to add an item to a return merchandise authorization (RMA).
It can be called with a list of order items or catentries. Each will be processed in the following way:

If the order item is to be added to RMA then
Call the CheckReturnItemInCorrectStateCmd task command to verify that the order item is in a returnable state.Then it Checks that currency of the OrderItem is the same as the currency of the RMA.Make sure that trading Id of the order item is the same as the trading Id of the RMA.

If catEntryId is specified then calls the task command ResolveSkuCmd to resolve the catalog entry ID and item spec ID.

ReturnPrepareCmd

This command adds terms and conditions to a return merchandise authorization (RMA) prior to agreement. Terms include taxes, warehouse to which customer must return required merchandise.

Return Id can be get like  this from ReturnItemAddCmd as below.
returnitemAddCmd.getResposeProperties.getString(RMAItemId_0)

If you want to update RMA items and RMA Item component then use RMAItemAccessBean and RMAItemComponentAccessBean.Use RMAItemComponentAccessBean for setting shipment should receive to ‘N’.Create RMA entry by calling RMAAccessBean.RMA should have total amount to credit and member id.This comand marks the RMA as prepared (RMA.prepared='Y') and then it calls the ExtendReturnPrepareCmd task command.

ReturnProcessCmd

ReturnProcessCmd  Finalizes the agreement between the merchant and the customer as to the terms of a return merchandise authorization (RMA).At the end of the class call super.doProcess(typedproperty). This will change the order status to X .This command will also calls PrimeRefundCmd to store the refund information in a backend system.

ReturnCreditAndCloseScanCmd Scheduler  does the following

For each approved RMA in the store, the following is performed:  If all item components have been fully received and no item has already been credited then the task command CreditReturnItemCmd is called.If there were no exceptions then the RMA is closed by calling the task command CloseReturnCmd.Then the  task command ExtendReturnCreditAndCloseScanCmd is called.

Tables used  in RMA

RMA This table is a container for return merchandise authorizations (RMAs).
RMAITEM This table stores item information for a return or credit for a return merchandise authorization (RMA).
RTNRECEIPT This table stores the receipt record that indicates that a returned item, from a return merchandise authorization ( RMAA).This returned item has been received and specifies information about the received items.
RMACHARGE This table stores charges or credits, applied to a return merchandise authorization (RMA), which are not for sellable products or services. This can be applicable to the entire RMA or to a specific RMA item, such as restocking fees or shipping credits.
RMAAUTHLOG This table is a log of when each return merchandise authorization (RMA) was authorized. A single RMA may appear multiple times if changes were made and the RMA was re-authorized.

Comments

Popular posts from this blog

Websphere Commerce Data Load using CSV \Websphere Commerce Data Load using XML

Websphere Commerce Catalog Subsystem

Calculation Framework in Websphere Commerce.