Skip to content

Getting Started

This guide walks you through the basics of connecting to and using the Gestix ERP API.


Prerequisites

  • A Gestix ERP account with API access enabled
  • An API Token — generated in Admin > Webshop API within the Gestix interface (the screen calls it "API Key")
  • Knowledge of HTTP and JSON

Base URL

All API requests use the following base URL pattern:

https://gestix.pt:443/api/{account}/v4.0.1
Segment Description
{account} Your Gestix account identifier (e.g., 03101176)
v4.0.1 API version. The current version is v4.0.1 (from Gestix 7.2.08); v4.0.0 still works. See API versions

The host (https://gestix.pt:443 above) is the address of the Gestix installation your account runs on; the Admin > Webshop API screen shows an example URL with it. Use your production address: a test or QA address is a different installation, and a call to the wrong address or account answers 404.


Step 1 — Authenticate

Before calling any protected endpoint, obtain a session token by authenticating with your API Token:

GET /api/{account}/v4.0.0/helo/
Authorization: Bearer <your-api-token>

On success, you receive:

{
  "xa-token": "aaMDAwMDAwMDAwMDAxMzY4ODY5OTA4ICAgRlIwMDA3MTQwNjIxXX"
}

Store the xa-token — it is your session token for all subsequent requests.

Alternative: username/password auth

If you are building a web application that authenticates end users, use POST /auth instead, which accepts a username and password directly.


Step 2 — Make Requests

Pass the session token as a Bearer token in the Authorization header:

GET /api/{account}/v4.0.0/customers/
Authorization: Bearer <xa-token>

Step 3 — Use a Nonce on Write Operations

All POST and PUT endpoints require a nonce query parameter. The nonce must be:

  • A positive integer
  • Strictly incrementing — each new request must use a higher value than the previous one
  • Client-generated (e.g., a Unix timestamp in milliseconds works well)
POST /api/{account}/v4.0.0/invoices?nonce=1700000000001
Authorization: Bearer <xa-token>
Content-Type: application/json

{ ... }

The nonce prevents replay attacks and duplicate submissions.


Step 4 — Check Status

Use GET /status at any point to verify your session is active and to retrieve version and error information:

GET /api/{account}/v4.0.0/status/
Authorization: Bearer <xa-token>

Content Types

Direction Content-Type
Request bodies (POST/PUT) application/json
Response bodies application/json; before 7.2.03, errors and 202 answers have an empty body (see Error Handling)
PDF responses (when print=1) application/pdf

Next Steps