Chapter 143: Order Transaction History In API

Overview: Use the Order Transaction History In API to receive order transaction history messages for a specified order to display on the Display Order History Screen, based on XML messages from an external system. The Order Transaction History (ORDTRHSTIN) job in Working with Integration Layer Processes (IJCT) processes order transaction history messages received from an external system.

In this chapter:

Process Overview

Order Transaction History Interface Errors

Order Transaction History API Setup

Work with Integration Layer Processes (IJCT)

Order Transaction History In Message (CWORDTRANSHSTIN)

Order Transaction History In Message: Sample XML

Process Overview

Purpose: You can use the Order Transaction History In API to create order transaction messages for a specified order to display on the Display Order History Screen.

The steps are:

1. An external system sends an Order Transaction History In Message (CWORDTRANSHSTIN) to CWDirect, using an MQ queue specified for the Order Transaction History job.

2. The Order Transaction History (ORDTRHSTIN) job in Working with Integration Layer Processes (IJCT) processes the Order Transaction History In message.

• If an error exists, the ORDTRHSTIN job does not update the Display Order History Screen based on information in the Order Transaction History In Message (CWORDTRANSHSTIN). See Order Transaction History Interface Errors to review a list of the possible errors that may occur.

• If no errors exist, the ORDTRHSTIN job creates an order transaction history record for the specified order ship to. You can review the order transaction history record on the Display Order History Screen.

Order Transaction History Interface Errors

A list of errors that can occur when processing the Order Transaction History In Message (CWORDTRANSHSTIN) from an external system is displayed below.

Note: If an error occurs, the system does not update the Display Order History Screen with the information in the Order Transaction History In Message (CWORDTRANSHSTIN); in addition, the system does not notify you that the Order Transaction History In message contained an error and that the update did not occur.

Error

Reason

Company is blank

The company_code in the Order Transaction History In Message (CWORDTRANSHSTIN) does not contain a value.

Company is invalid

The company_code in the Order Transaction History In Message (CWORDTRANSHSTIN) does not contain a valid CWDirect company code.

Order number is blank

The order_number in the Order Transaction History In Message (CWORDTRANSHSTIN) does not contain a value.

Order number is invalid

The order_number in the Order Transaction History In Message (CWORDTRANSHSTIN) does not contain a valid order number for the specified CWDirect company.

Order ship to number is blank

The ship_to_number in the Order Transaction History In Message (CWORDTRANSHSTIN) does not contain a value.

Order ship to number is invalid

The ship_to_number in the Order Transaction History In Message (CWORDTRANSHSTIN) does not contain a valid ship to number for the specified CWDirect order.

Order Transaction History API Setup

Purpose: Before you can process an Order Transaction History In Message (CWORDTRANSHSTIN) through the Order Transaction History job, you must perform the necessary CWDirect setup.

Work with Integration Layer Processes (IJCT)

The Order Transaction History (ORDTRHSTIN) job in Working with Integration Layer Processes (IJCT):

• Validates the data in the Order Transaction History In Message (CWORDTRANSHSTIN). If an error exists, the system does not update the Display Order History Screen for the order; see Order Transaction History Interface Errors for a list of errors that will prevent the system from updating the Order Transaction History file.

• Creates an order transaction history record based on the information in the Order Transaction History In Message (CWORDTRANSHSTIN) received from an external system.

You must set up an inbound MQ queue to receive the Order Transaction History In Message (CWORDTRANSHSTIN) from an external system.

Order Transaction History In Message (CWORDTRANSHSTIN)

 

The Order Transaction History (ORDTRHSTIN) job in Working with Integration Layer Processes (IJCT) receives and processes this message to create order transaction history records to display on the Display Order History Screen for an order. See Process Overview for more information.

See Order Transaction History In Message: Sample XML for a sample 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. CWORDTRANSHSTIN indicates the message contain an order transaction history message.

Header

company_code

numeric

3

Indicates the company where the order associated with the order transaction history message exists.

Required.

Updates the Company field in the Order Transaction History file.

order_number

numeric

8

The order number whose order transaction history you wish to update.

The order can be in any valid status (open, held, closed, cancelled, etc.) to receive order transaction history messages.

Required.

Updates the Order # field in the Order Transaction History file.

ShipTo

ship_to_number

numeric

3

The order ship to on the order whose order transaction history you wish to update.

Required.

Updates the Ship to # field in the Order Transaction History file.

OrderTransHistory

oth_date

numeric

7

The date associated with the order transaction history message, in MMDDYYYY format.

For example, if the oth_trans_type is S (Shipment), the oth_date represents the date the order was processed for shipment.

Optional.

Updates the OTH date field in the Order Transaction History file.

oth_trans_type

