ReturnPrepare URL
This URL prepares a return merchandise authorization (RMA).
This URL prepares a return merchandise authorization (RMA) by calculating taxes to be refunded, summing a total refund, determining a credit vehicle, determining a return method, and determining a return fulfillment.
URL structure
- http:// host_name/path/
- The fully qualified name of your WebSphere Commerce Server and the configuration path.
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 prepared.
- comment
- A comment about the RMA.
- URL
- Required: The URL to be called when the command completes successfully.
Example
The following example prepares the RMA with reference number 1 and redirects to the ReturnDisplay command to view this RMA.
http://myhostname/webapp/wcs/stores/servlet/
ReturnPrepare?RMAId=1&storeId=1&URL=ReturnDisplay
Behavior
- Checks to see if the RMA exists. If not, returns an error.
- Calls the RefreshExpiredRMAItemsCmd task command to determine if the RMAGOODFOR time frame has expired for each RMA item. The credit calculation and automatic approval is called again for those items that have exceeded the 'good for' time.
- Calls CalculateReturnAdjustmentPolicyCmd task command to calculate RMA level charges or credits specified by policy.
- Calls the CalculateReturnTaxCmd task command to calculate taxes.
- Calculates all totals; that is, the total credit in the RMA and the total credit in the return.
- If the total credit for the RMA is greater than zero, then calls the DetermineReturnCreditVehicleCmd task command to determine how to credit the customer, and sets the value in the RMA. If the task command does not resolve a credit method, it returns an error.
- If any return item components are marked to be received, calls the ResolveReturnFulfillmentCenterCmd task command to determine a return fulfillment center for the RMA, and sets the value in the RMA. Otherwise, sets RMA.Ffmctr_id to null.
- Marks the RMA as prepared.
- Calls the ExtendReturnPrepareCmd task command.
- On successful completion, call the specified URL.
Exception conditions
- If the RMAId specified is invalid or in an incorrect state, then an ECApplicationException is raised with message _ERR_RMA_IN_INVALID_STATE_FOR_COMMAND
- If no trading id is specified in the RMA, then an ECApplicationException is raised with message _ERR_BAD_MISSING_CMD_PARAMETER
- If a credit vehicle cannot be determined, then an ECSystemException is raised with message _ERR_CANNOT_DETERMINE_CREDIT_VEHICLE
- If a return fulfillment center cannot be determined, then an ECSystemException is raised with message _ERR_CANNOT_DETERMINE_RETURN_FFMCENTER