Zum Inhalt

Create Sales Order

These services are used to create sales orders in NAV/Business Central. Create Sales Order stores the order directly to the sales order tables in NAV/Business Central while Create Inbound Sales Order uses the dedicated tables to store orders that will be created afterwards. This allows to check and verify these orders first, as well a create mandatory data within NAV/Business Central. You will need different master data, that can be received via the Master Data Service.

Service Endpoint

The base Endpoints are:

InboundCreateInboundOrderIISWebService
InboundCreateOrderIISWebService

API Methods

Here are the available methods for the Create Order Service:

  • CreateSalesOrder
  • CreateSalesOrderFromQuote

Create Inbound Order Sample

Sample Request

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:inb="http://tempuri.org/InboundCreateInboundOrderIISWebService/" xmlns:x53="urn:microsoft-dynamics-nav/xmlports/x5371218">
   <soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <wsa:Action>http://tempuri.org/InboundCreateInboundOrderIISWebService/InboundCreateInboundOrderIISWebService/CreateSalesOrder</wsa:Action>
   </soap:Header>
   <soap:Body>
      <inb:CreateSalesOrder>
         <inb:inboundCreateInbOrder>
            <x53:Header_General>
               <x53:Order_Date>2016-12-28</x53:Order_Date>
               <x53:Shipping_Agent_Code>DHL</x53:Shipping_Agent_Code>
               <x53:Shipping_Agent_Service_Code>STANDARD</x53:Shipping_Agent_Service_Code>
               <x53:External_Document_No>SHOP_B10004</x53:External_Document_No>
               <x53:Prices_Incl_VAT>true</x53:Prices_Incl_VAT>
           <x53:Order_Time>00:02:00.0000000+01:00</x53:Order_Time>
            </x53:Header_General>
            <x53:Header_Sell_To_Customer>
               <x53:Name>Max Mustermann</x53:Name>
               <x53:Address>Musterstraße 5</x53:Address>
               <x53:Post_Code>49078</x53:Post_Code>
               <x53:City>Osnabrück</x53:City>
               <x53:Country_Code>DE</x53:Country_Code>
               <x53:Template_Code>DE MID</x53:Template_Code>
               <x53:E_Mail_Address>mmustermann@tso.de</x53:E_Mail_Address>
            </x53:Header_Sell_To_Customer>
            <!--Optional:-->
            <x53:Header_Ship_To_Customer>
               <x53:Name>Maria Musterfrau</x53:Name>
               <x53:Address>Dorfstr. 12</x53:Address>
               <x53:Post_Code>49504</x53:Post_Code>
               <x53:City>Lotte</x53:City>
               <x53:Country_Code>DE</x53:Country_Code>
            </x53:Header_Ship_To_Customer>
            <x53:Sales_Lines>
               <!--Zero or more repetitions:-->
               <x53:Sales_Line>
                  <x53:Line_No>10000</x53:Line_No>
                  <x53:Type>Item</x53:Type>
                  <x53:No>70000</x53:No>
                  <x53:Quantity>1</x53:Quantity>
                  <x53:Unit_Price>50</x53:Unit_Price>
               </x53:Sales_Line>
               <x53:Sales_Line>
                  <x53:Line_No>20000</x53:Line_No>
                  <x53:Type>G/L Account</x53:Type>
                  <x53:No>8400</x53:No>
                  <x53:Description>Shipping DHL</x53:Description>
                  <x53:Quantity>1</x53:Quantity>
                  <x53:Unit_Price>10</x53:Unit_Price>
               </x53:Sales_Line>
            </x53:Sales_Lines>
            <x53:Comment_Lines>
               <!--Zero or more repetitions:-->
               <x53:Comment_Line>
                  <!--Optional:-->
                  <x53:Comment>I'm an order comment!</x53:Comment>
               </x53:Comment_Line>
            </x53:Comment_Lines>
         </inb:inboundCreateInbOrder>
      </inb:CreateSalesOrder>
   </soap:Body>
