Generic Return API

Purpose: Use the generic return API to create and process a return against an order detail line, based on XML messages from an external system. The RETURN_IN job in Working with Integration Layer Processes (IJCT) processes return API requests.

In this topic:

Process Overview

Identifying the Order

Identifying the Order Line

Returning Against an Existing Return Authorization

Determining the Return Warehouse and Location

Suppressing Refunds

Tax Overrides and Return Processing

Delivery Confirmation for Returned Items

CWCustomerReturn Message

Return API Errors

Return API Setup

System Control Values

Menu Options

Secured Features

Return Request Message (CWReturnIn)

Return Request Message: Sample XML

Return Response Message (CWReturnOut)

Return Response Message: Sample XML

Process Overview

Purpose: You can use the generic return API to create, receive, and credit a return for a specified ship to order line.

The steps are:

1. An external system sends a Return Request Message (CWReturnIn) to CWDirect, using an MQ queue specified for the RETURN_IN job.

2. The RETURN_IN job in Working with Integration Layer Processes (IJCT) processes the return.

• If an error exists, the RETURN_IN job creates a record in the Return Error file. You can review return errors in the Work with Return Interface Errors (WRIE) menu option.

• If no errors exist, the RETURN_IN job sends the return to the Billing Async to create the credit invoice. You can view the return in Work with Return Authorizations (WRTA).

3. If the send_response field in the Return Request Message (CWReturnIn) is set to Y, the RETURN_IN job sends a Return Response Message (CWReturnOut) back to the external system, indicating if the return processed successfully or if an error occurred.

Performing an exchange: In order to perform an exchange, you need to create the return using the Return Request Message (CWReturnIn) and then add the exchange item to a new order using the Generic Order Interface (Order API).

Creating a return that is not associated with an existing order: You can use the Generic Order Interface (Order API) to create a return that is not associated with an existing order. See Processing a Return for instructions.

Note:

• The system does not prevent you from using the generic return API to process a return against an order whose Restrict Returns (RR) maintenance restriction for the order type on the order is selected.

• You can use the generic return API to process a return of a pre-billable item. In this situation, the pre-billed deposit amount is not automatically refunded. Optionally, you can use order maintenance to credit the customer for the pre-billed deposit by processing a return against the Pre Billed Amount Item (J72) or by applying a negative additional charge. See the Pre Billed Amount Item (J72) system control value for a general discussion.

Identifying the Order

In order to create a return using the Return Request Message (CWReturnIn), you must identify the CWDirect order associated with the return. You can identify the order by passing a value in one of the following fields:

ecomm_order_nbr, to specify the alternate order number from an outside system that is associated with the order. Orders from the web storefront and CWStore update this field. The e-commerce order number is stored in the E-Comm order number field in the Order Header Extended file.

order_nbr, to specify the CWDirect order number.

In addition, you must define which ship to is associated with the return by passing a value in the ship_to_nbr field.

Identifying the order and ship to number is required in order to process an inbound return.

Identifying the Order Line

You must create the return against an existing CWDirect order detail line. You can identify the order line to return against using the following fields:

odt_seq_nbr: The order detail line sequence number defined in the Order Detail file.

ra_nbr, ra_line_nbr: If a return authorization already exists, you can identify the return authorization number and return authorization line number defined in the RA Detail file. See Returning Against an Existing Return Authorization for additional information.

item and sku: The item number, defined in the Item file. If the item is a SKUed item, you must also specify the SKU code, defined in the SKU file.

short_sku: The short SKU for the item, defined in the SKU file.

retail_ref_nbr: The retail reference number for the item, defined in the SKU file.

upc_type and upc_code: The UPC type and UPC code for the item, defined in the Item UPC file.

alias: The alias code for the item, defined in the Page Letter Alias file. If the item is a SKUed item, you must pass sku along with alias in order to find the correct item and SKU code.

Note: If you pass information in a combination of the above fields, all of the information must be valid for a specific order detail line on the specified ship to order; otherwise, the return request will error: Invalid Order Detail Line.

What if the item exists on more than one order line? If the item exists on more than one order line and you do not define the order detail line sequence number, the system returns the item against the first order detail line, in order line sequence, that has enough quantity available to return to meet the return request.

Example: The RETURN_IN job receives an Return Request Message (CWReturnIn) against a ship to order for item AB101 for a quantity of 2. The order contains the following order lines.