alpha

1

A code for a type of update against the order.

System delivered order history transaction types are:

A = Authorization received for credit card order

B = Issue sent for subscription item

C = Cancel through Order Maintenance

D = Drop ship purchase order

E = Promotion discount applied

F = Refund processed

G = Gift certificate

H = Hold through Order Maintenance or as a result of credit checking

I = Retail transaction. See Retail Integration (External System to CWDirect) for an overview.

J = Change in gift certificate number. See Assigning Gift Certificate Numbers for an overview.

K = Backorder card. See Purchase Order Layering and Backorder Notifications for an overview.

 

 

 

L = Letter or email sent to customer or vendor for order, purchase order, item on order, or item on purchase order. Includes order, return, or shipment confirmation emails, or the Outbound Email XML Message (CWEmailOut).

M = Maintenance through Order Maintenance. The system also uses this code when it applies a prorated discount.

N = Return authorization processed

O = Order sold out automatically during Billing, based on the value in the S/O field for the Item, and a soldout notification generated.

P = Pick slip generated. The system also uses this code when an item stock allocation error occurs, or when the ship via on the order is overridden through the best way shipping option at pick slip generation.

R = Release through Order Maintenance, Release Held Orders program or by the system (from time hold for prepaid orders)

S = Shipment logged when pick slips generated for all order lines

T = Call tag printed. The system also uses this code when you create a call tag.

 

 

 

U = Interactive reservation. Indicates that an item was reserved or unreserved manually, such as through Working with Interactive Reservation (MIRV) or Reprinting and Voiding Pick Slips (WVRP).

V = Pick ticket voided and reprinted

W = Price override. Indicates that the user entered a price override.

Z = Reserved for user-defined order transaction history entries.

Optional.

Updates the OTH Transaction type field in the Order Transaction History file.

oth_dollar_amt

numeric

9.2 (implied decimal)

The total order amount following the order activity, including merchandise, freight, tax, handling, etc.

Optional.

Updates the OTH dollar amount field in the Order Transaction History file.

oth_trans_note

alpha

40

The description of the activity related to the order history transaction, such as:

• Authorization

• Call tag (call tag number and detail line)

• Flag for cancellation due to declined authorization

• Cancel

• Cancel request for a drop ship item

• Cancel confirm or reject for a drop ship item

• Drop ship

• Hold

• Letter (This option is not currently supported)

• Maintenance

• Order conf (Order confirmation email or Outbound Email XML Message (CWEmailOut))

• Release

• Retrn conf (Return confirmation email or Outbound Email XML Message (CWEmailOut))

• Sale

• Ship conf (Shipment confirmation email or Outbound Email XML Message (CWEmailOut))

• Shipment Confirmed for drop ship PO # XXXX

(For confirmed shipment of a drop ship item, the transaction notes also include item code, meter charge, weight, ship via and description, and tracking number. For a ship via defined in CWCollaborate but not defined in CWDirect, the ship via code is indicated, but not the description.)

 

 

 

• Sold out

• Subscription generation

Optional.

Updates the OTH Transaction note field in the Order Transaction History file.

oth_user

alpha

10

Identifies the user who performed the order transaction activity.

Optional.

Updates the User field in the Order Transaction History file.

Order Transaction History In Message: Sample XML

A sample of the Order Transaction History In Message (CWORDTRANSHSTIN) is presented below.

 

 

<Message source="CWIntegrate" target="CWDirect" type="CWORDTRANSHSTIN">

<Header order_number="751" company_code="554">

<ShipTos>

<ShipTo ship_to_number="001">

<OrderTransHistories>

<OrderTransHistory oth_date="04022008" oth_trans_note="Pick# 86 Mtr 5.50 Wgt 3.19" oth_dollar_amt="5259" oth_trans_type="S" oth_user="KBOTTGER" />

<OrderTransHistory oth_date="04022008" oth_trans_note="Via 1 T#58383837727272648" oth_dollar_amt="5259" oth_trans_type="S" oth_user="KBOTTGER" />

</OrderTransHistories>

</ShipTo>

<ShipTo ship_to_number="002">

<OrderTransHistories>

<OrderTransHistory oth_date="04012008" oth_trans_note="Pick# 87 Mtr 5.20 Wgt 2.89" oth_dollar_amt="5259" oth_trans_type="S" oth_user="KBOTTGER" />

<OrderTransHistory oth_date="04022008" oth_trans_note="Via 1 T#58383837727272586" oth_dollar_amt="5259" oth_trans_type="S" oth_user="KBOTTGER" />

</OrderTransHistories>

</ShipTo>

</ShipTos>

</Header>

</Message>

CS18_04 CWDirect 18.0 August 2015 OTN