HCL Commerce Enterprise

ContractImportApprovedVersion URL

This URL imports a contract in XML format into HCL Commerce.

Note: For a consumer direct Aurora starter store, restart the Search server after you import the default contract. Otherwise, the new contract might not take effect on the storefront because the previous contract ID is cached on the Search server.

URL structure

https://host_name/path/
The fully qualified name of your Transaction server and the configuration path.

Before you issue this URL, you must be logged in to HCL Commerce. You can log in to HCL Commerce by using the Logon command

Parameter values

Note: Do not use the following special characters when you define the distinguished name or contract name as it can cause the contract import to fail:

&, <, >, ', \

fileName
Required: The name of the XML file that you want to import as an approved or active contract. The XML file must be validated with the B2BTrading DTD.

The XML file that is being imported must exist in the location that is specified in the HCL Commerce configuration file. The file must be validated with the B2BTrading DTD or Package.xsd.

The location for the contract XML file to be imported is specified in the XMLPath attribute of the Trading tag in the HCL Commerce configuration file. For example, if the HCL Commerce configuration file contains the following section:


<Trading
DTDFileName="B2BTrading.dtd"
DTDPath="/trading/dtd"
XMLPath="/trading/xml"
XSDPath="/trading/xsd" />

The contract XML file to be imported using this URL must be in WC_eardir/xml/trading/xml.

xsd
Required: Specifies whether the contract XML is DTD- or XSD- based. Valid values for this parameter are true and false. Use true when the contract is XSD-based. Use false when the contract is DTD-base.

If this parameter is not specified, a value of false is assumed.

targetStoreId
If the XML file you are importing states a contract state of "active", you must specify the targetStoreId parameter. The targetStoreId is the store ID from the STORE database table for the store you want to import the contract into.
validate
Specifies whether the contract XML must be validated by the XML parser. Valid values for this parameter are true and false. Use true to have the contract validated. Use false to prevent the contract from being validated by the XML parser.

If this parameter is not specified, a value of true is assumed.

synchronousDeployment
Specifies whether the deployment of the contract must be run as a scheduled job, or the command must not return until the contract deployment is complete. Valid values for this parameter are true and false. Use true to have the contract deployment run as part of the contract import. Use false to have a scheduled job deploy the contract.

If this parameter is not specified, a value of false is assumed.

contractList
Specifies whether the file specified in the fileName parameter contains a list of contract XML files that should be imported. Valid values for this parameter are true and false. Use true to specify that the file in the fileName parameter contains a list of contract XML files. Use false to specify that the file in the fileName parameter is a contract XML file.

If this parameter is not specified, a value of false is assumed.

URL
Required: The URL to be called when the command completes successfully.

Example

The following example imports an "approved" contract:


https://myhostname/webapp/wcs/stores/servlet/ContractImportApprovedVersion?fileName=myspecialcontract.xml
&xsd=true&URL=StoreCatalogDisplay?storeId=512&catalogId=512

Behavior

This URL imports an approved or active contract into the HCL Commerce database from an XML file. Before you import the contract, the command checks to ensure the contract that is being imported meets the following conditions:

  • The contract is not expired
  • The contract is for a buyer participant only
  • There is at least one buyer participant
  • The contract state is active or approved
  • There is at least one pricing term in the contract
  • There is at least one-shipping charge type term in the contract
  • There is no term that allows payment by credit line
  • There is no term that allows payment by purchase orders
  • There is no more than one return charge term
  • There is no display customization term
  • There is no more than one order approval term
  • There is no more than one return charge term
  • There is no more than one right-to-buy term
  • There is no more than one obligation-to-buy term
  • Business policies referred to by the contract terms in the XML file are available in the store
  • Business policies referred to by the contract terms in the XML file are not expired
  • Business policies referred to by the contract terms in the XML file do not expire before the contract expires

Exception conditions

