OrderProcess URL
Submits an order for processing. The order must have been locked by the OrderPrepare command.
URL structure
- http://host_name/path/
- The fully qualified name of your WebSphere Commerce server and the configuration path.
Parameter values
- forUser
- Specifies the logon ID of the user on whose behalf the command runs; only a person with the authority to process orders can specify this parameter.
- forUserId
- Same as forUser, but identifies 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
- Specifies the reference number of the store with which the order is to be placed. This value is ignored unless an error occurs before the order is resolved. It is used only to call the correct store's exception handler.
- orderId
- (Required) Specifies the reference number of the order to be processed. This parameter can be repeated.
- externalUserId
- Specifies a user ID to be sent with the order-transfer request.
- externalPassword
- Specifies a password for the user ID specified by the externalUserId parameter.
- transferMode
- Specifies the mode of transfer to an external system. A value of 0 transfers the order without payment information (shopping-cart transfer); a value of 1 transfers the order with payment information (purchase-order transfer). The default value is 0.
- billtoAddressId
- Specifies the reference number of the address to bill.
- field1, field2, and field3
- Specify customizable fields.
- notify_[ msgtype]_ transportname_ attributename
- Specifies the configuration attributes that apply to order notification for a given message type and message transport. Message type is optional. If it is not specified, the configuration attribute applies to all message types.
For example:
- Send the "order received" e-mail notification for orders processed by this command to 2 e-mail addresses, john@ibm.com and victor@ibm.com:
notify_ OrderReceived_ EMailSender_recipient=john@ibm.com,victor@ibm.comwhere OrderReceived is from MSGTYPES.NAME and EMailSender is from TRANSPORT.NAME.- Send all types of order e-mail notifications to jack@ibm.com
notify_ EMailSender_recipient=jack@ibm.comwhere EMailSender is from TRANSPORT.NAME.
If you want to send an e-mail notification to a guest customer, then capture the e-mail address of the guest customer. Set the e-mail address as the value of the notify_[ msgtype]_ transportname_ attributename parameter .
- notifyMerchant
- Specifies whether the store is notified when the order processing is complete. E-mail notifications are sent only when WebSphere Commerce is configured with WebSphere Commerce Payments. A value of 1 specifies that the store should be notified; a value of 0 specifies that the store should not be notified.
- notifyShopper
- Specifies whether the customer is notified when the order processing is complete. E-mail notifications are not sent if PrimePaymentCmd fails. A value of 1 specifies that the customer should be notified; a value of 0 specifies that the customer should not be notified.
- quoteExpiryPolicy
- Defines the behavior of the command if the order total expires or an order item's fulfillment center changes during inventory allocation. Order total expires if the current time is greater than or equal to the last update timestamp on the order plus the number of seconds specified in the QUOTEGOODFOR column of the STORE table. This parameter may have three values:
- alwaysProceed
- Always proceed with processing the order after recalculating order total.
- stopOnBiggerTotal
- Proceed with processing the order if the recalculated order total is unchanged or is less than the previous order total. Otherwise, redirect to a URL specified by the quoteExpiredUrl.
- neverProceed
- Always redirect to the URL specified by the quoteExpiredUrl parameter.
- quoteExpiredURL
- Specifies the URL to which to redirect if the order total expired in agreement with the expiry policy specified by the quoteExpiryPolicy parameter.
- notifyOrderSubmitted
- Specifies whether the customer is notified when the order is successfully submitted for processing. A value of 1 specifies that the customer should be notified; a value of 0 specifies that the customer should not be notified. The default is 0.
- availabilityChangeURL
- Specifies the URL to which to redirect when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the maxAvailabilityChange parameter. This parameter is ignored if ATP inventory allocation is not enabled.
- maxAvailabilityChange
- Specifies the time interval, in seconds, mentioned in the availabilityChangeURL parameter description. The default value is 3600 (one hour). This parameter is ignored if the availabilityChangeURL parameter is not specified, or if ATP inventory allocation is not enabled.
- noInventoryURL
- Specifies the URL to which to redirect if any of the items in the order cannot be allocated or backordered. This parameter is ignored if ATP inventory allocation is not enabled.
- tcId
- Specifies the identifier of a Terms and Conditions object (refer to the TERMCOND table). If this is specified and if it identifies a PaymentTC, and if that PaymentTC specifies a memberId and an address nickName (refer to the PaymentTC mapping), then the memberId and address nickName are used to determine the billing address, in which case the billToAddressId parameter is ignored.
Notes about payments:
Notes about order notification: If you need to configure order notification:
- Enable outbound messaging.
- Create templates for composing order notification messages.
- quotationSubmission
- Controls whether the relType attribute values for "selection" OrderQuotationRel objects that identify the order being processed with their childId attribute must be changed to "submission". A value of 0 does not change the relType attributes of the OrderQuotationRel objects in the list to indicate "submission"; a value of 1 does change it to indicate "submission". The default value is 0.
- reduceParentQuantities
- Controls whether quantities of order items in the selection parent order are reduced by the quantities of order items in the order being processed. A value of 0 does not reduce parent quantities; a value of 1 reduces parent quantities. The default value is 0.
The parent order is updated only when the status attribute is P or E.
Only those order items that have the same CatalogEntryId, SpecifiedItemId, and correlationGroup attribute values as the items in the order are updated.
- continue
- Controls whether order processing continues to the next order when there is a failure in processing one of multiple orders. A value of 0 specifies that the process should not continue; a value of 1 specifies that the process should continue. The default value is 0.
- isPIAddNeeded
- If not passed, the default value is true. If it is true, PIAdd will be called to add one payment instruction. Otherwise, no payment instruction will be added. If isPIAddNeeded is not passed, or if isPIAddNeeded=Y, policyId is required.
- payMethodId
The meaning of the payMethodId parameter has changed from version 5.x to version 6.x. Older versions used payMethodId to set the payment method ID to add payment instruction. This has been deprecated for more than 2 releases, and was removed from version 6. Now, payMethodId means the payment method ID of the payment instruction to add. It corresponds to the column POLICYNAME of the record in the table POLICY used by this payment instruction.
When creating new WebSphere Commerce Payments Cassettes and new functions, instead use the policyID parameter.
- policyId
- Sets the payment policy ID. If it is not set, use the default policy ID. It is used only for compatible mode.
- valueFromProfileOrder
- If this parameter is not passed in, the value is 'N.' This indicates that if isPIAddNeeded is Y or not passed in, the payment information for the profile will be queried out and used in the payment protocol data. This is used in quick checkout.
- billing_address_id
- If isPIAddNeeded is true, sets the billing address Id of the Payment Instruction. If this parameter is not set, it will use the billing address of the order.
- PONumber_i
- Sets the purchase order number for this order for the group i. If the purchaseorder_id is specified, this value will be replaced.
- purchaseorder_id
- Sets the purchase order number for this order for the group i.
- paymentInstructionId
- Use this parameter to pass sensitive payment information for payment instructions.
For example, a shopper adds two payment instructions (10001 and 10002). The shopper inputs payment information for a third payment instruction. The shopper clicks the submit order button and is prompted to enter credit card verification information for all three payment instructions. Next, the order is submitted and the OrderProcess command is called. In this example, the relevant parameters are:
paymentInstructionId_1=10001&paymentInstructionId_2=10002&pay_data_cc_cvc_1=1111&pay_data_cc_cvc_2=2222&pay_data_cc_cvc_0=3333This information is passed to the corresponding payment plug-in as extended data for the payment instruction. This data is not persisted.
To use the paymentInstructionId parameter, configure the payment plug-in to use synchronous event processing.
Example 1
The following command processes the placing of an order whose reference number is 3.
http://myhostname/webapp/wcs/stores/servlet/OrderProcess?orderId=3
Example 2
Assuming that WebSphere Commerce Payments has been already set up, this command passes the customer's payment information to Payment Manager. The parameter policyId=200 refers to the OfflineCard method which the store model uses by default for WebSphere Commerce Payments.
http://myhostname/webapp/wcs/stores/servlet/OrderProcess?storeId=34 &orderId=556677&policyId=200&cardBrand=Visa&cardNumber=41111111111111111&cardExpiryMonth=12&cardExpiryYear=2001The DoPaymentMPFCmdImpl class supports an additional parameter called tcId, which is used for specifying the ID of the payment terms and conditions to be used for an order. The terms and conditions must be one of the common payment terms and conditions specified in the contracts associated with the ordered items. To assist in selecting JSP file of common payment terms and conditions, use the UsablePaymentTCListDataBean. The tcId parameter is mandatory if any of the contracts used for the order items has payment terms and conditions associated with it.
Behavior
The OrderProcess command calls the ProcessOrder task command to do the following:
If the order is not locked, the order must be changed since it was prepared previously by the OrderPrepare command; or if the order status is not P, I, E, W, N, or B, an ECApplicationException exception is thrown.
When the value of the QUOTEGOODFOR column in the STORE table is not NULL, the parameters quoteExpiryPolicy and quoteExpiredURL are specified, and the order has a status of P, I, W, or N, the command checks the last update timestamp of the order. If the current time is greater than or equal to the last update timestamp plus the number of seconds specified in the QUOTEGOODFOR column, OrderProcess calls PrepareOrder to refresh the order amounts and then does one of the following, based on the value of the quoteExpiryPolicy:
- If the re-calculated order total is unchanged, and the quoteExpiryPolicy parameter allows it, proceed as normal.
- If the re-calculated order total is less, and the quoteExpiryPolicy parameter allows it, proceed as normal.
- If the re-calculated order total is more, and the quoteExpiryPolicy parameter allows it, proceed as normal.
- Otherwise, do not process the order, but instead re-direct to the URL specified by the quoteExpiredURL parameter.
If ATP inventory allocation is enabled for orders, then:
- Any order items that are not yet allocated or backordered (or that have changed since they were last allocated or backordered) are allocated by calling DoInventoryActionCmd, which invokes AllocateInventory. If the items cannot be allocated, they are backordered.
- If any order items cannot be allocated or backordered:
- If the noInventoryURL parameter is specified, the command returns a redirection to that URL.
- Otherwise, the order status is changed to L and the command returns.
- If the availabilityChangeURL parameter is specified, and the estimated availability times for any of the order items has moved further into the future than specified by the maxAvailabilityChange parameter, the command returns a redirection to that URL.
- If the AllocateInventory task command unlocked the Order, indicating that the fulfillment center for an order item changed, then:
- Shipping charges and tax amounts are re-calculated, and the order is locked, by calling the ReprepareOrder task command. If this changes the total amount for the order, and the quoteExpiryPolicy and quoteExpiredUrl parameters are specified, then:
- If the re-calculated order total is unchanged, and the quoteExpiryPolicy parameter allows it, proceed as normal.
- If the re-calculated order total is less, and the quoteExpiryPolicy parameter allows it, proceed as normal.
- If the re-calculated order total is more, and the quoteExpiryPolicy parameter allows it, proceed as normal.
- Otherwise, do not process the order, but instead re-direct to the URL specified by the quoteExpiredURL parameter.
- The order item promised availability times are set to their current estimated availability times.
- If the order status is I, the CheckOrder task command is called to verify that this order has not already been submitted for processing.
- The CheckOrderAcceptance task command is called to verify that the order-item contracts are active.
- The ORDOPTIONS table is updated to reflect the values of the notifyMerchant and notifyCustomer parameters.
- The billing address, if any, as specified by the tcId or billToAddressId parameters is stored in the order. If the billingAddressId is not specified by the tcId, OrderProcess calls the ValidateOrderAddressCmd to validate the billingAddress specified.
- The field1, field2, and field3 parameter values, if specified, are stored in the order (refer to the ORDERS table).
- If non-ATP inventory allocation is enabled for orders, then allocate inventory for each orderitem.
- The UpdateSpendingLimitCmd task command is called to check account, spending limit and purchase order number, and update some items if needed.
- The PrimePaymentCmd task command is called to process payment information related to the order.
- Update order and orderitems status.
- If the order status is not I, the ExtOrderProcess task command is called. (The PaySynchronizePM scheduler command calls the ExtOrderProcess task command later, when the order status is I, which is only for compatibility with previous versions.)
- Release the order to fulfillment by calling the ReleaseOrderToFulfillment task command.
- The OrderMessaging task command is called. To enable the outbound order create message see Enabling the Report_NC_PurchaseOrder message.
- If the notifyOrderSubmitted parameter specifies 1 (Yes), the OrderNotify task command is called to notify the customer that the order was submitted.
- If the PrimePaymentCmd task command returned byte data, it is passed to the DirectView view to be passed directly to the customer's browser (for example, to launch an electronic payment "wallet" application). Otherwise, the RedirectView view is passed to the OrderOKView redirection URL to display an order acknowledgement to the customer.
Exception conditions
- If the order is not locked, the command throws the ECApplicationException specifying the OrderUnlockErrorView command.
- If the customer typed incorrect data, the command throws the ECApplicationException specifying the BadOrderDataErrorView error view command to notify the customer.
- If the order is not pending, the command throws the ECApplicationException exception specifying the OrderNoneErrorView command.
- If any of the contracts used by the order are not valid, the command throws the ECApplicationException.
Related concepts
Order Management subsystemRelated reference
Order Management subsystem URLs