Order line

Item

Shipped qty

Results

1

AB101

1

The system creates and processes a return against order line 3 for a quantity of 2.

2

BC202

2

3

AB101

5

4

AB101

2

Using the example above, you will receive an error if you try to return item AB101 for a quantity of 6 since none of the order lines for item AB101 has a shipped quantity of 6 that is available to return. The system will not return against multiple order detail lines.

Returning Against an Existing Return Authorization

When the RETURN_IN job processes a Return Request Message (CWReturnIn) that contains a return authorization to return against, the system will receive and credit the existing return authorization.

In order to process a return against an existing return authorization, you must identify the following in the Return Request Message (CWReturnIn):

• the order number to return against (ecomm_order_nbr or order_nbr)

• ship to number (ship_to_nbr)

• RA number and RA line number (ra_nbr and ra_line_nbr)

• order line identifier if multiple return authorizations exist for the order; see Identifying the Order Line

When the system processes the RA in the Return Request Message (CWReturnIn):

• If the return is created, but not yet received, the system will receive and credit the return.

• If the return is received, but not yet credited, the system will credit the return.

If the existing RA has already been completely processed, the Return Response Message (CWReturnOut) will indicate that the return failed with the error_message: Return Already Processed.

Note: When you return against an existing return authorization, the system will process the return using the settings defined for the existing RA, ignoring any value passed in the following fields:

refund_frt

refund_hand

refund_chg

refund_duty

reason

disposition

whs

location

Determining the Return Warehouse and Location

The RETURN_IN job uses the following hierarchy to determine the warehouse and location where the item will be returned.

1. Return the item to the whs and location specified in the Return Request Message (CWReturnIn).

2. If the whs and location are blank, return the item, based on the settings defined for the disposition specified in the Return Request Message (CWReturnIn).

• If the disposition’s Affect inventory field is N, the item will not be returned to a warehouse or location.

• If the disposition’s Affect inventory field is Y and the Use primary location field is Y, the item will be returned to its primary primary warehouse and location.

• If the disposition’s Affect inventory field is Y and a Warehouse and Location are defined, the item will be returned to the specified warehouse and location.

3. If the whs, location, and disposition are blank, return the item, based on the settings defined for the return disposition code defined in the Default Return Disposition Code for Inbound Returns (H65) system control value. If this system control value is blank, the return will be placed in an error status: Invalid Rtn Disposition.

If the item does not exist in the warehouse, the system will automatically create an item warehouse record. If the item has not been previously placed in this location, the system will automatically create an item location record.

Suppressing Refunds

You can use the suppress_refund field in the Return Request Message (CWReturnIn) to indicate if you do not want to create a refund for the return. For example, it might not be appropriate to generate a refund for a POS order, when the transactions have already taken place at the store.

If a value is passed in the suppress_refund field, the system updates the Suppress refund field in the Order Payment Method file for each payment method on the order. You can review the setting of the Suppress refund field at the Display Order Pay Type Screen (1 of 2).

• If the suppress_refund field in the Return Request Message (CWReturnIn) is set to N or is blank, the system updates the Suppress refund field for the payment methods on the order to N or leaves it blank, allowing the system to generate a refund for the order.

• If the suppress_refund field in the Return Request Message (CWReturnIn) is set to Y, the system updates the Suppress refund field for the payment methods on the order to Y, preventing a refund from being generated. If you generate a refund for the order, the refund is created in a status of N (cancel pending). When you use Processing Refunds (MREF), the refund status changes to C (cancelled). You cannot change the setting of the Suppress refund flag for a payment method, and the system will never generate a refund for the order payment method. In order to generate a refund, you need to deactivate the payment method and enter a new one; you will need to process any cancel-pending refund for the payment method before you can deactivate the payment method on the order.

The system writes an order transaction history message each time the Suppress refund flag is changed for a pay type: Suppress refund updated to Y on p/t 4.

What if the suppress_refund flag setting is different on returns for the same order? If you process multiple returns for an order, the system will update the Suppress refund field for each payment method on the order based on the setting defined for the last return processed.

If an unprocessed refund already exists for the order and an Return Request Message (CWReturnIn) is received for the order, the system will not update the status of the existing refund.

Example: The Suppress refund flag for the payment method on an order is blank.

