DynamicKitConfigurationAdd URL
Configure dynamic kits. A kit contains multiple products, is ordered and returned as a unit, and has one price and one SKU that is, a dynamic kit is a catalog entry with a SKU. The information about the products contained in a dynamic kit is controlled by an external configurator. The configurator is a tool which determines the list of SKUs. To order the kit, the customer must determine the configuration, which is a list of component SKUs. This URL is typically invoked after interaction with a configurator.This command creates an order item with an associated component list. Typically the buyer may change the quantity of the kit (thereby correspondingly multiplying the quantities of components), but a buyer may not manipulate the component list except through interaction with the configurator.
The configuration passed in this command may optionally include the price. If price is not included, then WebSphere Commerce will compute the price using dynamic kit pricing rules.
There are two methods of calling this URL: through an XML string or through URL parameters. They are not mutually exclusive, so both methods can be used together. Values in the XML string always take precedence.
If the xmlConfiguration parameter is not passed, a 'bad or missing parameter' exception will be thrown. More information about the XMLConfiguration parameter follows.
URL structure
- http:// host_name/ path/
- The fully qualified name of your WebSphere Commerce server and the configuration path.
Parameter values
The following parameter values are applicable if you are using the XML calling method for the DynamicKitConfigurationAdd command.
- xmlConfiguration
- An XML file that defines how the dynamic kit should be configured. The XML should use the following DTD (productConfiguration.dtd), which defines the XML file that should be used with the URL calling method
<!ELEMENT Configuration (ComponentList)> <!ATTLIST Configuration ConfigurationId CDATA #REQUIRED ReferenceId CDATA #IMPLIED ConfiguratorURL CDATA #IMPLIED WCSURL CDATA #IMPLIED DynamicKitId CDATA #IMPLIED> <!ELEMENT ComponentList (Component+)> <!ATTLIST ComponentList Currency CDATA #IMPLIED> <!ELEMENT Component EMPTY> <!ATTLIST Component WCSItemId CDATA #IMPLIED WCSPartNumber CDATA #IMPLIED MemberId CDATA #IMPLIED Quantity CDATA #REQUIRED UnitPrice CDATA #IMPLIED>The following is a sample XML file:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configuration SYSTEM "productConfiguration.dtd"> <Configuration ConfigurationId = "250" DynamicKitId = "15555"> <ComponentList Currency = "CAD"> <Component WCSItemId = "1111" Quantity = "5" UnitPrice = "50.00"/> <Component WCSPartNumber = "ABC-1112" MemberId = "15" Quantity = "6" UnitPrice = "55.00"/> <Component WCSItemId = "1113" Quantity = "7" UnitPrice = "60.00"/> </ComponentList> </Configuration>
- URL
- (Required) The URL to be called when the command completes successfully.
The following parameter values are applicable if you are using the URL parameters calling method for the DynamicKitConfigurationAdd command.
You must specify the same number of values for the repeated parameters (that is, one value for each component). For example, if you specify 10 values for componentId, then specify 10 values for quantity, 10 values if you specify the price, and so on. This enables the first quantity and price to be associated with the first component, the second quantity and price to be associated with the second component, and so on.
- configurationId
- (Required) The unique configuration ID that represents this configuration. If xmlConfiguration is specified, a value in the XML for ConfigurationId overrides this parameter.
- catEntryId
- (Required) The ID of the dynamic kit catalog entry. If xmlConfiguration is specified, a value in the XML for DynamicKitId overrides this parameter.
- currency
- (Required if prices are specified) The currency in which the prices of the components within the dynamic kit are supplied. If xmlConfiguration is specified, a value in the XML for Currency overrides this parameter.
- URL
- (Required) The URL to be called when the command completes successfully.
- componentId
- (Required only if partNumber is not provided) The ID of the catalog entry that represents a component of the dynamic kit. Specify a componentId for each component in the kit. If xmlConfiguration is specified, values in the XML for WCSItemId override this parameter.
- partNumber
- (Required only if componentId is not provided. Do not specify if componentId is specified.) The part number of the catalog entry that represents a component of the dynamic kit. Specify a partNumber for each component in the kit. If xmlConfiguration is specified, values in the XML for WCSPartNumber override this parameter.
- memberId
- If partNumber is specified then memberId is used to determine the componentId from the partnumber+memberid unique index. If not specified, memberId defaults to the memberId of the current store's organization. If xmlConfiguration is specified, values in the XML for MemberID override this parameter.
- quantity
- (Required) The number of this component in the dynamic kit. If xmlConfiguration is specified, values in the XML for Quantity override this parameter.
- price
- The price of this component. This value is optional; however, if a price is supplied for one component, then every other component also requires a price. If xmlConfiguration is specified, values in the XML for UnitPrice override this parameter.
Example
The following example describes a configuration 250 for a dynamic kit with catentryId 15555. The components of the configuration are three WebSphere Commerce items: 1111, "ABC-1112", and 1113. The quantities and unit prices for each are as follows:
- 5 units of item 1111 at $50 Canadian dollar (CAD) per unit.
- 6 units of item 1112 at $55 CAD per unit.
- 7 units of item 1113 at $60 CAD per unit.
http://myhostname/webapp/wcs/stores/servlet/DynamicKitConfigurationAdd? &configurationId=250&catEntryId=15555¤cy=CAD &componentId=1111&quantity=5&price=50 &componentId=1112&quantity=6&price=55 &componentId=1113&quantity=7&price=60
Behavior
- If the xmlConfiguration parameter is specified, the GetDynamicKitConfigurationDefinitionCmd task command is called to parse the specified XML string to obtain overriding parameter values.
- The AddOrderItemComponentsCmd task command is called to create the configuration.
- The "viewTaskName" response property is set to "RedirectView".
- The "catEntryId" response property is set to the catalog entry identifier for the specified DyanmicKit.
- The "configurationId" response property is set to the specified configuration identifier.
Exception conditions
- If a required parameter is not specified, ECApplicationException is thrown with error message _ERR_BAD_MISSING_CMD_PARAMETER and the name of the missing parameter.
- If the specified DynamicKit catalog entry does not exist, ECApplicationException is thrown with error message _ERR_SEPARATING_CAT_ENTRIES.
Related concepts
Order Management subsystemRelated tasks
Create reseller bundles and kits (reseller)Related reference
Order Management subsystem URLs