</soap:Envelope>

Sample Response

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
   <s:Header>
      <a:Action s:mustUnderstand="1">http://tempuri.org/InboundCreateInboundOrderIISWebService/InboundCreateInboundOrderIISWebService/CreateSalesOrderResponse</a:Action>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <CreateSalesOrderResponse xmlns="http://tempuri.org/InboundCreateInboundOrderIISWebService/">
         <inboundCreateInbOrder>
            <Amount xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">0</Amount>
            <Total_Amount xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">0</Total_Amount>
            <Invoice_Discount_Amount xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">0</Invoice_Discount_Amount>
            <VAT_Amount xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">0</VAT_Amount>
            <Amount_Incl_VAT xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">0</Amount_Incl_VAT>
            <Header_General xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">
               <Document_No>INB00000028</Document_No>
               <Order_Date>2016-12-28</Order_Date>
               <Shipment_Method_Code/>
               <Currency_Code/>
               <Shipping_Agent_Code>DHL</Shipping_Agent_Code>
               <Shipping_Agent_Service_Code>STANDARD</Shipping_Agent_Service_Code>
               <External_Document_No>SHOP_B10004</External_Document_No>
               <Payment_Method_Code/>
               <Prices_Incl_VAT>true</Prices_Incl_VAT>
           <Campaign_No/>

           <Order_Time>00:02:00.0000000+01:00</Order_Time>

            </Header_General>
            <Header_Sell_To_Customer xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">
               <Customer_No/>
               <Contact_No/>
               <Name>Max Mustermann</Name>
               <Name_2/>
               <First_Name/>
               <Surname/>
               <Address>Musterstraße 5</Address>
               <Address_2/>
               <Post_Code>49078</Post_Code>
               <City>Osnabrück</City>
               <Country_Code>DE</Country_Code>
               <Template_Code>DE MID</Template_Code>
               <E_Mail_Address>mmustermann@tso.de</E_Mail_Address>
            </Header_Sell_To_Customer>
            <Header_Bill_To_Customer xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">
               <Customer_No/>
               <Contact_No/>
               <Name/>
               <Name_2/>
               <First_Name/>
               <Surname/>
               <Address/>
               <Address_2/>
               <Post_Code/>
               <City/>
               <Country_Code/>
               <Template_Code/>
            </Header_Bill_To_Customer>
            <Header_Ship_To_Customer xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">
               <Code/>
               <Name>Maria Musterfrau</Name>
               <Name_2/>
               <First_Name/>
               <Surname/>
               <Address>Dorfstr. 12</Address>
               <Address_2/>
               <Post_Code>49504</Post_Code>
               <City>Lotte</City>
               <Country_Code/>
               <ShipmentType>0</ShipmentType>
               <Post_No/>
               <Parcel_Station_No/>
               <Post_Office/>
            </Header_Ship_To_Customer>
            <Header_Payment xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">
               <TX_ID/>
               <TX_Code/>
               <TX_Amount>0.00</TX_Amount>
            </Header_Payment>
            <Sales_Lines xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">
               <Sales_Line>
                  <Line_No>10000</Line_No>
                  <Type>2</Type>
                  <No>70000</No>
                  <Variant_Code/>
                  <Description/>
                  <Description_2/>
                  <Unit_Of_Measure_Code/>
                  <Quantity>1</Quantity>
                  <Unit_Price>50.00</Unit_Price>
               </Sales_Line>
               <Sales_Line>
                  <Line_No>20000</Line_No>
                  <Type>1</Type>
                  <No>8400</No>
                  <Variant_Code/>
                  <Description>Shipping DHL</Description>
                  <Description_2/>
                  <Unit_Of_Measure_Code/>
                  <Quantity>1</Quantity>
                  <Unit_Price>10.00</Unit_Price>
               </Sales_Line>
            </Sales_Lines>
            <Comment_Lines xmlns="urn:microsoft-dynamics-nav/xmlports/x5371218">
               <Comment_Line>
                  <Comment>I'm an order comment!</Comment>
               </Comment_Line>
            </Comment_Lines>
         </inboundCreateInbOrder>
      </CreateSalesOrderResponse>
   </s:Body>