The RETURN_IN job receives a CWReturnIn message for the order with the suppress_refund flag set to Y. The system updates the Suppress refund flag for the payment method to Y.

Because the Suppress refund flag for the payment method on the order is Y, the system creates the refund in an N (cancel pending) status.

The RETURN_IN job receives another CWReturnIn message for the order with the suppress_refund flag set to N. The system updates the Suppress refund flag for the payment method to N.

Because the Suppress refund flag for the payment method on the order is N, the system creates the refund in an O (open) status. The refund previously created for the order remains in a cancel pending status.

The RETURNS_IN job receives another CWReturnIn message for the order with the suppress_refund flag set to blank.

The system does not update the Suppress refund setting for the payment method on the order. Because the Suppress refund flag for the payment method on the order is N, the system creates the refund in an O (open) status. The system does not update the status of the refunds previously created for the order.

If the Billing Async is inactive: If the Billing Async is inactive when the RETURN_IN job receives inbound return messages, the system will not process the returns until the Billing Async is started. However, the system will update the Suppress refund flag for the payment methods on the order as each inbound return is received.

Once the Billing Async is active, the system will process the returns. In addition, the status of all of the refunds created for the order will be based on the suppress_refund setting of the last return processed. Using the example above, the setting of the suppress_refund flag for the last return processed was blank, leaving the Suppress refund flag for the payment methods on the order as N; in this example, the system would create each refund in an open status.

Tax Overrides and Return Processing

CWDirect updates the Tax override field for an order line to Y if the order was received from an external system and a tax, GST, or PST amount was defined, indicating the tax amount from the external system should be retained on the order line.

If the Tax override field for the order line you are returning is set to Y, the system does not call the regular tax routine to recalculate the amount of tax remaining on the order line and how much tax to include on the credit invoice. Likewise, if you use Vertex to calculate tax, the system does not call Vertex to recalculate the tax amount.

Instead, the system prorates the tax override amount across the units ordered on the order line to determine the new tax override amount and the tax amount to return.

Determining the new tax override amount: The system uses the following calculations to determine the new tax override amount assigned to the order line. This is the tax amount in the Tax field on the Display Order Detail Screen (Reviewing Order Line Detail).

Original order quantity - Total order line return quantity = Net order quantity

Net order quantity / Original order quantity = Return ratio

Return ratio x Original tax override amount = New tax override amount

Determining the tax amount to return: The system uses the following calculations to determine the tax amount to include on the credit invoice created for the return. This is the tax amount in the Tax field on the Second Display Invoice Detail Screen.

Current return quantity / Original order quantity = Return ratio

Return ratio x Original tax override amount = Returned tax amount

Example: An order line contains 5 units of an item. The tax override amount for the order line is 5.00. You return 1 unit of the item against the order line. 2 units of the item have previously been returned against the order line.

In this example:

• The original order quantity is 5.

• The total order line return quantity is 3.

• The current return quantity is 1.

The system determines the new tax override amount:

5 - 3 = 2

2 / 5 = .4

.4 x 5.00 = 2.00

2.00 is the Tax amount for the order line on the Display Order Detail screen.

The system determines the tax amount to return:

1 / 5 = .2

.2 x 5.00 = 1.00

1.00 is the Tax amount for the credit invoice on the Display Invoice Detail screen.

Delivery Confirmation for Returned Items

When you process a return and a Delivery Confirmation general ledger number has been defined for the division associated with the order, the system:

• creates an order line history record for activity V (Delivered) for the quantity of the item that has been returned or exchanged. If part of the returned quantity has already been flagged as delivered, the system creates the order line history record for the quantity of the item that has not already been flagged as delivered. In addition, the system updates the External reference number field for the order line history record with System Gen’d by Ret, indicating the order line history record was created as a result of return processing. See Delivered (V) Order Line Activity Code.

• posts the delivery confirmation to the general ledger; see Posting Delivery Confirmation.

Note: The system does not create an order line history record for activity V if the entire returned quantity has already been flagged as delivered or the return is a misship return.

CWCustomerReturn Message

The system generates a Generic WMS Customer Return XML Message (CWCustomerReturn) for a successfully processed Return Request Message (CWReturnIn) in order to send the return information to an external system if the following is defined:

• The Use PkMS Interface Values (F31) system control value is set to Y.

