# SYSPRO REST API URL Builder for the e.net WCF Service

> Source: https://netray.co/tools/syspro-enet-rest-url-builder
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Fill in host, port, operator, company and business objects to get the full SYSPRO e.net REST call sequence (Logon, Query, Post, Logoff) as URLs and a PowerShell script.

## Category

other-erp

## Erp

SYSPRO

## Audience

- SYSPRO developer
- Integration developer
- ERP administrator

## Tool

**Kind:** template

**Output:** code

**Language:** http

**Fields:**

#### SYSPRO app server host

**Key:** host

**Type:** text

**Default:** sysapp01

#### REST port of the e.net WCF service

**Key:** rest_port

**Type:** text

**Default:** 40000

**Help:** Use the REST port configured for your SYSPRO e.net communications (WCF) service. 40000 is only a placeholder; check your service configuration.

#### Operator

**Key:** operator

**Type:** text

**Default:** ADMIN

#### Operator password

**Key:** operator_password

**Type:** text

#### Company ID

**Key:** company_id

**Type:** text

**Default:** EDU1

#### Company password

**Key:** company_password

**Type:** text

#### Query business object

**Key:** business_object_query

**Type:** text

**Default:** INVQRY

#### Stock code for the query

**Key:** stock_code

**Type:** text

**Default:** A100

#### Transaction business object

**Key:** business_object_post

**Type:** text

**Default:** SORTOI

**Blocks:**

#### 1. Logon (returns the session UserId)

**Body:** GET http://{{host}}:{{rest_port}}/SYSPROWCFService/Rest/Logon?Operator={{operator}}&OperatorPassword={{operator_password}}&CompanyId={{company_id}}&CompanyPassword={{company_password}}

# Response body: a session token such as 96AB04439FC3B84BAEC49E6E11DA770900 followed by trailing spaces.
# Trim it, or URL-encode the spaces, before using it as UserId below. A body containing ERROR means the logon failed.

#### 2. Query business object

**Body:** # XmlIn before encoding:
# <Query><Key><StockCode>{{stock_code}}</StockCode></Key></Query>

GET http://{{host}}:{{rest_port}}/SYSPROWCFService/Rest/Query/Query?UserId=<UserId>&BusinessObject={{business_object_query}}&XmlIn=%3CQuery%3E%3CKey%3E%3CStockCode%3E{{stock_code}}%3C%2FStockCode%3E%3C%2FKey%3E%3C%2FQuery%3E

#### 3. Transaction post business object

**Body:** # XmlParameters and XmlIn come from the sample XML for {{business_object_post}} (parameters document and data document).
# Post with validation only first, then switch the parameter off once the response is clean.

GET http://{{host}}:{{rest_port}}/SYSPROWCFService/Rest/Transaction/Post?UserId=<UserId>&BusinessObject={{business_object_post}}&XmlParameters=<url-encoded parameters XML>&XmlIn=<url-encoded document XML>

#### 4. Logoff (always, even after an error)

**Body:** GET http://{{host}}:{{rest_port}}/SYSPROWCFService/Rest/Logoff?UserId=<UserId>

# Log off in a finally block so a failed query or post does not leave the session open.

#### PowerShell: full sequence with Invoke-RestMethod

**Body:** $base = "http://{{host}}:{{rest_port}}/SYSPROWCFService/Rest"
$enc = { param($s) [uri]::EscapeDataString($s) }

$logonUrl = "$base/Logon?Operator=" + (& $enc '{{operator}}') + "&OperatorPassword=" + (& $enc '{{operator_password}}') + "&CompanyId=" + (& $enc '{{company_id}}') + "&CompanyPassword=" + (& $enc '{{company_password}}')
$userId = (Invoke-RestMethod -Method Get -Uri $logonUrl).ToString().Trim()
if ($userId -match 'ERROR') { throw "Logon failed: $userId" }

try {
    $xmlIn = '<Query><Key><StockCode>{{stock_code}}</StockCode></Key></Query>'
    $queryUrl = "$base/Query/Query?UserId=" + (& $enc $userId) + "&BusinessObject={{business_object_query}}&XmlIn=" + (& $enc $xmlIn)
    $result = Invoke-RestMethod -Method Get -Uri $queryUrl
    $result | Out-File -FilePath .\{{business_object_query}}-result.xml -Encoding utf8

    # Transaction post: load the parameter and document XML from files you prepared
    # $xmlParams = Get-Content .\{{business_object_post}}-params.xml -Raw
    # $xmlDoc    = Get-Content .\{{business_object_post}}-doc.xml -Raw
    # $postUrl = "$base/Transaction/Post?UserId=" + (& $enc $userId) + "&BusinessObject={{business_object_post}}&XmlParameters=" + (& $enc $xmlParams) + "&XmlIn=" + (& $enc $xmlDoc)
    # Invoke-RestMethod -Method Get -Uri $postUrl
}
finally {
    Invoke-RestMethod -Method Get -Uri ("$base/Logoff?UserId=" + (& $enc $userId)) | Out-Null
}