</s:Envelope>

Create Order Sample

Sample Request

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
   xmlns:inb="http://tempuri.org/InboundCreateOrderIISWebService/" 
   xmlns:x60="urn:microsoft-dynamics-nav/xmlports/x5371215">
   <soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <wsa:Action>http://tempuri.org/InboundCreateOrderIISWebService/InboundCreateOrderIISWebService/CreateSalesOrder</wsa:Action>
   </soap:Header>
   <soap:Body>
      <inb:CreateSalesOrder>         
         <inb:p_InboundCreateOrder>           
           <x60:Header_General>        
           <x60:Order_Date>2013-07-03</x60:Order_Date>         
           <x60:External_Document_No>SHOPNO1235</x60:External_Document_No>
         </x60:Header_General>          
         <x60:Header_Sell_To_Customer>
           <!--<x60:Customer_No>01121212</x60:Customer_No>-->
           <x60:Contact_No>KT100156</x60:Contact_No>
         </x60:Header_Sell_To_Customer>
         <!--Optional:-->
          <x60:Header_Ship_To_Customer>
           <x60:Code></x60:Code>
           <x60:Name>TSO-DATA GmbH</x60:Name>
           <x60:Name_2></x60:Name_2>
           <x60:Address>Preussenweg 10</x60:Address>
           <x60:Address_2></x60:Address_2>
           <x60:Post_Code>49076</x60:Post_Code>
           <x60:City>Osnabrück</x60:City>
           <x60:Country_Code>DE</x60:Country_Code>
           <x60:Create_Shipping_Address>true</x60:Create_Shipping_Address>
         </x60:Header_Ship_To_Customer>     
           <x60:Sales_Lines>
               <x60:Sales_Line>
                  <x60:Line_No>10000</x60:Line_No>
                 <x60:Type>Item</x60:Type>
                 <x60:No>1000</x60:No>
                 <x60:Quantity>2</x60:Quantity>
              </x60:Sales_Line>
             <x60:Sales_Line>
                <x60:Line_No>20000</x60:Line_No>
                   <x60:Type>Item</x60:Type>
                  <x60:No>1600</x60:No>
                     <x60:Quantity>2</x60:Quantity>
            </x60:Sales_Line>
           </x60:Sales_Lines>
          <x60:Comment_Lines>      
               <!--Zero or more repetitions:-->
               <x60:Comment_Line>
                  <!--Optional:-->
                  <x60:Comment>A Comment Line 1</x60:Comment>                  
               </x60:Comment_Line>              
               <x60:Comment_Line>
                  <!--Optional:-->
                  <x60:Comment>A Comment Line 2</x60:Comment>
               </x60:Comment_Line>                             
            </x60:Comment_Lines>      
         </inb:p_InboundCreateOrder>
      </inb:CreateSalesOrder>
   </soap:Body>
</soap:Envelope>