• Program name IFR0086 is defined in the PkMS Return/Case Interface Program (F38) system control value.

MQ is defined in the PkMS Transport Type (G80) system control value.

GENERIC or GENERIC_2 is defined in the RA Program XML Message Format (H45) system control value.

See Generating a CWCustomerReturn Message for Returns for more information on when the system generates the CWCustomerReturn message.

Return API Errors

A list of errors that may occur when processing a return from an external system is displayed below. You can review inbound returns that did not process due to an error in the Work with Return Interface Errors (WRIE) menu option.

Error description

Reason

Missing Company

The company field is blank.

Invalid Company

The company field does not contain a valid CWDirect company code.

Invalid Order Header

The system could not locate an order to return against based on the value passed in the ecomm_order_nbr or order_nbr field.

See Identifying the Order for more information on the different ways you can identify the order to return against.

Invalid Order Ship To

The system could not locate the ship to order to return against, based on the value passed in the ship_to_nbr field.

Invalid Order Detail Line

The system:

• Could not locate an order line to return against, based on the item information passed in the Return Request Message (CWReturnIn).

• Could not return against the order line because there wasn’t an available quantity to return, for example, the item had not shipped yet.

See Identifying the Order Line for more information on the different ways you can identify the order line to return against.

Missing Order Detail Ln#

The system could not locate an order line to return against, based on the item information passed in the Return Request Message (CWReturnIn).

See Identifying the Order Line for more information on the different ways you can identify the order line to return against.

Invalid RA Header

The ra_nbr passed does not match the RA # field in the RA Detail file for the specified CWDirect order number, ship to number, and item.

The specified order number, ship to number, and item is not associated with an existing return authorization.

Invalid RA Detail

The ra_line_nbr passed does not match the Line # field in the RA Detail file for the specified CWDirect order number, ship to number, and item.

The specified order number, ship to number, and item is not associated with an existing return authorization.

Invalid Return Quantity

The qty passed does not match the quantity available to return for an order line.

For example, if an item was ordered on 2 order lines, you must create a separate return for each order line or you will receive this error message.

If you are returning against an RA, the quantity passed must match the quantity to return that was created on the RA.

Invalid Whs for Return

The whs passed or the warehouse associated with the Default Return Disposition Code for Inbound Returns (H65) is not a valid warehouse.

Invalid Loc for Return

The location passed or the location associated with the Default Return Disposition Code for Inbound Returns (H65) is not a valid location for the warehouse specified.

Order Detail line already returned

The item passed has already been returned for the available quantity.

Return Already Processed

The quantity available to return against the order line has already been returned and processed.

No Active Paytypes

The pay type on the order was deactivated by the Security Risk Purge periodic function. See Credit Card Retention Days (K65).

Invalid item/SKU for Order Detail Line

The item information specified in the Return Request Message (CWReturnIn) is not located on the order line associated with the odt_seq_nbr.

Invalid Return Reason

The reason passed in not a valid return reason code.

Return reason codes are defined in and validated against the Return Reason file.

Missing Return Reason

The reason is blank and a return reason code is not defined in the Default Return Reason Code for Inbound Returns (H63) system control value.

Invalid Rtn Disposition

The disposition is blank and a disposition code is not defined in the Default Return Disposition Code for Inbound Returns (H65) system control value.

Missing Default Charge Code (H64) for misc credit

An amount was passed in the credit_amt field and an additional charge code was not defined in the Default Additional Charge Code for Inbound Returns (H64) system control value to assign to the charge.

RA Detail does not exist for ODT Sequence #

Multiple RAs exist for the order and the system could not determine which order detail line to return against based on the odt_seq_nbr, ra_nbr and ra_line_nbr passed in the message.

Missing RA Exchange Item

You are Returning Against an Existing Return Authorization that is for an exchange and the Require Exchange Item at Time of Receipt (F42) system control value is set to Y, allowing you to create an exchange in Work with Return Authorizations (WRTA) without defining the exchange item until you process the receipt for the RA. However, because you are processing the receipt using the Return Request Message (CWReturnIn), there is no way to define the exchange item.

Return API Setup

Purpose: Before you can process an Return Request Message (CWReturnIn) through the RETURN_IN job, you must perform the necessary CWDirect setup.

System Control Values

Menu Options

