Reference > Shop flow URLs > Trading subsystem URLs > Account and contract URLs
ContractImportApprovedVersion URL
This URL imports a contract in XML format into WebSphere Commerce.
URL structure
- https:// host_name/path/
- The fully qualified name of the WebSphere Commerce Server and the configuration path.
name-value pair with the & character. For a detailed description of the parameters and their values, see the list entitled Parameter values." />
Before issuing This URL, be logged into WebSphere Commerce. You can log in to WebSphere Commerce using the Logon command
Parameter values
- fileName
- Required: The name of the XML file that to import as an approved or active contract. The XML file must be validated with the B2BTrading DTD.
The XML file being imported must exist in the location specified in the WebSphere Commerce configuration file, and 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 WebSphere Commerce configuration file. For example, if the WebSphere 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_EAR/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", specify the targetStoreId parameter. The targetStoreId is the store ID from the STORE database table for the store to import the contract into.
- validate
- Specifies whether the contract XML should 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 should be run as a scheduled job, or the command should not return until the contract deployment has completed. 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 WebSphere Commerce database from an XML file. Before importing the contract, the command checks to ensure the contract 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 allowing payment by credit line
- there is no term allowing 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 have 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 cannot find the business account 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 participants 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 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 having the same contract name.
- _ERR_DUPLICATE_KEY_IN_PROCESSING_TC will be thrown if while trying to create a 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 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 pattribute 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 provided in OrderTCOrderItemPAttribute element.
- _ERR_RETRIEVE_FFMCENTER_ID will be thrown if a FFMCENTER ID cannot be retrieved based on the information provided in FulfillmentCenter element.
- _ERR_RETRIEVE_MEMBER_ID will be thrown if a MEMBER ID cannot be retrieved based on the information provided in Member element.
- _ERR_RETRIEVE_OPERATOR_ID will be thrown if a OPERATOR ID cannot be retrieved based on the information provided in Operator attribute of AttributeValue element.
- _ERR_RETRIEVE_PATTRIBUTE_ID will be thrown if a PATRRIBUTE ID cannot be retrieved based on the information provided in AttributeDetail element.
- _ERR_RETRIEVE_POLICY_ID will be thrown if a POLICY ID cannot be retrieved based on the information 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 3 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 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 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.