Skip to content

Dynamics 365 Business Central Sales Quote XML

The XML format documented here is used for both the import and export of sales quotes in Dynamics 365 Business Central.

We recommend that the ExternalId field be populated with the unique ID of the sales quotes from the external system, Zynk uses this field to track sales quotes already imported to prevent duplicates being created in Dynamics 365 Business Central.

Tasks

XML

Any fields not documented below are not supported with our imports / exports. Examples of where in the XML the fields should appear are shown in the samples below.

Sample Sales Quote File:

<?xml version="1.0" encoding="utf-8"?>
<SalesQuotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SalesQuote>
    <Id>4c096576-7864-ea11-a813-000d3a86fa27</Id>
    <ExternalId>740fcf</ExternalId>
    <ODataETag>W/"JzQ0O1pSR3FVVVdBZE1kcjhlSW5rVHczVkNLOUp6L1Q5NHJnejdOTUhKT2ZiM009MTswMDsn"</ODataETag>
    <Number>1005</Number>
    <ExternalDocumentNumber>TEST-0001</ExternalDocumentNumber>
    <CustomerId>d4f4fd40-34bc-ed11-9a88-6045bd0cf992</CustomerId>
    <CustomerNumber>C00020</CustomerNumber>
    <CustomerName>Zynk Software</CustomerName>
    <Customer>
      <Id>d4f4fd40-34bc-ed11-9a88-6045bd0cf992</Id>
      <ODataETag>W/"JzIwOzEzMzE2NzA3MzUyOTk2NjU1NzExMTswMDsn"</ODataETag>
      <Number>C00020</Number>
      <DisplayName>Zynk Software</DisplayName>
      <Type>Company</Type>
      <AddressLine1>Office 16</AddressLine1>
      <AddressLine2>6 Charlotte Square</AddressLine2>
      <City>Newcastle</City>
      <State>Tyne &amp; Wear</State>
      <Country>GB</Country>
      <PostalCode>NE1 4XF</PostalCode>
      <PhoneNumber />
      <Email>[email protected]</Email>
      <Website>www.zynk.com</Website>
      <TaxLiable>false</TaxLiable>
      <TaxAreaId>248e3bdf-549e-ed11-988a-000d3a3885d3</TaxAreaId>
      <TaxAreaDisplayName>Domestic customers and vendors</TaxAreaDisplayName>
      <TaxRegistrationNumber />
      <CurrencyId>00000000-0000-0000-0000-000000000000</CurrencyId>
      <CurrencyCode>GBP</CurrencyCode>
      <PaymentTermsId>fa97d7da-549e-ed11-988a-000d3a3885d3</PaymentTermsId>
      <ShipmentMethodId>ae98d7da-549e-ed11-988a-000d3a3885d3</ShipmentMethodId>
      <PaymentMethodId>c58d3bdf-549e-ed11-988a-000d3a3885d3</PaymentMethodId>
      <Blocked>_x0020_</Blocked>
      <LastModifiedDateTime>2023-03-06T15:33:37.68Z</LastModifiedDateTime>
    </Customer>
    <BillToName>Zynk Software</BillToName>
    <BillToCustomerId>30219848-b45f-ea11-a812-000d3a86dae1</BillToCustomerId>
    <BillToCustomerNumber>C00020</BillToCustomerNumber>
    <BillToCustomer>
      <Id>d4f4fd40-34bc-ed11-9a88-6045bd0cf992</Id>
      <ODataETag>W/"JzIwOzEzMzE2NzA3MzUyOTk2NjU1NzExMTswMDsn"</ODataETag>
      <Number>C00020</Number>
      <DisplayName>Zynk Software</DisplayName>
      <Type>Company</Type>
      <AddressLine1>Office 16</AddressLine1>
      <AddressLine2>6 Charlotte Square</AddressLine2>
      <City>Newcastle</City>
      <State>Tyne &amp; Wear</State>
      <Country>GB</Country>
      <PostalCode>NE1 4XF</PostalCode>
      <PhoneNumber />
      <Email>[email protected]</Email>
      <Website>www.zynk.com</Website>
      <TaxLiable>false</TaxLiable>
      <TaxAreaId>248e3bdf-549e-ed11-988a-000d3a3885d3</TaxAreaId>
      <TaxAreaDisplayName>Domestic customers and vendors</TaxAreaDisplayName>
      <TaxRegistrationNumber />
      <CurrencyId>00000000-0000-0000-0000-000000000000</CurrencyId>
      <CurrencyCode>GBP</CurrencyCode>
      <PaymentTermsId>fa97d7da-549e-ed11-988a-000d3a3885d3</PaymentTermsId>
      <ShipmentMethodId>ae98d7da-549e-ed11-988a-000d3a3885d3</ShipmentMethodId>
      <PaymentMethodId>c58d3bdf-549e-ed11-988a-000d3a3885d3</PaymentMethodId>
      <Blocked>_x0020_</Blocked>
      <LastModifiedDateTime>2023-03-06T15:33:37.68Z</LastModifiedDateTime>
    </BillToCustomer>
    <SellToAddressLine1>Office 16</SellToAddressLine1>
    <SellToAddressLine2>6 Charlotte Square</SellToAddressLine2>
    <SellToCity>Newcastle Upon Tyne</SellToCity>
    <SellToState>Tyne &amp; Wear</SellToState>
    <SellToPostCode>NE1 4XF</SellToPostCode>
    <SellToCountry>GB</SellToCountry>
    <BillToAddressLine1>Office 16</BillToAddressLine1>
    <BillToAddressLine2>6 Charlotte Square</BillToAddressLine2>
    <BillToCity>Newcastle Upon Tyne</BillToCity>
    <BillToState>Tyne &amp; Wear</BillToState>
    <BillToPostCode>NE1 4XF</BillToPostCode>
    <BillToCountry>GB</BillToCountry>
    <ShipToName>Zynk Software</ShipToName>
    <ShipToContact>John Smith</ShipToContact>
    <ShipToAddressLine1>Office 16</ShipToAddressLine1>
    <ShipToAddressLine2>6 Charlotte Square</ShipToAddressLine2>
    <ShipToCity>Newcastle Upon Tyne</ShipToCity>
    <ShipToState>Tyne &amp; Wear</ShipToState>
    <ShipToPostCode>NE1 4XF</ShipToPostCode>
    <ShipToCountry>GB</ShipToCountry>
    <CurrencyId>00000000-0000-0000-0000-000000000000</CurrencyId>
    <CurrencyCode>GBP</CurrencyCode>
    <PaymentTermsId>9ab1e6b3-611d-ea11-bb2d-000d3a4884fc</PaymentTermsId>
    <ShipmentMethodId>c4b2e6b3-611d-ea11-bb2d-000d3a4884fc</ShipmentMethodId>
    <Salesperson>PS</Salesperson>
    <DiscountAmount>0</DiscountAmount>
    <TotalAmountExcludingTax>104.25</TotalAmountExcludingTax>
    <TotalTaxAmount>20.85</TotalTaxAmount>
    <TotalAmountIncludingTax>125.1</TotalAmountIncludingTax>
    <Status>Draft</Status>
    <LastModifiedDateTime>2020-03-12T15:45:38.11Z</LastModifiedDateTime>
    <PhoneNumber />
    <Email>[email protected]</Email>
    <PostingDate>0001-01-01T00:00:00</PostingDate>
    <PaymentTerm>
      <Id>9ab1e6b3-611d-ea11-bb2d-000d3a4884fc</Id>
      <ODataETag>W/"JzQ0O3U3bDZJYzh5UFdXa2xMbWZoV2dacis5RXJvSHZEUktpald0OElZd0ZHSWc9MTswMDsn"</ODataETag>
      <Code>14 DAYS</Code>
      <DisplayName>Net 14 days</DisplayName>
      <DueDateCalculation>14D</DueDateCalculation>
      <DiscountDateCalculation />
      <DiscountPercent>0</DiscountPercent>
      <CalculateDiscountOnCreditMemos>false</CalculateDiscountOnCreditMemos>
      <LastModifiedDateTime>2019-12-13T04:34:12.093Z</LastModifiedDateTime>
    </PaymentTerm>
    <ShipmentMethod>
      <Id>c4b2e6b3-611d-ea11-bb2d-000d3a4884fc</Id>
      <ODataETag>W/"JzQ0O0E0SVdUK05RV21lNnphVnVDZi9TaGF1eHQvdUdQdUNEanFpcGdRRm1RR0U9MTswMDsn"</ODataETag>
      <Code>CFR</Code>
      <DisplayName>Cost and Freight</DisplayName>
      <LastModifiedDateTime>2019-12-13T04:34:15.42Z</LastModifiedDateTime>
    </ShipmentMethod>
    <DocumentDate>2020-03-12T00:00:00</DocumentDate>
    <DueDate>2020-03-25T00:00:00</DueDate>
    <SentDate>0001-01-01T00:00:00Z</SentDate>
    <ValidUntilDate>2020-06-01T00:00:00</ValidUntilDate>
    <AcceptedDate>0001-01-01T00:00:00</AcceptedDate>
    <SalesQuoteLines>
      <SalesQuoteLine>
        <Id>4c096576-7864-ea11-a813-000d3a86fa27-10000</Id>
        <ODataETag>W/"JzQ0O2ZWWUh5SVJVeGcwVXVyVVZMb0IrR2UzWWFoR2xSc0E4dFdJeldhT0d4OW89MTswMDsn"</ODataETag>
        <DocumentId>4c096576-7864-ea11-a813-000d3a86fa27</DocumentId>
        <Sequence>10000</Sequence>
        <ItemId>bbb3e6b3-611d-ea11-bb2d-000d3a4884fc</ItemId>
        <Item>
          <Id>bbb3e6b3-611d-ea11-bb2d-000d3a4884fc</Id>
          <ODataETag>W/"JzQ0OzRwQ0NNUFZCOWVRcEtGbFJVaGN1MDdsYUlRbUZxc0IvV3UvaTUvNms3dkE9MTswMDsn"</ODataETag>
          <Number>1936-S</Number>
          <DisplayName>BERLIN Guest Chair, yellow</DisplayName>
          <Type>Inventory</Type>
          <ItemCategoryId>2518deb9-611d-ea11-bb2d-000d3a4884fc</ItemCategoryId>
          <ItemCategoryCode>CHAIR</ItemCategoryCode>
          <Blocked>false</Blocked>
          <Gtin />
          <Inventory>100</Inventory>
          <UnitPrice>125.1</UnitPrice>
          <PriceIncludesTax>false</PriceIncludesTax>
          <UnitCost>97.5</UnitCost>
          <TaxGroupId>2c8e3bdf-549e-ed11-988a-000d3a3885d3</TaxGroupId>
          <TaxGroupCode>STANDARD</TaxGroupCode>
          <BaseUnitOfMeasureId>2d8c3bdf-549e-ed11-988a-000d3a3885d3</BaseUnitOfMeasureId>
          <BaseUnitOfMeasureCode>PCS</BaseUnitOfMeasureCode>
          <LastModifiedDateTime>2019-12-13T04:34:22.527Z</LastModifiedDateTime>
        </Item>
        <AccountId>f9b2e6b3-611d-ea11-bb2d-000d3a4884fc</AccountId>
        <Account>
          <Number>10100</Number>
        </Account>
        <LineType>Item</LineType>
        <LineObjectNumber>1936-S</LineObjectNumber>
        <Description>BERLIN Guest Chair, yellow</Description>
        <UnitOfMeasureId>2d8c3bdf-549e-ed11-988a-000d3a3885d3</UnitOfMeasureId>
        <UnitOfMeasureCode>PCS</UnitOfMeasureCode>
        <Quantity>1</Quantity>
        <UnitPrice>125.1</UnitPrice>
        <DiscountAmount>0</DiscountAmount>
        <DiscountPercent>0</DiscountPercent>
        <DiscountAppliedBeforeTax>false</DiscountAppliedBeforeTax>
        <AmountExcludingTax>104.25</AmountExcludingTax>
        <TaxCode>STANDARD</TaxCode>
        <TaxPercent>20</TaxPercent>
        <TotalTaxAmount>20.85</TotalTaxAmount>
        <AmountIncludingTax>125.1</AmountIncludingTax>
        <NetAmount>104.25</NetAmount>
        <NetTaxAmount>20.85</NetTaxAmount>
        <NetAmountIncludingTax>125.1</NetAmountIncludingTax>
      </SalesQuoteLine>
    </SalesQuoteLines>
  </SalesQuote>