Secured Features

System Control Values

System Control Value

Description

Refund Freight Default for Inbound Returns (H59)

If a refund_frt value is not passed in the Return Request Message (CWReturnIn), the system uses the setting in this system control value to determine whether the system refunds freight charges for a return initiated from an outside system.

If this system control value is blank, the Refund freight field for the return defaults to N.

Refund Additional Charge Default for Inbound Returns (H60)

If a refund_chg value is not passed in the Return Request Message (CWReturnIn), the system uses the setting in this system control value to determine whether the system refunds additional charges for a return initiated from an outside system.

If this system control value is blank, the Refund additional charges field for the return defaults to N.

Refund Handling Default for Inbound Returns (H61)

If a refund_hand value is not passed in the Return Request Message (CWReturnIn), the system uses the setting in this system control value to determine whether the system refunds handling charges for a return initiated from an outside system.

If this system control value is blank, the Refund handling field for the return defaults to N.

Refund Duty Default for Inbound Returns (H62)

If a refund_duty value is not passed in the Return Request Message (CWReturnIn), the system uses the setting in this system control value to determine whether the system refunds duty charges for a return initiated from an outside system.

If this system control value is blank, the Refund duty field for the return defaults to N.

Default Return Reason Code for Inbound Returns (H63)

If a reason value is not passed in the Return Request Message (CWReturnIn), the system defaults the return reason in this system control value to a return initiated from an outside system.

Default Additional Charge Code for Inbound Returns (H64)

If a credit_amt value is passed in the Return Request Message (CWReturnIn), the system defaults the additional charge code in this system control value to a return initiated from an outside system.

Default Return Disposition Code for Inbound Returns (H65)

If a disposition value is not passed in the Return Request Message (CWReturnIn), the system defaults the disposition code in this system control value to a return initiated from an outside system.

Menu Options

Menu Option

Description

Working with Integration Layer Processes (IJCT)

The RETURN_IN job:

• Validates the data in the Return Request Message (CWReturnIn). If there is an error, you can review it through the Work with Return Interface Errors (WRIE) menu option.

• Creates a return based on an Return Request Message (CWReturnIn) received from an external system.

• Optionally, sends an Return Response Message (CWReturnOut) to the external system.

In addition, you must set up an inbound MQ queue to receive an Return Request Message (CWReturnIn) from an external system and an outbound MQ queue to send an Return Response Message (CWReturnOut) to the external system.

Secured Features

Secured Feature

Description

Enter Return Authorization (A28)

Note: The system does not require authority to these secured features in order to create, receive, and credit a return processed through the RETURN_IN job. The system will create the return without errors; however, if you do not have authority to these secured features, you cannot review the return in WRTA.

Receive Return Authorization (A29)

Credit Return Authorization (A34)

Return Disposition Authority (A83)

Note: The system does not require authority to this secured feature in order to assign a certain return disposition code to a return processed through the RETURN_IN job.

Return Request Message (CWReturnIn)

 

The RETURN_IN job in Working with Integration Layer Processes (IJCT) receives and processes this message to create a return against an order line.

For more information: See:

Process Overview for more information.

Return Request Message: Sample XML for a sample message.

XML Messages for a table that provides links to the DTD, schema, and a sample XML layout for each XML message.

Attribute Name

Type

Length

Comments

Message

source

alpha

25

Identifies the source of the XML message. CWIntegrate indicates the XML message is from an outside source.

target

alpha

25

Identifies the target of the XML message. CWDirect indicates the XML message is sent to CWDirect.

type

alpha

25

Identifies the type of information in the XML message. CWReturnIn indicates the message contains a return request.

resp_qmgr

alpha

50

The response queue manager defined on the iSeries for the RETURN_IN job.

Return

company

numeric

3

The CWDirect company where the order associated with the return is located.

Required.

Updates the Company field in the RA Detail file.

Identifying the order: In order to create a return, you must identify the CWDirect order and ship to number associated with the return. See Identifying the Order for more information.

ecomm_order_nbr

alpha

30

The alternate order number from an outside system that is associated with the return, as defined in the E-Com order number field in the Order Header Extended file. Orders from the web storefront and CWStore update this field.

Required if order_nbr is blank. Used to locate the order associated with the return.

order_nbr

numeric

8

The CWDirect order number associated with the return, as defined in the Order # field in the Order Header file.