Sample Response

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
   <s:Header>
      <a:Action s:mustUnderstand="1">http://tempuri.org/InboundCreateOrderIISWebService/InboundCreateOrderIISWebService/CreateSalesOrderResponse</a:Action>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <CreateSalesOrderResponse xmlns="http://tempuri.org/InboundCreateOrderIISWebService/">
         <p_InboundCreateOrder>
            <Amount xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">8,000</Amount>
            <Total_Amount xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">8,000</Total_Amount>
            <Invoice_Discount_Amount xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">0</Invoice_Discount_Amount>
            <VAT_Amount xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">1,520</VAT_Amount>
            <Amount_Incl_VAT xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">9,520</Amount_Incl_VAT>
            <Header_General xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">
               <Document_No>1005</Document_No>
               <Order_Date>2016-04-28</Order_Date>
               <Shipment_Method_Code>EXW</Shipment_Method_Code>
               <Currency_Code/>
               <Shipping_Agent_Code>DHL</Shipping_Agent_Code>
               <Shipping_Agent_Service_Code>ÜBER NACHT</Shipping_Agent_Service_Code>
               <Customer_Order_No/>
               <External_Document_No>SHOPNO1235</External_Document_No>
               <Payment_Method_Code/>
            </Header_General>
            <Header_Sell_To_Customer xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">
               <Customer_No>10000</Customer_No>
               <Contact_No>KT100156</Contact_No>
               <Name>New Customer Name</Name>
               <Name_2>New Customer Name 2</Name_2>
               <First_Name/>
               <Surname/>
               <Address>Tischlerstr. 4-10</Address>
               <Address_2/>
               <Post_Code>48436</Post_Code>
               <City>Düsseldorf</City>
               <Country_Code/>
               <Template_Code/>
            </Header_Sell_To_Customer>
            <Header_Bill_To_Customer xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">
               <Customer_No>10000</Customer_No>
               <Contact_No>KT100156</Contact_No>
               <Name>New Customer Name</Name>
               <Name_2>New Customer Name 2</Name_2>
               <First_Name/>
               <Surname/>
               <Address>Tischlerstr. 4-10</Address>
               <Address_2/>
               <Post_Code>48436</Post_Code>
               <City>Düsseldorf</City>
               <Country_Code/>
               <Template_Code/>
            </Header_Bill_To_Customer>
            <Header_Ship_To_Customer xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">
               <Code>002</Code>
               <Name>TSO-DATA GmbH</Name>
               <Name_2/>
               <First_Name/>
               <Surname/>
               <Address>Preussenweg 10</Address>
               <Address_2/>
               <Post_Code>49076</Post_Code>
               <City>Osnabrück</City>
               <Country_Code>DE</Country_Code>
               <Shipping_Advice>0</Shipping_Advice>
               <Create_Shipping_Address>true</Create_Shipping_Address>
            </Header_Ship_To_Customer>
            <Sales_Lines xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">
               <Sales_Line>
                  <Line_No>10000</Line_No>
                  <Type>2</Type>
                  <No>1000</No>
                  <Variant_Code/>
                  <Description>Tourenrad</Description>
                  <Description_2/>
                  <Unit_Of_Measure_Code>Stück</Unit_Of_Measure_Code>
                  <Quantity>2</Quantity>
                  <Line_Amount>8000.00</Line_Amount>
                  <Line_Amount_Incl_VAT>9520.00</Line_Amount_Incl_VAT>
                  <Shipment_Date>2016-04-28</Shipment_Date>
                  <Unit_Price>4000.00</Unit_Price>
               </Sales_Line>
               <Sales_Line>
                  <Line_No>20000</Line_No>
                  <Type>2</Type>
                  <No>1600</No>
                  <Variant_Code/>
                  <Description>Klingel</Description>
                  <Description_2/>
                  <Unit_Of_Measure_Code>Stück</Unit_Of_Measure_Code>
                  <Quantity>2</Quantity>
                  <Shipment_Date>2016-04-28</Shipment_Date>
               </Sales_Line>
            </Sales_Lines>
            <Comment_Lines xmlns="urn:microsoft-dynamics-nav/xmlports/x5371215">
               <Comment_Line>
                  <Comment>A Comment Line 1</Comment>
               </Comment_Line>
               <Comment_Line>
                  <Comment>A Comment Line 2</Comment>
               </Comment_Line>
            </Comment_Lines>
         </p_InboundCreateOrder>
      </CreateSalesOrderResponse>
   </s:Body>
</s:Envelope>

Field Information

Amount Field Information

Name Description Type max. Length Occurance
Amount Amount without invoice discount Decimal 0..1
Total_Amount Amount incl. invoice discount Decimal 0..1
Invoice_Discount_Amount Invoice discount amount Decimal 0..1
Total_VAT_Amount Total VAT amount Decimal 0..1
Amount_Incl_VAT Amount incl. VAT Decimal 0..1

