# SYSPRO SORTOI Sales Order Import XML Generator

> Source: https://netray.co/tools/syspro-sortoi-sales-order-import-xml-generator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Fill in customer, PO, stock code and quantity to get the SORTOI parameters XML, the document XML and the C# call that posts them through e.net.

## Category

other-erp

## Erp

SYSPRO

## Audience

- SYSPRO developer
- Integration developer
- ERP administrator

## Tool

**Kind:** template

**Output:** code

**Language:** xml

**Fields:**

#### Customer

**Key:** customer

**Type:** text

**Default:** 0000001

#### Customer PO number

**Key:** customer_po

**Type:** text

**Default:** PO-55120

#### Order date

**Key:** order_date

**Type:** date

**Default:** 2026-10-22

#### Requested ship date

**Key:** ship_date

**Type:** date

**Default:** 2026-10-29

#### Warehouse

**Key:** warehouse

**Type:** text

**Default:** FG

#### Stock code

**Key:** stock_code

**Type:** text

**Default:** A100

#### Order quantity

**Key:** qty

**Type:** number

**Default:** 10

#### Price (blank = SYSPRO pricing)

**Key:** price

**Type:** text

#### OrderActionType

**Key:** order_action

**Type:** select

**Options:**

- A
- C
- D

**Default:** A

**Help:** A = add, C = change, D = cancel

#### Process

**Key:** process

**Type:** select

**Options:**

- Validate
- Import

**Default:** Validate

**Help:** Validate checks only; Import validates and imports if there are no errors

#### AllowZeroPrice

**Key:** allow_zero_price

**Type:** select

**Options:**

- N
- Y

**Default:** N

**Help:** Only applies when AlwaysUsePriceEntered is Y

#### AlwaysUsePriceEntered

**Key:** use_price_entered

**Type:** select

**Options:**

- N
- Y

**Default:** N

#### IgnoreWarnings

**Key:** ignore_warnings

**Type:** select

**Options:**

- N
- Y
- W

**Default:** N

**Help:** N = warnings returned as errors, Y = ignore warnings, W = return them as warnings

#### SYSPRO operator

**Key:** operator

**Type:** text

**Default:** ADMIN

#### Company ID

**Key:** company

**Type:** text

**Default:** EDU1

**Blocks:**

#### Parameters XML (xmlParameters)

**Body:** <?xml version="1.0" encoding="Windows-1252"?>
<SalesOrders xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="SORTOI.XSD">
  <Parameters>
    <Process>{{process}}</Process>
    <WarehouseListToUse>{{warehouse}}</WarehouseListToUse>
    <AcceptEarlierShipDate>N</AcceptEarlierShipDate>
    <AlwaysUsePriceEntered>{{use_price_entered}}</AlwaysUsePriceEntered>
    <AllowZeroPrice>{{allow_zero_price}}</AllowZeroPrice>
    <IgnoreWarnings>{{ignore_warnings}}</IgnoreWarnings>
  </Parameters>
</SalesOrders>

#### Document XML (xmlIn)

**Body:** <?xml version="1.0" encoding="Windows-1252"?>
<SalesOrders xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="SORTOIDOC.XSD">
  <Orders>
    <OrderHeader>
      <CustomerPoNumber>{{customer_po}}</CustomerPoNumber>
      <OrderActionType>{{order_action}}</OrderActionType>
      <Customer>{{customer}}</Customer>
      <OrderDate>{{order_date}}</OrderDate>
      <Warehouse>{{warehouse}}</Warehouse>
      <RequestedShipDate>{{ship_date}}</RequestedShipDate>
    </OrderHeader>
    <OrderDetails>
      <StockLine>
        <CustomerPoLine>1</CustomerPoLine>
        <LineActionType>A</LineActionType>
        <StockCode>{{stock_code}}</StockCode>
        <Warehouse>{{warehouse}}</Warehouse>
        <OrderQty>{{qty}}</OrderQty>
        <Price>{{price}}</Price>
      </StockLine>
    </OrderDetails>
  </Orders>
</SalesOrders>

#### C# e.net call (Interop.Encore)

**Body:** using System;
using System.IO;

class PostSortoi
{
    static void Main()
    {
        Encore.Utilities util = new Encore.Utilities();
        Encore.Transaction trn = new Encore.Transaction();

        // Operator, OperatorPassword, CompanyId, CompanyPassword, Language, LogLevel, EncoreInstance, XmlIn
        string guid = util.Logon("{{operator}}", "", "{{company}}", "", Encore.Language.ENGLISH, 0, 0, "");
        try
        {
            string xmlParameters = File.ReadAllText(@"C:\SYSPRO\SORTOI_params.xml");
            string xmlIn = File.ReadAllText(@"C:\SYSPRO\SORTOI_doc.xml");
            string xmlOut = trn.Post(guid, "SORTOI", xmlParameters, xmlIn);
            Console.WriteLine(xmlOut);
        }
        finally
        {
            util.Logoff(guid);
        }
    }
}