Required if ecomm_order_nbr is blank. Used to locate the order associated with the return.

Updates the Order # field in the RA Detail file.

ship_to_nbr

numeric

3

The order ship to number associated with the return, as defined in the Ship to # field in the Order Ship To file.

Required.

Updates the Ship to # field in the RA Detail file.

Identifying the order line: You must create the return against an existing CWDirect order detail line. See Identifying the Order Line for more information on the different ways you can identify which order line you wish to return against.

odt_seq_nbr

numeric

5

The order detail line sequence number associated with the return, as defined in the Seq # field in the Order Detail file.

Required if ra_nbr, ra_line_nbr, item, sku, retail_ref_nbr, short_sku, upc_type, upc_code, and alias are blank. Used to locate the order line to return against.

ra_nbr

numeric

3

The return authorization number to return against, as defined in the RA # field in the RA Detail file.

Required if item, sku, retail_ref_nbr, short_sku, upc_type, upc_code, and alias are blank. Used to locate the order line to return against.

The system will use the order number, ship to number, RA number and RA line number passed to locate the existing return authorization to return against. If multiple RAs exist for the order, you can also pass an order line identifier to identify the order line to return against. See Returning Against an Existing Return Authorization and Identifying the Order Line.

ra_line_nbr

numeric

3

The return authorization line number to return against, as defined in the Line # field in the RA Detail file.

Required if item, sku, retail_ref_nbr, short_sku, upc_type, upc_code, and alias are blank. Used to locate the order line to return against.

The system will use the order number, ship to number, RA number and RA line number passed to locate the existing return authorization to return against. If multiple RAs exist for the order, you can also pass an order line identifier to identify the order line to return against. See Returning Against an Existing Return Authorization and Identifying the Order Line.

qty

numeric

5

The number of units of the item to return.

The return errors if the return quantity is greater than the quantity available to return on the order line.

Required.

Updates the Qty returned field in the RA Detail file.

Determining the return warehouse and location: See Determining the Return Warehouse and Location for the hierarchy the RETURN_IN job uses to determine the warehouse and location where the item will be returned.

whs

numeric

3

The warehouse where the item is being returned.

Required if a return disposition code is not defined in the disposition field or Default Return Disposition Code for Inbound Returns (H65) system control value.

Updates the Whs field in the RA Detail file.

location

numeric

7

The warehouse location where the item is being returned.

Required if a return disposition code is not defined in the disposition field or Default Return Disposition Code for Inbound Returns (H65) system control value.

Updates the Location field in the RA Detail file.

disposition

alpha

3

A code that identifies how a returned item will be handled by CWDirect, in terms of whether the return updates inventory and the warehouse and location to which the item will be returned.

If the return affects inventory, meaning the item will be returned into active inventory and update the on hand quantity in the specified location, and a whs and location are not defined, the system returns the inventory to the warehouse and location defined for the return disposition code.

If a disposition is not passed or is invalid, the system uses the disposition code defined in the Default Return Disposition Code for Inbound Returns (H65) system control value. If the system control value is blank, the return is placed in an error status: Invalid Rtn Disposition.

reason

numeric

3

A code that indicates the reason the customer is returning the item.

If a reason is not passed, the system uses the return reason code defined in the Default Return Reason Code for Inbound Returns (H63) system control value. If this system control value is blank, the return is placed in an error status: Missing Return Reason.

item

alpha

12

The item to return, as defined in the ITM number field in the Order Detail file.

If the item is a SKUed item, you must also specify the SKU code in the sku field.

Required if odt_seq_nbr, ra_nbr, ra_line_nbr, retail_ref_nbr, short_sku, upc_type, upc_code, and alias are blank. Used to locate the order line to return against.

sku

alpha

14

The SKU code of the item to return, as defined in the SKU file.

Required if item or alias is passed and the item is a SKUed item. Used to locate the order line to return against.

short_sku

numeric

7

The short SKU code for the item, as defined in the SKU file.

Required if odt_seq_nbr, ra_nbr, ra_line_nbr, retail_ref_nbr, item, sku, upc_type, upc_code, and alias are blank. Used to locate the order line to return against.

retail_ref_nbr

numeric

15

The retail reference number for the item, as defined in the SKU file.

