Reference > Shop flow URLs > Order Management subsystem URLs > Returns and refunds
ReturnProcess URL
This URL determines the approval status of a return merchandise authorization (RMA).
This URL determines the approval status of a return merchandise authorization (RMA) by rolling up the status of the return items. If the RMA is approved, then the URL redirects to the URL specified by the URL value. If the RMA is not approved, then the URL redirects to the URL2 value. If the RMA has expired, and an expiry URL was specified, then the URL redirects to the RMAExpiryURL value.
ReturnProcess is run by customers and by Customer Service Representatives (CSRs) for the store. It is the final step in creating or editing an RMA. The basic flow of a return is...
- Run the ReturnItemAdd, ReturnItemUpdate and ReturnItemDelete commands, as applicable, to set up the RMA.
- Run the ReturnPrepare command to calculate taxes and credits.
- Run the ReturnProcess command to finish the RMA. This command can be thought of as "finalizing" the RMA.
A customer can run any combination of adding, updating, and deleting, and then preparing an RMA, but can run the ReturnProcess URL only once. A CSR can edit an RMA even after the ReturnProcess URL has been run. The ReturnProcess URL determines whether an RMA was automatically approved. If not, a CSR can either edit the RMA until it is automatically approved, or if the CSR has the right level of authority, the CSR can use the ReturnApprove URL to approve an RMA as-is.
URL structure
- http:// host_name/path/
- The fully qualified name of the WebSphere Commerce Server and the configuration path.
name-value pair with the & character. For a detailed description of the parameters and their values, see the list entitled Parameter values." />
Parameter values
- forUser
- The logon ID of the user on whose behalf the command will be run; only a person with the authority to process orders can specify this parameter.
- forUserId
- Same as forUser, but identifying the user by the internal user ID, as found in the USERS table.
- langId
- Sets or resets the preferred language for the duration of the session; the supported languages for a store are found in the STORELANG table.
- storeId
- Required: The store reference number.
- RMAId
- Required: The RMA identifier to be processed.
- URL
- Required: The URL to redirect to if the RMA is approved.
- URL2
- The URL to redirect to if the RMA is not approved. If not specified, the value specified in the URL parameter will be used.
- refundPolicyId
- The ID of the policy to use for the refund payment method. This parameter is optional as long as there is only one refund payment policy in the contract; otherwise, a value must be specified the first time the command is called.
- RMAExpiryURL
- The URL to redirect to if the RMA has expired. If this URL is specified and RMGOODFOR is exceeded, then the ReturnPrepareCmd command is called and a redirection will occur to this URL. If this URL is not specified, then the ReturnProcessCmd command completes, even if the ReturnPrepareCmd is called because the RMGOODFOR time frame has expired for the RMA.
Example
The following command processes an order using two re-directional URLs.
http://myhostname/webapp/wcs/stores/servlet/ ReturnProcess?RMAId=1&storeId=1&URL=ReturnDisplay&URL2=ReturnListDisplay
Behavior
- Checks to see if the RMA exits. If not, returns an error.
- Checks to see if a refund policy has been specified, either within the command call or previously, or because there is only one choice. If not, returns an error.
- Checks to see if the RMA has been prepared. If not, returns an exception.
- Calls the RePrepareExpiredRMACmd task command to check to see if the RMAGOODFOR time frame has expired for each return item. If so, calls the ReturnPrepare command and a redirection will take place to the RMAExpiryURL if it is specified. If the RMAExpiryURL parameter is not specified, then ReturnProcess completes normally.
- Calls the CalculateRMAApprovalCmd task command to calculate the overall status of the RMA. If the RMA is approved, then the command marks it as approved, logs the authorization notice, and redirects to the URL specified. If the RMA is not approved, then the command marks it as pending and redirects to URL2.
Exception conditions
The following conditions will cause command execution to fail:
- If the RMAId specified is invalid or in an incorrect state, such as not having been prepared, then an ECApplicationException is raised with message _ERR_RMA_IN_INVALID_STATE_FOR_COMMAND
- If no refund policy was specified, or if the policy specified is not valid for the RMA, then an ECApplicationException is raised with message_ERR_BAD_MISSING_CMD_PARAMETER
Related concepts
Related reference
ReturnCreditAndCloseScan command
Order Management subsystem URLs