**Notes:** Element names and their order follow SORTOI.XSD and SORTOIDOC.XSD in the SYSPRO Business Object Library; the XSD sequence is strict, so keep the order shown when you add elements. Verify against the schemas shipped with your SYSPRO 7 or 8 release. The C# uses the e.net COM interop (Encore) classes; confirm the Logon parameters and licensing for business objects in your e.net documentation. If you leave Price blank, remove the empty Price element rather than sending it, so SYSPRO prices the line. Run with Process Validate first, then switch to Import.

## Content

**Intro:** This generator produces the two XML strings SYSPRO's SORTOI business object (Sales Order Import) needs, the parameters and the document, plus a C# program that logs on and posts them with e.net Transaction.Post. It targets SYSPRO 7 and SYSPRO 8.

**Sections:**

#### How to use it

**Body:** Enter a customer, customer PO number, dates, warehouse, stock code and quantity that exist in your company. Leave Price empty (and drop the empty Price element) to let SYSPRO price the line from the customer's price code, or enter a price and set AlwaysUsePriceEntered to Y. Keep Process on Validate for the first run: SORTOI checks everything and returns errors in the output XML without creating the order. When the output is clean, switch Process to Import and post again. Save the two XML blocks to files or pass them as strings from your integration.

#### Where this lives in SYSPRO

**Body:** SORTOI is a transaction (post) business object in the Sales Orders area, called through e.net Solutions with Transaction.Post. The schema files SORTOI.XSD and SORTOIDOC.XSD, with sample SORTOI.XML and SORTOIDOC.XML, are documented in the SYSPRO Business Object Library and are typically installed in the Base\Schemas folder on the application server. Orders created this way appear in Sales Order Entry like any other order, with the customer PO number you passed. The output XML returns the SYSPRO sales order number and any warnings per line.

**Bullets:**

- Logon returns a session GUID; always Logoff in a finally block
- Business object calls consume e.net licences
- Use CustomerPoNumber with OrderActionType C or D to change or cancel

#### Parameters you will actually change

**Body:** Process takes Validate or Import; Validate is the schema default. WarehouseListToUse limits which warehouses lines can use. AcceptEarlierShipDate decides whether a requested ship date earlier than SYSPRO would calculate is accepted. AlwaysUsePriceEntered and AllowZeroPrice control pricing (AllowZeroPrice only applies when AlwaysUsePriceEntered is Y), and setting AllowZeroPrice to Y without a reason invites free-goods mistakes. IgnoreWarnings N returns warnings as errors, W returns them as warnings, and Y lets orders through with warnings such as credit or stock messages, which suits trusted EDI feeds but hides problems on manual feeds. The XSD defines many more, such as AllowDuplicateOrderNumbers, ReserveStock and IncludeDimensionAnalysis; add them in schema order.

#### Gotchas

**Body:** The parameter and document schemas are sequences, so an element out of order fails validation even when the name is right. Dates use CCYY-MM-DD. Customer and stock codes must match SYSPRO exactly, including leading zeros. OrderActionType applies to the whole order and LineActionType to each line; changing an order needs the original CustomerPoNumber. Leaving Logon sessions open exhausts e.net licences, so always call Logoff. Test against a copy company before pointing an EDI or web feed at production.

**Cta:** If you want staff to ask SYSPRO about orders, stock and customers in plain English on your own servers, with any SORTOI writes kept behind an approval step, we can set that up.

**Faq:**

#### What is SORTOI in SYSPRO?

**Answer:** SORTOI is the SYSPRO business object for Sales Order Import. It creates, changes or cancels sales orders from XML: a parameters document controls behaviour such as validation and pricing, and the document XML holds order headers and lines. It is called through e.net Solutions with Transaction.Post.

#### Does SYSPRO have an API?

**Answer:** SYSPRO's integration layer is e.net Solutions: business objects such as SORTOI are called through Logon, Query, Setup and Transaction methods, from COM or .NET, and through web services in newer releases. Business objects are documented in the SYSPRO Business Object Library with their XML schemas and samples.

#### How do I validate a SORTOI import without creating the order?

**Answer:** Set Process to Validate in the parameters XML. SORTOI validates the order and returns any errors and warnings in the output XML but does not import it. When the output is clean, change Process to Import, which validates again and imports only if there are no errors.

#### What integration options does SYSPRO offer?

**Answer:** Common options are e.net business objects called from your own code, SYSPRO's import programs for file-based loads, and integration or EDI tools built on top of e.net. For real-time order creation from a web shop or EDI translator, calling SORTOI through e.net is the standard route.

## Search terms

syspro sortoi api, syspro api, syspro api documentation, syspro integration process, syspro integration options, syspro sales order import xml, syspro e.net transaction post

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