Required if odt_seq_nbr, ra_nbr, ra_line_nbr, short_sku, item, sku, upc_type, upc_code, and alias are blank. Used to locate the order line to return against.

upc_type

alpha

3

The type of UPC code, as defined in the Item UPC file. The associated UPC code is defined in the upc_code field.

Required if odt_seq_nbr, ra_nbr, ra_line_nbr, short_sku, item, sku, retail_ref_nbr, and alias are blank. Used to locate the order line to return against.

upc_code

numeric

14

The UPC code assigned to an item, as defined in the Item UPC file. The associated UPC type is defined in the upc_type field.

Required if odt_seq_nbr, ra_nbr, ra_line_nbr, short_sku, item, sku, retail_ref_nbr, and alias are blank. Used to locate the order line to return against.

alias

alpha

12

An alternate name assigned to the item, as defined in the Page Letter Alias file.

Note: If the item is a SKUed item, you must pass sku along with alias in order to find the correct item and SKU code.

Required if odt_seq_nbr, ra_nbr, ra_line_nbr, short_sku, item, sku, retail_ref_nbr, upc_type and upc_code are blank. Used to locate the order line to return against.

refund_frt

alpha

1

Indicates whether to refund the freight charge for the returned item.

Y = Refund freight.

N = Do not refund freight.

If you enter Y and the source code uses a header level freight method, the system refunds a proportionate amount of freight for the item being returned.

If you enter Y and the source code uses a line level or flat freight method, the system refunds the freight charge for the returned item on the order.

Note: This setting also controls whether the system refunds any service charges by ship via on the order.

If a refund_frt value is not passed, the system uses the setting defined in the Refund Freight Default for Inbound Returns (H59) system control value.

Updates the Refund freight field in the RA Detail file.

If you are returning against an existing RA, the system uses the Refund freight setting defined for the existing RA detail line, ignoring the value in this field.

refund_hand

alpha

1

Indicates whether the system will credit the handling charge for the returned item.

Y = The system will include the charge for special handling in the customer’s refund.

N = Any charges for special handling, such as monogramming, will not be refunded to the customer.

If a refund_hand value is not passed, the system uses the setting defined in the Refund Handling Default for Inbound Returns (H61) system control value.

Updates the Refund handling field in the RA Detail file.

If you are returning against an existing RA, the system uses the Refund handling setting defined for the existing RA detail line, ignoring the value in this field.

refund_chg

alpha

1

Indicates whether the system will refund the additional charges for the returned item.

Y = Refund additional charges.

N = Do not refund additional charges.

If a refund_chg value is not passed, the system uses the setting defined in the Refund Additional Charge Default for Inbound Returns (H60) system control value.

Updates the Refund add’l chgs field in the RA Detail file.

If you are returning against an existing RA, the system uses the Refund add’l chgs setting defined for the existing RA detail line, ignoring the value in this field.

refund_duty

alpha

1

Indicates whether the system will refund duty charges for the returned item.

Y = Refund duty charges for the returned item.

N = Do not refund duty.

If a refund_duty value is not passed, the system uses the setting defined in the Refund Duty Default for Inbound Returns (H62) system control value.

Updates the Refund duty field in the RA Detail file.

If you are returning against an existing RA, the system uses the Refund duty setting defined for the existing RA detail line, ignoring the value in this field.

credit_amt

numeric

9.2

The credit amount to refund the customer for the return. For example, you may wish to refund return postage.

The credit amount must be a positive amount.

If you define a credit amount, the system will assign the code defined in the Default Additional Charge Code for Inbound Returns (H64) system control value to the credit. If this system control value is blank and a credit amount is passed, the return is placed in an error status: Missing Default Charge Code (H64) for misc credit.

Updates the Add’l charges field in the Order Additional Charge file.

send_response

alpha

1

Indicates whether an Return Response Message (CWReturnOut) is sent back to the external system, indicating if the return was processed successfully or if any error occurred.

Y = Send an Return Response Message (CWReturnOut).

N = Do not send an Return Response Message (CWReturnOut).

suppress_refund

alpha

1

Indicates whether you wish to suppress a refund for the return. For example, if the return is from a retail store, you may have already refunded the customer.

Y = Do not create a refund for the return. The system changes the Suppress refund field for each payment method of the order to Y.

N = Create a refund for the return. The system changes the Suppress refund field for each payment method of the order to N.