The following exceptions may be thrown by this URL:

  • _ERR_ACCOUNT_DOES_NOT_EXIST will be thrown if the business account cannot be found based on the accountName and accountOwnerId.
  • _ERR_BIZ_POLICY_NOT_AVAILABLE_FOR_STORE will be thrown if the business policy is not available for the store which the contract is going to be deployed to.
  • _ERR_BIZ_POLICY_EXPIRED will be thrown if the policy is expired.
  • _ERR_BUYER_IN_CNTR_DOES_NOT_MATCH_WITH_ACCOUNTHOLDER_IN_ACNT will be thrown if the buyer participant in the contract does not belong to the AccountHolder in the referenced business account.
  • _ERR_BUYER_IN_TC_DOES_NOT_MATCH_WITH_BUYER_IN_ACNT will be thrown if the buyer participant in the contract does not belong to the buyer participants referenced in the business account.
  • _ERR_CANNOT_HAVE_DISPLAY_CUSTOMIZATION_TC_IN_CONTRACT will be thrown if there are display customization terms in the contract.
  • _ERR_CANNOT_HAVE_INVOICE_TC_IN_CONTRACT will be thrown if there are invoice terms in the contract.
  • _ERR_CANNOT_HAVE_MORE_THAN_ONE_OBLIGATION_TO_BUY_BY_AMOUNT_TC will be thrown if there are more than one obligation-to-buy terms in the contract.
  • _ERR_CANNOT_HAVE_MORE_THAN_ONE_ORDER_APPROVAL_TC will be thrown if there are more than one order approval terms in the contract.
  • _ERR_CANNOT_HAVE_MORE_THAN_ONE_RETURN_CHARGE_TC will be thrown if there are more than one return charge terms in the contract.
  • _ERR_CANNOT_HAVE_MORE_THAN_ONE_RIGHT_TO_BUY_BY_AMOUNT_TC will be thrown if there are more than one right-to-buy terms in the contract.
  • _ERR_CANNOT_HAVE_MORE_THAN_ONE_SELLER will be thrown if the contract has more than one seller participant.
  • _ERR_CANNOT_HAVE_PAYMENT_TC_WITH_CREDIT_LINE_IN_CONTRACT will be thrown if there are credit line payment terms in the contract.
  • _ERR_CANNOT_HAVE_PURCHASE_ORDER_TC_IN_CONTRACT will be thrown if there are purchase order terms in the contract.
  • _ERR_COLUMN_ACCESSBEANNAME_IN_PATTRIBUTE_NOT_POPULATED will be thrown if in the OrderTCOrderItemPAttribute or PaymentTC, the attribute that is specified in XML file does not have column accessbeanname pre-populated in the PATTRPROD database table.
  • _ERR_CONTRACT_EXPIRED will be thrown if the contract is expired.
  • _ERR_CONTRACT_REFERENCE_NUMBER_NOT_REQUIRED will be thrown if referenceNumber attribute is provided in the XML file.
  • _ERR_DO_NOT_REFERRED_TO_ACCOUNT_WHEN_CREDIT_ALLOWED will be thrown if creditAllowed is set to true but there is no account information in the contract.
  • _ERR_DUPLICATED_CONTRACT_NAME will be thrown if there are other contracts that have the same contract name.
  • _ERR_DUPLICATE_KEY_IN_PROCESSING_TC will be thrown if while trying to create an entry in TERMCOND table and its associated table the unique index of the new entry is the same of an existing entry.
  • _ERR_INVALID_CONTRACT_EXPIRED_DATE will be thrown if the expired date for the contract is after the expiry date of any policy referred to by the terms and conditions of the contract.
  • _ERR_MBRGRP_BUYER_CANNOT_REFER_ACCOUNT will be thrown if the buyer participant specified in the contract is a memberGroup and the contract refers to an account.
  • _ERR_MISSING_ACCOUNT_NAME will be thrown if the AccountOwner element is provided, but the accountName attribute is missing from the Contract element attribute list.
  • _ERR_MISSING_ACCOUNT_OWNER_ELEMENT will be thrown if the accountName is specified in the Contract element attribute list, but the AccountOwner element is missing.
  • _ERR_MISSING_BUYER_PARTICIPANT will be thrown if there is no buyer participant in the contract.
  • _ERR_MISSING_CONTRACT_NAME will be thrown if the Name attribute in Contract element is an empty string or a space.
  • _ERR_MISSING_PRICE_TC will be thrown if there is no pricing term specified in the contract.
  • _ERR_MISSING_SELLER_PARTICIPANT will be thrown if there is no seller participant specified in the contract and the contract does not refer to an account.
  • _ERR_MISSING_SHIPPING_CHARGE_TC will be thrown if there is no shipping charge term is specified in the contract.
  • _ERR_NEED_PAYMENT_TC_WITH_CREDIT_IN_ACCOUNT will be thrown if creditAllowed is set to true but there is not credit payment term in the referred account.
  • _ERR_PATTRIBUTE_NOT_REGISTERED_IN_TABLE_PATTRPROD_FOR_CATENTRY will be thrown if in the OrderTCOrderItemPAttribute, the CatEntry, and attribute pair are not registered in the PATTRPROD database table.
  • _ERR_RETRIEVE_CATENTRY_ID will be thrown if a CATENTRY ID cannot be retrieved based on the information that is provided in OrderTCOrderItemPAttribute element.
  • _ERR_RETRIEVE_FFMCENTER_ID will be thrown if a FFMCENTER ID cannot be retrieved based on the information that is provided in FulfillmentCenter element.
  • _ERR_RETRIEVE_MEMBER_ID will be thrown if a MEMBER ID cannot be retrieved based on the information that is provided in Member element.
  • _ERR_RETRIEVE_OPERATOR_ID will be thrown if a OPERATOR ID cannot be retrieved based on the information that is provided in Operator attribute of AttributeValue element.
  • _ERR_RETRIEVE_PATTRIBUTE_ID will be thrown if a PATTRIBUTE ID cannot be retrieved based on the information that is provided in AttributeDetail element.
  • _ERR_RETRIEVE_POLICY_ID will be thrown if a POLICY ID cannot be retrieved based on the information that is provided in PolicyReference element.
  • _ERR_SELLER_DO_NOT_MATCH_TO_SELLER_IN_ACCOUNT will be thrown if the seller participant in the contract is not the same as the seller participant in the referenced business account.
  • _ERR_TERM_CONDITION_PARTICIPANT_ROLE will be thrown if the contract terms and conditions specify a non-buyer participant.
  • _ERR_TOO_MANY_FULFILLMENT_TC will be thrown if there are more than three fulfillment center terms in the XML file.
  • _ERR_VERSION_NUMBER_FORMAT will be thrown if the majorVersionNumber or minorVersionNumber attributes of the Contract element of the contract XML file are not numeric.
  • _ERR_WRONG_ACCOUNT_OWNER_INFO will be thrown if the account owner ID cannot be retrieved based on the information that is provided in AccountOwner element.
  • _ERR_WRONG_CONTRACT_OWNER_MEMBER_INFO will be thrown if the contract owner ID cannot be retrieved from the database based on the information that is provided in the ContractOwner element.
  • _ERR_WRONG_CONTRACT_STATE will be thrown if the contract state is not in either the Approved or Active states.