</SalesQuotes>

In each of the following sections most of the XML has been omitted to make the samples easier to read. The whole structure of the SalesQuotes schema is used below as a reference of where fields should be in the object model.

General

The following information can be found within the 'General' section.

Dynamics Field XML Field  Type  Input  Notes
- Id Guid Optional Used for matching existing sales quotes
- ExternalId string Optional Stored in Zynk's internal DB and used for matching existing sales quotes
No. Number string Optional Used for matching existing sales quotes. The next number will be used when creating a new sales quote if not specified
External Document No. ExternalDocumentNumber string Optional Used for matching existing sales quotes
Customer No. CustomerId Guid Optional
Customer No. CustomerNumber string Optional Performs a lookup for the customer ID based on the number
Customer No. Customer Customer Optional Used for looking up and auto creating customers
Customer No. ContactId string Optional Used for looking up the customer
Customer Name CustomerName string Read-only
Sell-To > Address SellToAddressLine1 string Optional
Sell-To > Address SellToAddressLine2 string Optional
Sell-To > City SellToCity string Optional
Sell-To > County SellToState string Optional
Sell-To > Postcode SellToPostCode string Optional
Sell-To > Country/Region Code SellToCountry string Optional
- PhoneNumber string Optional
- Email string Optional
Document Date DocumentDate DateTime Optional
QuoteValid To Date ValidUntilDate DateTime Optional
Due Date DueDate DateTime Optional
Salesperson Code Salesperson string Optional
Status Status string Read-only Can be: Draft, Sent, Accepted
<?xml version="1.0" encoding="utf-8"?>
<SalesQuotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SalesQuote>
    <Id>4c096576-7864-ea11-a813-000d3a86fa27</Id>
    <ExternalId>740fcf</ExternalId>
    <Number>1005</Number>
    <ExternalDocumentNumber>TEST-0001</ExternalDocumentNumber>
    <CustomerId>30219848-b45f-ea11-a812-000d3a86dae1</CustomerId>
    <CustomerNumber>C00020</CustomerNumber>
    <Customer>
      <!-- See Customer XML for more details -->
    </Customer>
    <ContactId />
    <CustomerName>Zynk Software</CustomerName>
    <SellToAddressLine1>Office 16</SellToAddressLine1>
    <SellToAddressLine2>6 Charlotte Square</SellToAddressLine2>
    <SellToCity>Newcastle Upon Tyne</SellToCity>
    <SellToState>Tyne &amp; Wear</SellToState>
    <SellToPostCode>NE1 4XF</SellToPostCode>
    <SellToCountry>GB</SellToCountry>
    <PhoneNumber>0191 820 1484</PhoneNumber>
    <Email>[email protected]</Email>
    <DocumentDate>2020-03-12T00:00:00</DocumentDate>
    <ValidUntilDate>2020-06-01T00:00:00</ValidUntilDate>
    <DueDate>2020-03-25T00:00:00</DueDate>
    <Salesperson>PS</Salesperson>
    <Status>Draft</Status>
  </SalesQuote>
