This URL adds a new payment method to an order. Invocation of this command causes an event-driven payments edit event to occur.
URL structure
- http://host_name/path/
- The fully qualified name of your WebSphere Commerce Server and the configuration path.

Parameter values
- orderId
- (Required) The identifier of the order to which the payment method is to be added.
- URL
- (Required) The URL to be called when the command completes successfully.
- piAmount
- (Required) The amount in the order currency to be used for this payment method. The format of this number must fit the rules for a java.math.BigDecimal object. The number must use a period for a decimal place.
- payMethodId
- (Required) The payment method identifier. See Payment methods for a list of methods supported by WebSphere Commerce (payment methods are configurable).
- protocolData
- Additional name-value pairs separated by an ampersand (&) that will be passed to the payment plug-in or payment processor as additional data required by that payment protocol. For example, for a credit card, &cc_brand=AMEX.
Example 1
The following example adds the AMEX credit card payment method to order 112233, for an amount of 105.50 USD, with protocol data values for the credit card account, brand, and expiration. The assumption is that the order already exists and is using USD as the currency.
http://host_name/webapp/wcs/stores/servlet/PIAdd?orderID=112233&piAmount=105.50 &payMethodId=AMEX&URL=/ &cc_nameoncard=Jane+Smith &billto_address1=4911+Sunnybrook+Dr &billto_city=Beverly+Hills &billto_stateprovide=CA &billto_zipcode=90210 &billto_country=USA &account=account_value &cc_brand=AMEX &expire_month=09 &expire_year=2005
Example 2
The following example adds the electronic check payment method to order 112233, for an amount of 300 USD, and supplies the check routing number required by that payment method to perform the transaction. The assumption is that the order already exists and is using USD as the currency.
http://host_name/webapp/wcs/stores/servlet/PIAdd?orderID=112233&piAmount=300 &payMethodId=eCheck&URL=/ &account=account_value &check_number=1159 &check_routing_number=123456789
Behavior
Adds a payment instruction to an existing order. Calls the EditCmd task command to add the payment instruction to the order.
- Validates that the required parameters are passed: orderId, paymentMethodId, piAmount, and URL.
- Creates an EDPPaymentInstruction with the payment method ID, the amount, and any payment protocol data supplied (protocol data specified as name-value pairs).
- Adds the EDPPaymentInstruction to an empty list.
- Calls the EditCmd task command with the list of payment methods, the total order amount (calculated from total product price, total tax, total shipping, total shipping tax, total adjustment) and the orderId.
- Examines the results of the task command for an error and redirects to an error page. Otherwise, it redirects to the URL that was passed as a parameter.
Exception conditions
- ECSystemException
- ECApplicationException