Spire ERP REST API Guide: Docs, Authentication, Endpoints and Limits
Gemini Logic ·
The Spire ERP REST API is the JSON web API built into Spire Server, and it has no separate API key: you sign in with an ordinary Spire username and password using HTTP Basic authentication. The documentation for your exact version is on your own Spire server at https://<your-server>:10880/doc/, and Spire also publishes a reference at developer.spiresystems.com.
This guide is for developers and IT staff connecting something to Spire ERP from Spire Systems (not the other companies called Spire). We build our own apps on this API, including OrderDesk, Envelope AI, GEMAI and HubSpot Connect, so some of the notes below come from running it in production.
What is the Spire ERP REST API?
It is how other programs talk to Spire Server over HTTPS. Requests and responses are JSON. It covers customers, vendors, inventory, sales, purchasing, receivables, payables, the general ledger, production, payroll, job costing and CRM notes, so most of what a person does in Spire can be done by code. Spire Desktop calls the same API, which is why its requests show up in the same server log as yours.
Use version 2. Spire’s API reference says v2 is the only version served on Spire 4.x. A good first call is GET /api/v2/status, which returns your Spire Server version. Features and fixes depend on that version, so check it before you trust any example, including ours.
Where is the Spire API documentation?
| Where | What you will find |
|---|---|
https://<your-server>:10880/doc/ |
Documentation for the Spire version you actually run, served by your own server |
https://<your-server>:10880/api/v2 |
A browsable API you can click through in a web browser |
https://<your-server>:10880/doc/database/ |
Spire’s documentation of the PostgreSQL tables behind each company |
| developer.spiresystems.com | Spire’s public reference, short guides, recipes and a changelog |
| Spire API v2 FAQ | Paging and filtering basics from Spire support |
Spire’s FAQ writes these addresses with localhost, which only works on the server itself. From another computer, use your server’s hostname. If the public reference and your server’s docs disagree, believe your server, because it describes the version you are running.
Does the Spire API use an API key?
No. Every request uses HTTP Basic authentication with a Spire user’s username and password, and a failed sign-in returns 401 Unauthorized. There is no token to generate.
In practice, that means your integration is a Spire user. Spire’s reference says the user’s role decides what they can read and change, the same as in Spire Desktop. Create a dedicated user for each integration, give it only the permissions that job needs, and never reuse a person’s login or an administrator account.
What is the Spire API base URL and port?
Every company-level request follows this pattern:
https://<host>:10880/api/v2/companies/<company>/<collection>/
- Port 10880 is the default. It can be changed in Spire Server administration, so confirm yours.
<company>is the company’s database name, not the name people see on screen.GET /api/v2/companies/lists the companies on the server.- Use your Spire hostname, not an IP address. Spire Server is installed with a hostname such as
yourcompany.spirelan.com. Spire’s support article on certificate warnings says that from version 3.9, connecting by server name or IP address brings up a certificate warning, while the hostname should not. - The trailing slash matters.
customers/is the collection and returns a list.customers/42is one record. - Send
Accept: application/json; charset=utf-8on every request, and the matchingContent-Typewhen you send a body. Leaving out the charset can garble accented names. - Optional headers set the session date, division and location:
Spire-Session-Date,Spire-DivisionandSpire-Location.
A first call with curl, using a demo company, Maple Distribution, whose database name is mapledist:
curl -u "api_reports:CHANGE_ME" \
-H "Accept: application/json; charset=utf-8" \
"https://yourcompany.spirelan.com:10880/api/v2/companies/mapledist/customers/?limit=25&q=toronto"
On-premise vs Spire Cloud. On-premise, the API runs on your own server at your hostname, port 10880 by default. On Spire Cloud, Spire runs the server and gives you its address. Confirm the exact address and port with Spire or your partner before you build.
Which Spire API endpoints do people use most?
All paths below sit under /api/v2/companies/<company>/.
| Job | Endpoint | Worth knowing |
|---|---|---|
| Customers | customers/ |
Billing address and contacts come embedded |
| Addresses and contacts | addresses/, contacts/ |
Addresses hold customers, vendors, warehouses and divisions, so filter by linkType |
| Vendors | vendors/ |
Vendor prices are at vendors/{id}/prices/ |
| Items and stock | inventory/items/ |
One record per part per warehouse. Users only see their default warehouse unless allowed to change it |
| Sales orders | sales/orders/ |
Invoice an order with POST sales/orders/{id}/invoice |
| Invoices | sales/invoices/ |
Invoiced history. Very little can be updated |
| Purchase orders | purchasing/orders/ |
Issued and received by updating the order’s status |
| Receivables | ar/transactions/, ar/aged/ |
Payments are applied to invoices with an apply endpoint |
| Payables | ap/transactions/, ap/aged/ |
Same pattern as receivables |
| General ledger | gl/accounts/, gl/transactions/ |
Journal entries must balance |
| Stock movement | inventory/movement/ |
Can be very large. Always filter by date |
Two habits help. Lists leave out some fields to stay fast, so fetch a record by id when you need all of it. And field names can differ between a list and a single record (sales invoices use subTotal in one and subtotal in the other), so test both.
How do filtering, sorting and pagination work?
List responses come wrapped like this, where count is the total number of matches and records is the current page:
{ "start": 0, "limit": 100, "count": 1523, "records": [] }
| Parameter | What it does | Example |
|---|---|---|
limit |
Records per page | limit=500 |
start |
Records to skip | start=500 |
q |
Free-text search | q=maple |
filter |
URL-encoded JSON filter | filter={"status":"O"} |
sort |
Sort field, - in front for descending |
sort=-orderDate |
fields |
Return only these fields | fields=partNo,description |
udf |
Include user-defined fields | udf=1 |
A few rules:
- Always set
limit. The default is small (Spire’s current reference says 10, its older FAQ says 100), so don’t rely on it. - 10,000 records is the ceiling. Asking for more in one call, or using
limit=0on a collection with more than 10,000 records, returns a400error. Page withstartinstead. - Filters are JSON. Simple matches look like Spire’s own example
{"type":"N","serializedMode":"N"}for inventory items. For comparisons, use operator objects:{"invoiceDate": {"$gte": "2026-01-01"}}for everything since a date,{"type": {"$ne": "Q"}}to leave out quotes, or{"name": {"$ilike": "%maple%"}}for a partial match. Fields on linked records use dots, such as"customer.customerNo". Check your server’s docs for what your version supports. - Use
$ilike, not$like, for partial matches.$likeis case-sensitive, so a search for “maple” won’t find “Maple”. We also find a$ilikefilter on a specific field more predictable than the free-textqsearch.
Here is the same pattern in Python, pulling every open sales order for Maple Distribution a page at a time:
import json
from decimal import Decimal
import requests
BASE = "https://yourcompany.spirelan.com:10880/api/v2/companies/mapledist"
session = requests.Session()
session.auth = ("api_reports", "CHANGE_ME") # load from a secret store in real code
session.headers["Accept"] = "application/json; charset=utf-8"
def fetch_all(path, page_size=500, **params):
"""Yield every record from a Spire collection, one page at a time."""
start = 0
while True:
params.update(start=start, limit=page_size)
resp = session.get(f"{BASE}/{path}", params=params, timeout=60)
resp.raise_for_status()
page = resp.json()
yield from page["records"]
start += page_size
if start >= page["count"]:
break
for order in fetch_all("sales/orders/", filter=json.dumps({"status": "O"}), sort="-orderDate"):
print(order["orderNo"], order["customer"]["name"], Decimal(order["total"]))
Note the Decimal. Spire returns money and quantities as strings such as "5.1000", so parse them as decimals, never floats. Dates are always YYYY-MM-DD.
How do you create and update records through the Spire API?
POST to a collection creates a record. PUT to a record’s URL updates it. Based on Spire’s own create sales order recipe, with demo data:
{
"customer": { "customerNo": "DEMO001" },
"status": "O",
"type": "O",
"orderDate": "2026-12-03",
"items": [
{ "inventory": { "whse": "00", "partNo": "PN-1001" }, "orderQty": "12", "committedQty": "12" }
]
}
Post that to sales/orders/. The usual gotchas:
- Updating order lines can delete them. When you
PUTa sales order, include every existing line by itsid. Spire’s add-an-item recipe says lines left out “will be deleted.” - Changes use the numeric
id. For inventory, requests that change an item use itsid, not the part number, so look the record up first. - Saving is not posting. Creating an order does not invoice it.
POST sales/orders/{id}/invoicedoes, and that posts to the general ledger, updates stock and creates the receivable, as invoicing in Spire does. Inventory adjustments and transfers work the same way: create, then call theirpostendpoint. - Permissions apply to writes. Creating a customer needs the add-customers permission, and editing needs the modify permission. When a write fails, check the integration user’s role before your code.
- Test on a copy. Point new code at a test company until it is proven, not at live data.
What can’t the Spire API do?
- Return more than 10,000 records per call. Large exports mean many pages.
- Turn purchase order receipts into AP invoices. The REST API does not support it.
- Show vendor quantity price breaks. Spire’s database stores up to 15 break levels per vendor price, but the vendor prices endpoint does not include them.
- Do heavy reporting efficiently. The API returns records a page at a time, so totalling two years of invoice lines by customer means paging through every line and adding them up yourself.
When should you read the Spire database instead?
Each Spire company is its own PostgreSQL database, and your server documents its tables at /doc/database/. For read-only reporting, a SQL query is often simpler and faster than paging the API, because one query can join invoices, items and customers and total them.
| REST API | PostgreSQL, read-only | |
|---|---|---|
| Best for | Integrations, creating and updating records | Reports, dashboards, BI tools |
| Spire’s business rules | Applied, as in Spire Desktop | Not involved |
| Who sees what | Spire user roles | The database login |
| Field names | customerNo |
cust_no |
| Large history | Paged, 10,000 records per call at most | One query |
Don’t write to the database unless the person doing it knows Spire’s tables well, because direct writes skip the logic Spire runs. One example from the schema: change a GL transaction’s date directly and the period balances on the GL accounts don’t update until someone runs Spire’s recalculation function. Use the API for writes, and give reporting tools a read-only login. If you would rather not build reporting yourself, see Analytics for Spire.
How do you keep Spire API access secure?
- Don’t open port 10880 to the internet. If something outside your network has to reach Spire, put a reverse proxy with SSL in front of it, allow only known IP addresses and use strong passwords.
- Leave certificate checks on. Connect with your
spirelan.comhostname so the certificate matches. Turning validation off might be tolerable on a test machine, never in production. - Use one dedicated, limited user per integration. Not a superuser, and not a person’s login. Spire hides item costs from users without cost permissions and limits inventory lists to the user’s default warehouse, so set those to match what the integration actually needs.
- Keep payroll out of reach. The API includes payroll, and employee records include Social Insurance Numbers. An integration that doesn’t need payroll should have no access to it.
- Keep the password out of your code. Use a secret store, and change it when staff who know it leave.
- Read the log. Spire Server writes
spired.login theProgramData\Spirefolder, with the client IP address, request, status code and response time of each call. It is the first place to look when something fails.
Connecting an AI tool? Our guide to connecting ChatGPT, Claude or Copilot to Spire has a longer checklist.
Does Spire charge for API access?
We couldn’t find a public Spire answer, so we won’t guess. Spire’s options page describes owning a licence, subscribing and Spire Cloud hosting, but lists no separate price for API access. Ask your Spire partner:
- Is API access included with our licence and Spire version?
- Does the integration’s Spire user need its own user licence?
- On Spire Cloud, can our integration reach the API, and at what address?
- What will the app vendor or developer charge, separately from Spire?
Then budget for building the integration and keeping it working through Spire upgrades.
When is it worth hiring a developer or partner?
Doing it yourself is reasonable for read-only pulls, a scheduled export or a small one-way sync, if someone on your team is comfortable with REST APIs.
Bring in help when:
- The integration writes orders, invoices, payments or journal entries.
- Data syncs both ways and you need rules for which side wins.
- It has to keep working through Spire upgrades.
- You need something the API can’t do on its own.
Before you build, check whether a product already does the job. See our products and integrations, such as HubSpot Connect for HubSpot.
Gemini Logic has been in business since 2001. We are a Spire Authorized Partner, Reseller and Spire Integration Partner, and a HubSpot Gold Solutions Partner, with a remote team in Toronto and Mississauga working with clients across Canada. If you need an integration built, reviewed or rescued, our custom development team can scope it, or contact us to talk it through.
Common questions
Is there a Spire API key?
No. The Spire ERP REST API uses HTTP Basic authentication with a Spire username and password. Create a dedicated Spire user for each integration.
What port does the Spire API use?
10880 by default on an on-premise server. It can be changed, so confirm yours. On Spire Cloud, use the address Spire gives you.
Is the Spire API documentation public?
Partly. Spire’s public reference is at developer.spiresystems.com, and the docs for your exact version are on your own server at /doc/.
How many records can one Spire API call return?
10,000. Use start and limit to page through anything larger.