</SalesQuotes>

Lines

The following information can be found within the 'Lines' section.

Dynamics Field XML Field  Type  Input  Notes
- Id string Optional Used for matching existing lines
- ExternalId string Optional Stored in Zynk's internal DB and used for matching existing lines
- Sequence string Optional Used for matching existing lines. The next number will be used when creating a new line if not specified
No. ItemId Guid Optional Used for matching existing lines.
No. Item Item Optional Used for looking up and auto creating items
- AccountId Guid Optional The line type will be automatically set to 'Account' if specified
- Account/Code Guid Optional Performs a lookup for the account ID based on code
Type LineType string Optional Can be: Comment, Account, Item, Resource, Fixed Asset, Charge
No. LineDetails/Number string Optional Performs a lookup for the item or account ID based on number
Description Description string Optional
Quantity Quantity decimal Required
Unit of Measure Code UnitOfMeasureId Guid Optional
Unit of Measure Code UnitOfMeasureCode string Optional Performs a lookup for the unit of measure ID based on code
Unit Price UnitPrice decimal Required
Line Discount % DiscountPercent decimal Optional
Line Discount % DiscountAmount decimal Optional
- DiscountAppliedBeforeTax bool Read-only
- AmountExcludingTax decimal Read-only
- TaxCode string Optional
- TaxPercent decimal Read-only
- TotalTaxAmount decimal Read-only
- AmountIncludingTax decimal Read-only
- NetAmount decimal Read-only
- NetTaxAmount decimal Read-only
- NetAmountIncludingTax decimal Read-only
Inv. Discount Amount Incl. VAT DiscountAmount decimal Optional
Total Excl. VAT TotalAmountExcludingTax decimal Read-only
Total VAT TotalTaxAmount decimal Read-only
Total Incl. VAT TotalAmountIncludingTax decimal Read-only
<?xml version="1.0" encoding="utf-8"?>
<SalesQuotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SalesQuote>
    <SalesQuoteLines>
      <SalesQuoteLine>
        <Id>4c096576-7864-ea11-a813-000d3a86fa27-10000</Id>
        <Sequence>10000</Sequence>
        <ItemId>bbb3e6b3-611d-ea11-bb2d-000d3a4884fc</ItemId>
        <Item>
          <!-- See Item XML for more details -->
          <Number>1936-S</Number>
        </Item>
        <AccountId>f9b2e6b3-611d-ea11-bb2d-000d3a4884fc</AccountId>
        <Account>
          <Number>10100</Number>
        </Account>
        <LineType>Item</LineType>
        <LineObjectNumber>1936-S</LineObjectNumber>
        <Description>BERLIN Guest Chair, yellow</Description>
        <Quantity>1</Quantity>
        <UnitOfMeasureId>2fb4e6b3-611d-ea11-bb2d-000d3a4884fc</UnitOfMeasureId>
        <UnitOfMeasureCode>PCS</UnitOfMeasureCode>
        <UnitPrice>125.1</UnitPrice>
        <DiscountAmount>0</DiscountAmount>
        <DiscountPercent>0</DiscountPercent>
        <DiscountAppliedBeforeTax>false</DiscountAppliedBeforeTax>
        <AmountExcludingTax>104.25</AmountExcludingTax>
        <TaxCode>STANDARD</TaxCode>
        <TaxPercent>20</TaxPercent>
        <TotalTaxAmount>20.85</TotalTaxAmount>
        <AmountIncludingTax>125.1</AmountIncludingTax>
        <NetAmount>104.25</NetAmount>
        <NetTaxAmount>20.85</NetTaxAmount>
        <NetAmountIncludingTax>125.1</NetAmountIncludingTax>
      </SalesQuoteLine>
    </SalesQuoteLines>
    <DiscountAmount>0</DiscountAmount>
    <TotalAmountExcludingTax>104.25</TotalAmountExcludingTax>
    <TotalTaxAmount>20.85</TotalTaxAmount>
    <TotalAmountIncludingTax>125.1</TotalAmountIncludingTax>
  </SalesQuote>