Header Field Information

Name Description Type max. Length Occurance
🔑 Document No Specifies the number of the Sales Order. Leave this empty when creating a new order. String 20 1..1
Order_Date Specifies the order DateTime. Date is saved in NAV/Business Central only! DateTime 0..1
Shipment_Method_Code Specifies a default shipment method code for the order. Get a list of codes from the Master Data Service String 10 0..1
Currency_Code Specifies a default currency code for the order. Get a list of codes from the Master Data Service String 10 0..1
Shipping_Agent_Code Specifies a default shipping agent code for the order. Get a list of codes from the Master Data Service String 10 0..1
Shipping_Agent_Service_Code Specifies a default shipping agent service code for the order. Get a list of codes from the Master Data Service String 10 0..1
Customer_Order_No Specifies the customer's order no. String 20 0..1
External_Document_No Specifies the external document no. This must be unique in NAV/Business Central. You'll receive an error when insert two orders with the same external document no. String 35 0..1
Payment_Method_Code Specifies a default payment method code for the order. Get a list of codes from the Master Data Service String 10 0..1
Prices_Incl_VAT Specifies the price to be incl. VAT Boolean 0..1
Campaign_No Specifies the campaign code assigned to an order. Get a list of codes from the Campaign Service String 10 0..1
Order_Time Specifies the order time. Date is saved in NAV/Business Central only! Time 0..1

Addr Sell-to, Shipt-to, Bill-to Field Information

Name Description Type max. Length Occurance
Customer_No Specifies the number of the customer. String 20 1..1
Contact_No Specifies the number of the contact. String 20 1..1
Code Specifies the Ship-to Address Codes. String 10 0..1
Name Specifies the name. String 50 0..1
Name_2 Specifies the additional name. String 50 0..1
First_Name Specifies the first name. String 30 0..1
Surname Specifies the surname. String 30 0..1
Address Specifies the address. i.E. 'Hauptstraße 12b' String 50 1..1
Address_2 Specifies the add. address information. String 50 1..1
City Specifies the city. String 30 1..1
Post_Code Specifies a code for the post code of the address. Get a list of codes from the Master Data Service String 10 0..1
Country_Region_Code Specifies a code for the country/region of the address. Get a list of codes from the Master Data Service String 10 0..1
Template_Code Specifies the customer template code that is used when a customer is created. String 50 1..1
Shipping_Advice Specifies the complete or partial shipping information. String 50 1..1
Create_Shipping_Address Specifies whether a shipping address is created from the ship-to block String 30 1..1

Payment Field Information

Name Description Type max. Length Occurance
TX_ID Specifies the payment transaction no. String 80 1..1
TX_Code Specifies the transaction auth. code String 20 1..1
TX_Amount Specifies the amount String 10 0..1

Sales Line Fields Information

Name Description Type max. Length Occurance
🔑 Line No Specifies the pos. number. Decimal 1..1
Type Specifies the Type: "Item", "Resource", "G/L Account" String 0..1
No Specifies the No. i.E. Item No. "70000" String 20 0..1
Variant_Code Specifies the item variant code String 10 0..1
Description Specifies the Description. String 50 0..1
Description_2 Specifies the additional Description. String 50 0..1
Unit_Of_Measure_Code Specifies the sales unit of measure of the item. String 10 0..1
Quantity Specifies the quantity. Decimal 1..1
Line_Amount Specifies the lines amount Decimal 0..1
Line_Amount_Incl_VAT Specifies the lines amount incl. VAT. Decimal 0..1
Line_Discount_Percent Specifies the lines discount percentage. Decimal 0..1
Line_Discount_Amount Specifies the lines discount amount. Decimal 0..1
Shipment_Date Specifies the lines shipment date. DateTime 0..1
Unit_Price Specifies the lines unit price Decimal 0..1

Comment Field Information

Name Description Type max. Length Occurance
Comment Sepcifies the comment line String 80 1..1