MYOB Greentree

HideShow

  • Contents
  • Index
  • Search
 
Display results with all search words

 

Schema for an XML Order


Webstore has its own XML schema for placing an XML order. You cannot change this schema.

An XML schema defines the names of XML elements and attributes looked for when processing an XML document. This XML structure detail must be known to enable a third party to create an XML document that Greentree Desktop recognises. Some elements are required and others are optional. If any required element is not in the XML file, that XML file can't process and an error displays.

Below is an example of the content of a typical XML file that would be used to place a sales order using Webstore. The red elements are required, the blue elements are optional, the green elements are just grouping elements, everything else in black is text within elements. With optional elements, if any are to be included, then all parent optional and required elements must also be included.

<?xml version=1.0?>

<PurchaseOrder>

 <OrderHeader>

         <Authorisation>

                 <Login>guest</Login>

                 <Password>guest</Password>

         </Authorisation>

         <RequestedDeliveryDate>

                 <DayOfMonth>15</DayOfMonth>

                 <MonthNum>3</MonthNum>

                 <Year>2005</Year>

         </RequestedDeliveryDate>

         <OrderReference>

                 <BuyerOrderNo>123456</BuyerOrderNo>

         </OrderReference>

         <ShipToParty>

                 <PlaceName>Place Makers</PlaceName>

                 <ContactName>Guy Smiley</ContactName>

                 <Address1>52 Hill Street</Address1>

                 <Address2>Takapuna</Address2>

                 <Address3>Auckland, New Zealand</Address3>

                 <PostalCode>1309</PostalCode>

                 <PhoneNumber>55502382</PhoneNumber>

                 <MobileNumber>0249243832</MobileNumber>

                 <Narration>Send around the back</Narration>

         </ShipToParty>

 </OrderHeader>

 <ListOfOrderDetail>

         <OrderDetail>

                 <SupplierPartNum>PT3 3SH TRAY</SupplierPartNum>

                 <Quantity>1</Quantity>

         </OrderDetail>

         <OrderDetail>

                 <SupplierPartNum>PT4 4SH TRAY</SupplierPartNum>

                 <Quantity>1</Quantity>

         </OrderDetail>

         <OrderDetail>

                 <SupplierPartNum>68SC SECRETARY</SupplierPartNum>

                 <Quantity>1</Quantity>

         </OrderDetail>

 </ListOfOrderDetail>

</PurchaseOrder>

The descriptions below outline the elements and what they can contain.

The XML Element

To conform to the XML standard a XML file should contain the text: <?xml version=1.0?> as the first line of the file. Webstore does not require this however if you are to view it in another XML editor this may be required.

Authorisation Element

The Login element and Password element must be identical to a login and password defined for an AR customer on the Web Users tab. This is the security of the transaction and also identifies the customer to place the order against once authenticated. Additionally, you can require a login and password to place files into the New XML files folder.

ListOfOrderDetail Element

Within the ListOfOrderDetail element, you can repeat OrderDetail elements for every line to order. Each SupplierPartNum element must contain a valid inventory item code, and each quantity element must contain a valid number that is greater than 0.