</SalesQuotes>

Invoice Details

The following information can be found within the 'Invoice Details' section.

Dynamics Field XML Field  Type  Input  Notes
Currency Code CurrencyId Guid Optional
Currency Code CurrencyCode string Optional Use the 3 letter ISO code
Payment Terms Code PaymentTermsId Guid Optional
Payment Terms Code PaymentTerm/Code string Optional Performs a lookup for the payment terms based on code
<?xml version="1.0" encoding="utf-8"?>
<SalesQuotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SalesQuote>
    <CurrencyId>00000000-0000-0000-0000-000000000000</CurrencyId>
    <CurrencyCode>GBP</CurrencyCode>
    <PaymentTermsId>9ab1e6b3-611d-ea11-bb2d-000d3a4884fc</PaymentTermsId>
    <PaymentTerm>
      <Code>14 DAYS</Code>
    </PaymentTerm>
  </SalesQuote>
</SalesQuotes>

Shipping & Billing

The following information can be found within the 'Shipping & Billing' section.

Dynamics Field XML Field  Type  Input  Notes
Ship-To > Name ShipToName string Optional
Ship-To > Address ShipToAddressLine1 string Optional
Ship-To > Address ShipToAddressLine2 string Optional
Ship-To > City ShipToCity string Optional
Ship-To > County ShipToState string Optional
Ship-To > Postcode ShipToPostCode string Optional
Ship-To > Country/Region ShipToCountry string Optional
Ship-To > Contact ShipToContact string Optional
Shipment Method > Code ShipmentMethodId Guid Optional
Shipment Method > Code ShipmentMethod/Code string Optional Performs a lookup for the shipment method based on code
Bill-to BillToCustomerId Guid Optional
Bill-to BillToCustomerNumber string Optional Performs a lookup for the customer ID based on the number
Bill-to BillToCustomer Customer Optional Used for looking up and auto creating customers
Bill-to > Name BillToName string Read-only
Bill-to > Address BillToAddressLine1 string Optional
Bill-to > Address BillToAddressLine2 string Optional
Bill-to > City BillToCity string Optional
Bill-to > County BillToState string Optional
Bill-to > Postcode BillToPostCode string Optional
Bill-to > Country/Region Code BillToCountry string Optional
<?xml version="1.0" encoding="utf-8"?>
<SalesQuotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SalesQuote>
    <ShipToName>Zynk Software</ShipToName>
    <ShipToAddressLine1>Office 16</ShipToAddressLine1>
    <ShipToAddressLine2>6 Charlotte Square</ShipToAddressLine2>
    <ShipToCity>Newcastle Upon Tyne</ShipToCity>
    <ShipToState>Tyne &amp; Wear</ShipToState>
    <ShipToPostCode>NE1 4XF</ShipToPostCode>
    <ShipToCountry>GB</ShipToCountry>
    <ShipToContact>John Smith</ShipToContact>
    <ShipmentMethodId>c4b2e6b3-611d-ea11-bb2d-000d3a4884fc</ShipmentMethodId>
    <ShipmentMethod>
      <Code>CFR</Code>
    </ShipmentMethod>
    <BillToCustomerId>30219848-b45f-ea11-a812-000d3a86dae1</BillToCustomerId>
    <BillToCustomerNumber>C00020</BillToCustomerNumber>
    <BillToCustomer>
      <!-- See Customer XML for more details -->
    </BillToCustomer>
    <BillToName>Zynk Software</BillToName>
    <BillToAddressLine1>Office 16</BillToAddressLine1>
    <BillToAddressLine2>6 Charlotte Square</BillToAddressLine2>
    <BillToCity>Newcastle Upon Tyne</BillToCity>
    <BillToState>Tyne &amp; Wear</BillToState>
    <BillToPostCode>NE1 4XF</BillToPostCode>
    <BillToCountry>GB</BillToCountry>
  </SalesQuote>
</SalesQuotes>

Miscellaneous

The following information is not visible within Dynamics 365 Business Central.

Dynamics Field XML Field  Type  Input  Notes
- ODataETag string Optional Specify the last value to prevent updates if the record has since been modified
- LastModifiedDateTime DateTime Read-only
- PostingDate DateTime Optional
- SentDate DateTime Read-only
- AcceptedDate DateTime Read-only
<?xml version="1.0" encoding="utf-8"?>
<SalesQuotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SalesQuote>
    <ODataETag>W/"JzQ0O1pSR3FVVVdBZE1kcjhlSW5rVHczVkNLOUp6L1Q5NHJnejdOTUhKT2ZiM009MTswMDsn"</ODataETag>
    <LastModifiedDateTime>2020-03-12T15:45:38.11Z</LastModifiedDateTime>
    <PostingDate>0001-01-01T00:00:00</PostingDate>
    <SentDate>0001-01-01T00:00:00Z</SentDate>
    <AcceptedDate>0001-01-01T00:00:00</AcceptedDate>
  </SalesQuote>
</SalesQuotes>