Note: If you process multiple returns for an order, the system will update the Suppress refund field for each payment method on the order based on the setting defined for the last return processed. See Suppressing Refunds.

Return Request Message: Sample XML

A sample of the Return Request Message (CWReturnIn) is presented below.

<Message source="Integrate" target="CWDirect" type="CWReturnIn" resp_qmgr="CWIAS400">

<Return company="555" ecom_order_nbr="1122005" ohd_order_nbr="7885" ship_to_nbr="1" odt_seq_nbr="1" ra_nbr="1" ra_line_nbr="1" qty="1" whs="205" location="2050101" disposition="KM" reason="2" item="2005SKU1" sku="RED WMNS SMLL" short_sku="1781" retail_ref_nbr="12005" upc_type="E13" upc_code="200511" alias="SKU12005" refund_frt="Y" refund_hand="Y" refund_chg="Y" refund_duty="Y" credit_amt="150" send_response="Y" suppress_refund="N" />

</Message>

Return Response Message (CWReturnOut)

 

The RETURN_IN job in Working with Integration Layer Processes (IJCT) sends this message to an external system, indicating if the Return Request Message (CWReturnIn) was processed successfully or if any error occurred.

For more information: See:

Process Overview for more information.

Return Request Message: Sample XML for a sample message.

XML Messages for a table that provides links to the DTD, schema, and a sample XML layout for each XML message.

Attribute Name

Type

Length

Comments

Message

source

alpha

25

Identifies the source of the XML message. CWDirect indicates the XML message is from CWDirect.

target

alpha

25

Identifies the target of the XML message.

CWIntegrate indicates the XML message is sent to an external system.

type

alpha

25

Identifies the type of information in the XML message. CWReturnOut indicates the message contains a return response.

date_created

numeric

8

The date the outbound return message was created, in YYYY-MM-DD format.

time_created

numeric

8

The time the outbound return message was created, in HH:MM:SS format.

Return

company

numeric

3

The CWDirect company where the return was created.

From the Company field in the RA Detail file.

ecom_order_nbr

alpha

30

The alternate order number associated with the order that was returned against.

From the E-Comm order number field in the Order Header Extended file.

order_nbr

numeric

8

The CWDirect order number that was returned against.

From the Order # field in the RA Detail file.

ship_to_nbr

numeric

3

The ship to order number that was returned against.

From the Ship to # in the RA Detail file.

odt_seq_nbr

numeric

5

The order detail sequence number associated with the order line that was returned against.

From the Seq # field in the Order Detail file.

ra_nbr

numeric

3

The return authorization number associated with the return.

From the RA # field in the RA Detail file.

ra_line_nbr

numeric

3

The return authorization line number associated with the return.

From the Line # field in the RA Detail file.

item

alpha

12

A code for the item that was returned.

From the ITM number field in the RA Detail file.

sku

alpha

14

A code for the SKU of the item that was returned.

From the SKU code field in the RA Detail file.

whs

numeric

3

A code for the warehouse where the item was returned.

From the Whs field in the RA Detail file.

location

alpha

7

A code for the warehouse location where the item was returned.

From the Location field in the RA Detail file.

qty

numeric

5

The quantity of the item returned.

From the Qty returned field in the RA Detail file.

action_result

alpha

7

Indicates if the return was processed successfully or if an error occurred.

Success = The return was processed successfully.

Failure = An error occurred and the return was not processed. A description of the error is in the error_message field, which you can view through the Work with Return Interface Errors (WRIE) menu option.

error_message

alpha

70

A description of the first error encountered while processing the Return Request Message (CWReturnIn).

See Return API Errors for a list of possible errors and how to correct them.

Return Response Message: Sample XML

A sample of the Return Response Message (CWReturnOut) is presented below.

<Message source="CWDirect" target="CWIntegrate" type="CWReturnOut" date_created="2005-01-12" time_created="14:35:48">

<Return company="555" ecom_order_nbr="1122005" ohd_order_nbr="7885" ship_to_nbr="1" odt_seq_nbr="1" ra_nbr="1" ra_line_nbr="1" item="2005SKU1" sku="RED WMNS SMLL" whs="205" location="2050101" qty="1" action_result="Success" />

</Message>

CS09_12 CWDirect 18.0.x 2018 OTN