Vendor Integration - Ordering

Ordering

 

How it works

This is an option for vendors that don't have their own electronic order API (or for other reasons prefer to use this way to communicate order messages with our clients).

FTP

  1. FTP contains three root directories.

    • /ORDERS - Contains XML files with ORDERS documents. One file per order. File name format is  wmxorder_<internal-webmercs-id>.xml
    • /ORDRSP - Contains unprocessed order response (ORDRSP) documents. Each file should only contain information about one order, but multiple files for the same order is ok.
    • /DESADV - Contains unprocessed dispatch advice (DESADV) documents. Each file should only contain information about one order, but multiple files for the same order is ok.

  2. For each placed order we immediately send XML file with ORDERS document by FTP to the ORDERS directory.

  3. You periodically check ORDERS directory and process new files. Processed files may be removed from this directory (doesn't matter for us).

  4. For each received order you send XML files with ORDRSP and/or DESADV documents. ORDRSP is not required, but recommended, We will process DESADV messages even if there's no ORDRSP for the orders.

  5. We periodically check FTP directories ORDRSP and DESADV and process new files. Successfully processed files are removed from these folders (but we store them in archive on our servers). In case of processing error, file is moved to sub-directory ERROR.

Activation

To enable FTP ordering send request to support. You can specify which FTP should be used:

  • Webmercs FTP - we will prepare FTP for you.
  • Your own FTP - you should provide adress/username/password.

In case of Your own FTP you should also create three root directories ORDERS, ORDRSP, DESADV.

 

Web Service

Interface

Methods
GetOrders

Returns a list of new orders. Order is considered new until one of three possible responses (listed below) is received.

Class GetOrdersResult represents a list of orders where order class OrderRequest corresponds to the ORDERS document.

SendOrderAcknowledgment

Send an acknowledgment message to inform that order is succesfully received. Method is used just to remove received order from list of new orders which are returned by GetOrders method.

Class OrderAcknowledgment corresponds to the ORDACK document.

SendOrderResponse

Send an order response message.

Class OrderResponse corresponds to the ORDRSP document.

SendOrderDespatchAdvice

Send an order despatch advice message.

Class OrderDespatchAdvice corresponds to the DESADV  document.

Possible errors
CodeDescription
1001Authentication failed. Check login \ password.
1002Internal error.
1003Some required properties are not provided or empty. See details in the exception message.
1004Order not found. Check CustomerID \ CustomerPO properties.
1005Invalid order response status. Check property Status of OrderResponse class. Possible values "Accepted" (1) and "Rejected" (2).
1006Invalid order status. (minus) < add examples >
1007Invalid XML structure.
1008Invalid property format

Activation

 To enable Web Service ordering send request to support. We will provide login/password to access it.

 

Email

For each placed order we immediately send email to you with ORDERS document as an attachment. No way to send responses by email, please use FTP or Web Service for that.

Activation

To enable Email notifications send request to support. You should specify email address(es) to which you will receive ORDERS documents.

 

Documents

TypeDirectionDescriptionWeb ServiceFTPEmail
ORDERSoutgoingOrder request.(tick)(tick)(tick)

ORDRSP

incomingOrder response.(tick)(tick) 
DESADVincomingOrder despatch advice.(tick)(tick) 
ORDACKincomingOrder acknowledgment.(tick)  
Common notes
  • Required segments\fields must exist in the document with non-empty values.
  • Optional segments\fields are either missing in the document, or have an empty value.

Order Request (ORDERS) 

<?xml version="1.0" encoding="utf-8"?>
<OrderRequest xmlns="http://webmercs.com/vis/public">
  <OrderHeader>
    <CustomerID></CustomerID>
    <CustomerPO></CustomerPO>
    <OrderDateTime></DateTime>
    <SplitOrder></SplitOrder>
    <ShippingMethod></ShippingMethod>
	<RequestedDeliveryDate></RequestedDeliveryDate> 
    <Comment></Comment> 
    <BillTo>
      <Name></Name>
      <Company></Company>
      <Department></Department>
      <Street></Street>
      <City></City>
      <StateProvince></StateProvince>
      <Zip></Zip>
      <Country></Country>
      <Phone></Phone>
      <Email></Email>
    </BillTo>
    <ShipTo>
      <Name></Name>
      <Company></Company>
      <Department></Department>
      <Street></Street>
      <City></City>
      <StateProvince></StateProvince>
      <Zip></Zip>
      <Country></Country>
      <Phone></Phone>
      <Email></Email>
      <EndUserPO></EndUserPO>
    </ShipTo>
  </OrderHeader>
  <OrderLines>
    <OrderLine>
      <LineNumber></LineNumber>
      <VendorSKU></VendorSKU>
      <WmxSKU></WmxSKU>
      <Description></Description>
      <Qty></Qty>
      <ExpectedPrice></ExpectedPrice>
      <Bid>
        <ClaimNo></ClaimNo>
        <Price></Price>
      </Bid>
      <Comment></Comment>
    </OrderLine>
  </OrderLines>
</OrderRequest>

<OrderHeader> segment

FieldRequiredData TypeDescriptionSample

CustomerID

yesstring

Customer identifier in a vendor system which is provided on setup step.

"CID-898800"

CustomerPO

yesstringUnique order request identifier in Webmercs system."3445FHY-2"

OrderDateTime

yesdateTime

Date and time when Webmercs received order request from customer.  

2012-10-25T12:50:12+01:00

SplitOrder

yesstringPossible values: "Yes", "No"."Yes"

ShippingMethod

nostring  

RequestedDeliveryDate

nodateTimeCustomer may ask for a particular delivery date.2012-10-30
CommentnostringCustomer's comment."Test order, do not ship!"
ShipToyes Shipping address, see <ShipTo> segment. 

BillTo

no 

Billing address. Same fields as <ShipTo> segment, except EndUserPO.

 

<ShipTo> segment

FieldRequiredData TypeDescriptionSample

Name

yesstringContact person name."Mike Petrov"
CompanynostringCompany name."Horns and Hooves"
DepartmentnostringDepartment name."Accounting"
StreetyesstringAddress line."Rådhusplassen 99"
CityyesstringCity name."Oslo"
StateProvincenostringState or province name or code. 
ZipyesstringPostcode."0160"
CountryyesstringTwo letter country code (ISO 3166-1 alpha-2)."NO"
PhonenostringContact person phone."11100999"
EmailnostringContact person email."mike@hh.com"
EndUserPOnostringContact person PO."HH-0289"

<OrderLine> segment

FieldRequiredData TypeDescriptionSample

LineNumber

yesintSequential number of order line, starting from 1.1

VendorSKU

yesstringProduct identifier in a vendor system."SMT3000RMI2U"

WmxSKU

yesstringProduct identifier in Webmercs system."3931244"

Description

yesstringProduct description from Webmercs catalog."APC Smart UPS 3000VA"

Qty

yesintQuantity.10

ExpectedPrice

nodecimalVendor price from customer's catalog.8700.0

Bid

no   

ClaimNo

nostring  

Price

nodecimal  

Comment

nostringCustomer's comment."Cancel if real price is higher."

Order Response (ORDRSP) 

Example.

<?xml version="1.0" encoding="utf-8"?>
<OrderResponse xmlns="http://webmercs.com/vis/public">
  <CustomerID></CustomerID>
  <CustomerPO></CustomerPO>
  <Status></Status>
  <Message></Message>
  <VendorOrderID></VendorOrderID>
</OrderResponse>

<OrderResponse> segment

FieldRequiredData TypeDescriptionSample

CustomerID

yesstringCustomer identifier in a vendor system, the same value as in ORDERS document."CID-898800"

CustomerPO

yesstringOrder identifier in Webmercs system, the same value as in ORDERS document."3445FHY-2"

Status

yesstringPossible values: "Accepted", "Rejected"."Accepted"

Message

nostringVendor's comment.

"Estimated delivery date is 21/10/2012"

VendorOrderID

yes, when "Accepted"

stringOrder identifier in a vendor system."VND-O888"

Despatch Advice (DESADV) 

<?xml version="1.0" encoding="utf-8"?>
<DespatchAdvice xmlns="http://webmercs.com/vis/public">
  <CustomerID></CustomerID>
  <CustomerPO></CustomerPO>
  <VendorOrderID></VendorOrderID>
  <OrderLines>
    <OrderLine>
      <LineNumber></LineNumber>
      <VendorSKU></VendorSKU>
      <Qty></Qty>
      <Price></Price>
      <SerialNumbers>
        <SerialNo></SerialNo>
      </SerialNumbers>
    </OrderLine>
  </OrderLines>
  <TrackingLines>
    <TrackingLine>
      <TrackingNo></TrackingNo>
      <ShipMethod></ShipMethod>
      <TrackingURL></TrackingURL>
    </TrackingLine>
  </TrackingLines>
</DespatchAdvice> 

<DespatchAdvice> segment

FieldRequiredData TypeDescriptionSample

CustomerID

yesstringCustomer identifier in a vendor system, the same value as in ORDERS document"CID-898800"
CustomerPOyesstringOrder identifier in Webmercs system, the same value as in ORDERS document."3445FHY-2"
VendorOrderID
yesstringOrder identifier in a vendor system."VND-O888"

OrderLines

yes Contains list of <OrderLine> segments. 

TrackingLines

no Contains list of <TrackingLine> segments. 

<OrderLine> segment

FieldRequiredData TypeDescriptionSample
LineNumber yesintNumber of order line from ORDERS document.1
VendorSKU yesstringProduct identifier in a vendor system, the same value as in ORDERS document. 

Qty

yesintQuantity. 

Price

yesdecimalPrice. 

SerialNumbers

no List of serial numbers. 

SerialNo

yesstringSerial number. 

<TrackingLine> segment

FieldRequiredData TypeDescriptionSample
TrackingNoyesstringPackage\tracking number. 
ShipMethod
nostringShipping service (company) and method. 
TrackingURL
nostringURL to check package status. 

Order Acknowledgment (ORDACK) 

(warning) Web Service ordering only.

The Order Acknowledgment document is used to inform that the Order Request document is received. 

<?xml version="1.0" encoding="utf-8"?>
<OrderAcknowledgment xmlns="http://webmercs.com/vis/public">
  <CustomerID></CustomerID>
  <CustomerPO></CustomerPO>
<OrderAcknowledgment>

<OrderAcknowledgment> segment

FieldRequiredData TypeDescriptionSample
CustomerIDyesstringCustomer identifier in a vendor system, the same value as in ORDERS document"CID-898800"
CustomerPOyesstringOrder identifier in Webmercs system, the same value as in ORDERS document."3445FHY-2"