**Notes:** Routes and parameter names (Rest/Logon, Rest/Query/Query, Rest/Transaction/Post, Rest/Logoff; Operator, OperatorPassword, CompanyId, CompanyPassword, UserId, BusinessObject, XmlIn, XmlParameters) match the SYSPRO 7 and SYSPRO 8 e.net WCF REST endpoint. Check on your release: the REST port and binding in the service configuration, whether an HTTPS endpoint is configured, firewall rules for that port, and the exact XML for each business object from its sample files. Long XmlIn strings can exceed URL length limits; use the SOAP/WCF binding for large documents.

## Content

**Intro:** This builder writes the complete SYSPRO e.net REST call sequence for SYSPRO 7 and SYSPRO 8 on-premises: Logon, a Query business object, a Transaction Post business object and Logoff. It also gives a PowerShell script that runs the same calls with proper URL encoding and always logs off.

**Sections:**

#### How to use it

**Body:** Enter the application server host, the REST port your e.net WCF service listens on, the operator and company credentials, and the business objects you want to call. Copy the Logon URL into a browser or Postman first: if it returns a session token you know the service, port, firewall and credentials are right. Then paste that token into the UserId placeholder of the Query URL. Only after a query works should you move to a Transaction Post, and run it with the business object's validate-only parameter set before posting for real.

**Bullets:**

- The REST port is set in the service configuration, not by the business object.
- The session token comes back with trailing spaces; trim it.
- Always call Logoff, otherwise sessions consume licences until they time out.

#### Where this lives in SYSPRO

**Body:** The URLs target the SYSPRO e.net communications service (the WCF service, path SYSPROWCFService) that hosts the REST endpoint next to its SOAP endpoints. Query objects (for example INVQRY for inventory, COMFND for a generic table browse) live under Query, and transaction objects (for example SORTOI to import sales orders, PORTOR for purchase order receipts) live under Transaction/Post. Every business object has a sample parameters XML and a sample document XML with matching XSD files; start from those rather than writing XML by hand. The operator you log on with needs access to the business object and its programs, the same as a user in the client.

#### Worked example

**Body:** With host sysapp01, company EDU1 and operator ADMIN, the Logon call returns a token like 96AB04439FC3B84BAEC49E6E11DA770900. The INVQRY call then passes XmlIn of <Query><Key><StockCode>A100</StockCode></Key></Query>, URL-encoded, and returns the item's warehouse and quantity details as XML. For SORTOI you pass two documents: XmlParameters (processing options such as validate only) and XmlIn (orders, headers and lines). The response contains a status per order and line plus any error messages, so log the full response body. The PowerShell block writes the query result to a file you can open in any XML viewer.

#### Version differences and gotchas

**Body:** The REST routes are the same on SYSPRO 7 and SYSPRO 8, but the service host, ports and bindings depend on how the e.net service was configured at install, and an HTTPS endpoint exists only if someone configured it. A 404 usually means the wrong port or that the REST endpoint is not enabled, not a bad business object. GET URLs are limited in length, so a large SORTOI document can fail before it reaches SYSPRO; use the SOAP binding for bulk posts. Test against a copy company first: a successful Transaction Post creates real orders and stock movements.

**Cta:** If you want your team to query SYSPRO in plain English through these same business objects on your own servers, we can set that up.

**Faq:**

#### Does SYSPRO have a REST API?

**Answer:** Yes. The SYSPRO e.net WCF service exposes a REST endpoint alongside SOAP. You call Rest/Logon to get a session UserId, then Rest/Query/Query or Rest/Transaction/Post with a BusinessObject name and XML input, and finish with Rest/Logoff. The payloads are the same XML documents the business objects use over any other e.net binding.

#### What port does the SYSPRO REST service use?

**Answer:** It is whatever REST port was configured for the e.net WCF service at your site. Check the service configuration on the application server rather than relying on a number from a blog. Make sure that port is open in Windows Firewall and any network firewall between the caller and the SYSPRO server.

#### Why does my SYSPRO query return an error about the UserId?

**Answer:** Usually the token was not trimmed, was not URL-encoded, or the session already expired or was logged off. Log on again, trim the returned string, encode it with EscapeDataString, and reuse it for the whole sequence. A logon response that contains ERROR means the operator, password or company details are wrong.

#### How do I integrate SYSPRO with HubSpot or another SaaS app?

**Answer:** A middleware layer calls the e.net service on your network: query business objects to read customers, items and orders, and transaction business objects such as SORTOI to create orders from the SaaS app. Keep the SYSPRO service off the public internet and expose only the middleware, with its own authentication and logging.

## Search terms

syspro rest api, syspro api, syspro api documentation, syspro e.net rest, syspro wcf service rest, syspro integration, syspro integration with hubspot api, syspro business objects api

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