...
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?>
<Orders> <!--(Only with file upload)-->
<Order>
<Products>
<Product>
<Number>Product Number</Number>
<SetID>Compression Number</SetID>
<Set>
<PIndex>Product Index of the Set Upper Article</PIndex>
<PVarIndex>Variation Index of the Set Upper Article</PVarIndex>
<CVarIndex-X> Variation Index of the Xth Set Sub Article</CVarIndex-X>
<child>
<index>Product Index of the Set Sub Article</index>
<varindex>Variation Index of the Set Sub Article</varindex>
</child>
</Set>
<SetIDUserIndex>UserIndex</SetIDUserIndex>
<Quantity>Quantity</Quantity>
<Price>Product price</Price>
<Length>Product length</Length>
<Width>Product width</Width>
<countryofproduction>Country or location of production</countryofproduction>
<ForceW2PFlag>yes</ForceW2PFlag>
<Variations>
<Variation>
<Name>Variation Name</Name>
<Value>Variation Value</Value>
</Variation>
<Variation>
<Name> Variation Name</Name>
<Value> Variation Value</Value>
</Variation>
<!-- ... -->
</Variations>
<TextInputs>
<TextInput>
<Name> Text Field Name</Name>
<Value>Text Field Value</Value>
</TextInput>
<TextInput>
<Name> Text Field Name</Name>
<Value> Text Field Value</Value>
</TextInput>
<!-- ... -->
</TextInputs>
<DeliverySplit>
<+Entry>
<DeliveryAddressID></DeliveryAddressID>
<DeliveryQuantity></DeliveryQuantity>
<SampleCopy>yes</SampleCopy>
</+Entry>
</DeliverySplit>
</Product>
<!-- ... -->
</Products>
<Payment>
<Code>Payment Method Code</Code>
<Debit>
<ExternalID>ExternalID</ExternalID>
<AccountHolder>Account Holder</AccountHolder>
<BankName>Name of Credit Institution</BankName>
<AccountNumber>Account No.</AccountNumber>
<BankCode>Bank Code</BankCode>
<IBAN>IBAN</IBAN>
<BIC>BIC</BIC>
</Debit>
<CreditCard>
<Holder>Card Holder</Holder>
<BrandID>Card Type</BrandID>
<Number>Card No. Without Spaces </Number>
<ExpiryDate>Expiry Date</ExpiryDate>
<VerificationCode>Card Verification Code</VerificationCode>
</CreditCard>
</Payment>
<Delivery>
<Code>Delivery Code</Code>
<ID>Delivery Service ID</ID>
</Delivery>
<OrderOptions>
<ResellerSurcharge>Reseller Surcharge</ResellerSurcharge>
<Reference>Reference Text 1</Reference>
<Reference2>Reference Text 2</Reference2>
<OrderOptions1-Entry>Option Number</OrderOptions1-Entry>
<OrderOptions2-Entry>Option Number</OrderOptions2-Entry>
<OrderOptions3-Entry>Option Number</OrderOptions3-Entry>
<OrderOptions4-Entry>Option Number</OrderOptions4-Entry>
<OrderOptions5-Entry>Option Number</OrderOptions5-Entry>
</OrderOptions>
<OrderSpecialInput>
<!-- Optional additional information for the order -->
</OrderSpecialInput>
<Voucher>
<Number>Voucher Code</Number>
</Voucher>
<BillingAddress>
<!-- (Billing Address Data) -->
</BillingAddress>
<DeliveryAddress>
<!-- (Data of the alternative delivery address) -->
<+Entry>
<DeliveryAddressID></DeliveryAddressID>
</+Entry>
</DeliveryAddress>
<ClimateNeutral> Support climate-neutral production </ClimateNeutral>
</Order>
</Orders><!--(Only with file upload)--> |
...
Code Block | ||
---|---|---|
| ||
<Products>
<Product>
<Number>Product Number</Number>
<SetID>Compression Number</SetID>
<Set>
<PIndex>Product Index of the Set Upper Article</PIndex>
<PVarIndex>Variation Index of the Set Upper Article </PVarIndex>
<CVarIndex-X> Variation Index of the Xth Set Sub Article </CVarIndex-X>
<child>
<index>Product Index of the Set Sub Article</index>
<varindex>Variation Index of the Set Sub Article</varindex>
</child>
</Set>
<SetIDUserIndex>UserIndex</SetIDUserIndex>
<Quantity>Quantity</Quantity>
<Price>Product Price</Price>
<Length>Product length</Length>
<Width>Product width</Width>
<countryofproduction>Country or location of production</countryofproduction>
<ForceW2PFlag>yes</ForceW2PFlag>
<Variations>
<Variation>
<Name>Variation Name</Name>
<Value>Variation Value</Value>
</Variation>
<Variation>
<Name>Variation Name</Name>
<Value>Variation Value</Value>
</Variation>
<!-- ... -->
</Variations>
<TextInputs>
<TextInput>
<Name>Text Field Name</Name>
<Value>Text Field Value</Value>
</TextInput>
<TextInput>
<Name>Text Field Name</Name>
<Value>Text Field Value</Value>
</TextInput>
<!-- ... -->
</TextInputs>
<DeliverySplit>
<+Entry>
<DeliveryAddressID>ID of the delivery address</DeliveryAddressID>
<DeliveryQuantity>Quantity</DeliveryQuantity>
<SampleCopy>yes</SampleCopy>
</+Entry>
</DeliverySplit>
</Product>
<Product>
<!-- (Data of the 2nd Product) -->
</Product>
<!-- ... -->
<Product>
<!-- (Data of the 100th Product) -->
</Product>
</Products> |
Parameter | Optional / Required | Description |
---|---|---|
Products | Req. | Transfer of all products. |
Product | Req. | Transfer of an individual product. This section can be repeated up to 100 times. Therefore up to 100 products can be transferred. |
Number | Req. if the SetID is missing Type: C128 | Unique product number. This can also be the product number of an independent variable. |
SetID | Req. if the number is missing Type: C64 | Only possible with sets. A SetID for each set combination can be defined and saved in advance by the shop. One of the saved SetIDs is transferred here. |
| Req. if Number or SetID is missing | Alternative/direct transfer of a set without SetID. In this case the complete set with all set sub articles must be stated.
|
| Req. if Number or SetID is missing | Alternative/direct transfer of a set without SetID. In this case a variation index can be stated for each set sub article (in an own Child-section) The first completly defined variation combination will be used for not-transferred variation indexes Set sub articles are addressed by the product index and variation index. It is not required to know the exact structure of the set. The order of the transferred variation indexes is not relevant. A transferred variation index is only used once. For multiple assignments (if the set contains a product more than once) the index can be stated multiple times and will be processed in the order of the entries. All transferred child-sections must also be used for the order: If at least one transferred child-section can not be processed (e. g. because the set article does not contain a set sub article with the transferred variation index), an error will be returned. It is not possible to use CvarIndex-X-sections and Child-section within a set. In this case the following data will be transferred:
|
SetIDUserIndex | Opt. | The SetID should be loaded by another user. |
Quantity | Opt. Type: I or F | Optional amount. If this parameter is missing or empty, then the amount is "1" |
Length | Req. if | Length of the product |
Width | Req. if | Width of the product |
Price | Opt. Type: F | Optional position item price. If available, this is used instead of the item price in the product data. |
countryofproduction | Opt. | 3-digit ISO code of the country in which the product is to be produced OR location of production in the form 3ISO-ALPHANUM (ISO code, hyphen separator, alphanumeric identifier of the location of production). If a production location is specified, this is separated and transferred in the field ProductionLocationIdentifier in the order data for the product. |
ForceW2PFlag | Opt. | Flag for identifying W2P orders. |
Variations | Opt. | Transfer of normal variations |
Variation | Opt. | Transfer of a normal variation |
Name | Req. for normal variations Type: C128 | Variation name, for example, "color," "size," "height," "width," etc. Please take note! |
Value | Req. for normal variations Type: C128 | Variations value, for example, "red," "44," etc. Please take note! |
TextInputs | Opt. | Transfer of text entry fields |
TextInput | Opt. | Transfer of a text entry field |
Name | Req. for text entry field Type: C128 | Name of the text entry field, for example, "stock," "label," etc. Please take note! The variation names must be exactly the same as the variation names defined in the shop and to the product |
Value | Req. for text entry field Type: C255 | Value of the text entry field, for example, "Müller," "My small farm," etc. |
| optional | Only for Multi-ALA-Split (Split-Order) DeliveryAddressID is also defined for <DeliveryAddresses> DeliveryQuantity - Quantity of splits SampleCopy - specimen copy |
...
Code Block | ||
---|---|---|
| ||
<Payment> <Code>Payment method code</Code> <Debit> <ExternalID>External ID</ExternalID> <AccountHolder>Account Holder</AccountHolder> <AccountNumber>Account Number</AccountNumber> <BankCode>Bank Code</BankCode> <BankName>Name of Credit Institution</BankName> <IBAN>IBAN</IBAN> <BIC>BIC</BIC> </Debit> <CreditCard> <Holder>Card Holder</Holder> <BrandID>Card Type</BrandID> <Number>Card No. without Spaces</Number> <ExpiryDate>Expiry Date in Format: YYYY-MM</ExpiryDate> <VerificationCode>Card Verification Code</VerificationCode> </CreditCard> </Payment> |
The Section <Debit>...</Debit> is only given with the method of payment "direct debit." Otherwise this section is completely absent.
The Section <CreditCard>...<CreditCard> is only given with the method of payment "credit card." Otherwise this section is completely absent.
...
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <response> <basicdata> <date>Date in Format DD.MM.YYYY</date> <time>Time in Format HH:MM:SS</time> <mallid>Mallid</mallid> <shopid>ShopID</shopid> <subshopid>SubShopID</subshopid> <result>”OK” or “ERROR”</result> <!-- The parameter “errorcode“ occurs only with the result=ERROR --> <errorcode>Error code</errorcode> <!-- The parameters "errordetail1" and "errordetail2" are set with many errors.--> <errordetail1>Error description 1</errordetail1> <errordetail2>Error description 2</errordetail2> </basicdata> <!-- The section <orderdata>...</orderdata> occurs only if result=OK --> <orderdata> <ordernumber>Order number</ordernumber> <subtotal>Subtotal</subtotal> <resellersurcharge>Reseller surcharge </resellersurcharge> <!-- Optional --> <paymentcost>Payment method costs</paymentcost> <!-- Optional --> <deliverycost>Delivery costs</deliverycost> <!-- Optional --> <totaldiscount>Total discount</totaldiscount> <!-- Optional --> <vat>VAT</vat> <!-- Optional, only for netto-prices --> <totalsum>Total sum</totalsum> <uploadids> <!-- Optional --> <uploadid> <UploadID>.<PositionID> </uploadid> <!-- ... --> </uploadids> <items> <item> <!--for each order position --> <position>Position in Basket</position> <number>Product number</number> <quantity>Amount</quantity> <sum>Total sum of position</sum> </item> <!-- ... --> </items> </orderdata> </response> |
Triggering an ASSE process
A section can be defined in the configuration that allows an ASSE process to be triggered for each order item.
To do this, the configuration must be extended as follows:
Code Block |
---|
<Asse>
active = yes
Template = asse_template.tpl
EventTemplate = asse_event_template.tpl
AsseDirectory = /var/spool/wsasse
</Asse> |
The templates mentioned in the configuration must be stored in the order generator directory of the respective shop.
The template for the ASSE event can be as follows:
Code Block |
---|
{
"properties": {
"content_type": "application/json",
"delivery_mode": 2
},
"routing_key": "websale-ftp",
"payload": "{\"uploadFinished\": \"$DC-FPTimestamp$\",\"shopNumber\": \"$WS-OTPasseordernumber$\",\"uploadId\": \"$WS-OTPasseuploadid$\",\"positionId\": \"$WS-OTPasseposition$\",\"source\": \"websale-ftp\",\"service\": \"autoOrder\",\"uri\": \"sftp://ftp.c1.websale.net:22022/$WS-OTPasseuploadid$/$WS-OTPasseposition$\"}",
"payload_encoding":"string"
} |
It is important here that the correct $WS and $DC tags are used, as these are replaced during the ordering process.
The ASSE template can look like this:
Code Block |
---|
<Header>
ShopID = testshop
SubShopID = $WS-SubshopId$
EventID = wsOrderGeneratorUploadFinished
Timestamp = $DC-FPTimestamp$
EventCounter = 1
</Header>
<EventDeliveryTerms>
Endpoint = https://websale-asse:fNyb5t-dY5zALcVNwyPdg42ShPEVQWeZ@casual-khaki-bobcat.rmq2.cloudamqp.com/api/exchanges/websale/file.upload/publish
Type = POST
ConnectionTimeoutInMS = 5000
ConnectionRetries = 5
ConnectionDelayInMinutes = 10
ServiceCategory = FileUpload
<DefinitionOfOK>
<+ConditionGroup>
<+Condition>
Proof = HTTPStatusCode
Type = value
Value = 200
</+Condition>
</+ConditionGroup>
</DefinitionOfOK>
</EventDeliveryTerms>
<PayloadHEX>
$WS-AsseText$
</PayloadHEX> |
The $WS-AsseText$ tag is replaced by the hex-encoded content of the ASSE event template.
The file is stored under <shopid>_<subshopid>_autoorderUploadFinish-<ordernumber>-<positionnumber>.asse in the directory /var/spool/wsasse.
Rules
An order will only be generated when all transferred data are correct. The following checks are performed by the order generator, among others:
...