Skip to documentation
Zahara DevelopersAPI documentation
DocumentationOverview
Download .md
THE ZAHARA API

Your next integration
starts here.

Connect purchasing, invoices and business data to the tools your team already uses. One place to learn the API and start building.

JSON responses API key authentication Markdown available
hello-zaharaREAD ONLY
# Set your tenancy API key in the environment first.
curl --fail-with-body --silent --show-error --max-time 30 \
  --header 'Accept: application/json' \
  "https://api.myzahara.net/api/${ZAHARA_TENANCY_API_KEY:?Set your tenancy API key}/BusinessUnit/GetAll"
GET/BusinessUnit/GetAllProduction API
A GOOD PLACE TO START

From first request to working integration.

GETTING STARTED

Zahara API: Getting Started

Build an integration by choosing the correct API key, reading configuration, and verifying the exact method before sending business data. This guide uses a read-only project-list request as a first business-unit example.

Choose your integration path

  • Discover business units with a tenancy key, then use the appropriate business-unit key for that business’s resources.
  • Read configuration such as nominal codes, tax codes and divisions before constructing documents that require their numeric IDs.
  • For an export or import, follow the method’s own request, response and verification notes. Creating invoices, purchase orders and goods receipt notes changes business data and needs a separately verified write workflow.

Documentation for your coding agent

Give your agent the documentation index, or a specific article URL with .md appended. The page’s Download .md action provides the same published content as a file. Review drafts are local previews and are excluded from the public index. Never put a real key or customer response in an agent prompt.

Before your first request

Use Node.js 22+, Python 3 or cURL 7.76.0+. Set ZAHARA_BUSINESS_UNIT_API_KEY privately in your environment for the business you intend to read. A tenancy ID or business-unit ID is not an API key. The request below targets production and returns business data; use a secure terminal and redact URLs in logs.

Request

GET https://api.myzahara.net/api/{businessUnitApiKey}/Project/GetAll

Send Accept: application/json. No request body appears in the supplied definition.

This first request lists projects for one business unit. It has no request body. It does not test invoice creation, document export or every API permission.

Authentication and scope

Parameter Location Meaning
businessUnitApiKey URL path API key for the owning business unit; not a tenancy key, numeric ID or user name.

Store the key in an environment variable or secret store. Because it appears in the URL path, redact request URLs in logs, proxies and monitoring. Do not put real keys in source examples, shared screenshots or coding-agent prompts. Response codes and names may also be confidential.

Working examples

The cURL, Node.js and Python programs were each executed successfully against the production API on 25 November 2026. Result shapes and item counts matched the direct request.

Environment variable Purpose
ZAHARA_BUSINESS_UNIT_API_KEY Business-unit API key, kept private.

cURL

Requires cURL 7.76.0+ for --fail-with-body. It prints the full result; use a secure development terminal.

# cURL 7.76.0+. Set the environment variables documented below.
# Treat response data as confidential. Keep keys out of logs.
set -e
curl --fail-with-body --silent --show-error --max-time 30 \
  --request GET \
  --header 'Accept: application/json' \
  "https://api.myzahara.net/api/${ZAHARA_BUSINESS_UNIT_API_KEY:?Set ZAHARA_BUSINESS_UNIT_API_KEY}/Project/GetAll"

JavaScript (Node.js 22+)

Uses built-in fetch, a 30-second timeout and an HTTP status check. No extra packages are required.

// Node.js 22+. Standard library only.
function required(name) {
  const value = process.env[name];
  if (!value) throw new Error('Set ' + name);
  return value;
}
const key = required('ZAHARA_BUSINESS_UNIT_API_KEY');
const base = 'https://api.myzahara.net';
let path = "Project/GetAll";

const url = new URL(base + '/api/' + encodeURIComponent(key) + '/' + path);


let response;
try {
  response = await fetch(url, {
    method: 'GET', headers: { Accept: 'application/json' },
    signal: AbortSignal.timeout(30000), redirect: 'error'
  });
} catch { throw new Error('Zahara request failed or timed out; URL omitted to protect the key'); }
if (!response.ok) throw new Error('Zahara returned HTTP ' + response.status);
const text = await response.text();
// Some methods may return an empty successful body. Do not assume a JSON shape.
const result = text.trim() ? JSON.parse(text) : null;
// Use a secure console; response fields may include financial or business data.
console.log(JSON.stringify(result, null, 2));

Python 3 (standard library)

Rejects redirects and reports HTTP/network errors without exposing the credential-bearing URL.

# Python 3. Standard library only.
import json
import os
from urllib.parse import quote, urlencode
from urllib.request import Request, build_opener, HTTPRedirectHandler
from urllib.error import HTTPError, URLError

class NoRedirect(HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        return None

def required(name):
    value = os.environ.get(name)
    if not value:
        raise SystemExit('Set ' + name)
    return value

key = required('ZAHARA_BUSINESS_UNIT_API_KEY')
base = 'https://api.myzahara.net'
path = "Project/GetAll"

url = base + '/api/' + quote(key, safe='') + '/' + path


request = Request(url, method='GET',
    headers={'Accept': 'application/json'})
try:
    with build_opener(NoRedirect).open(request, timeout=30) as response:
        text = response.read().decode('utf-8')
except HTTPError as error:
    raise SystemExit('Zahara returned HTTP ' + str(error.code)) from None
except URLError:
    raise SystemExit('Zahara request failed; URL omitted to protect the key') from None
result = json.loads(text) if text.strip() else None
# Use a secure console: the result may contain confidential data.
print(json.dumps(result, indent=2))

Successful response

The first-request example returned HTTP 200 with a JSON array of project records. A business unit can have different configuration, item counts and permissions. Treat the response as business data rather than a connectivity-only signal.

Fictionalised response example

All identifiers, business labels and dates below are fictional. The example preserves an observed shape; array length is illustrative.

[
  {
    "ProjectId": 1001,
    "BusinessUnitId": 100,
    "ProjectName": "Example ProjectName",
    "ProjectCode": "EXAMPLE-001",
    "Description": "Example Description",
    "BudgetedAmount": 10000,
    "Start": "2026-01-15T10:30:00Z",
    "End": null,
    "Status": 0,
    "LastUpdated": "2026-01-15T10:30:00Z",
    "DateCreated": "2026-01-15T10:30:00Z",
    "Void": false,
    "ProjectIncome": 0,
    "ProjectManagerId": null,
    "Address": {
      "AddressId": 1001,
      "AddressLines": "Example AddressLines",
      "Postcode": null,
      "CountryCodeId": null,
      "CountryCode": "gb",
      "AddressType": 0,
      "IsPrimary": false,
      "Void": false,
      "LastUpdated": "2026-01-15T10:30:00Z"
    },
    "ProjectRestrictionSettings": {
      "AvailableNominalCodeIds": [],
      "RestrictNominals": false,
      "SetNominalsAsBudget": false,
      "NominalsRestrictionPriorityType": 0
    }
  }
]

Field reference

Field Observed JSON type Meaning / integration use
ProjectId number Numeric project identifier used in project ID path parameters.
BusinessUnitId number Business-unit identifier, not its API key.
ProjectName string Display name; not the numeric project ID.
ProjectCode string Business-facing project code. Do not assume uniqueness from a single lookup.
Description string or null Record description. Preserve any nulls reported by the API.
BudgetedAmount number Numeric configured project budget. Currency and budget-enforcement behaviour are not established by this lookup.
Start string Project start date-time string when populated; not the change-filter date.
End null or string Project end date-time or null; preserve null values.
Status number Numeric project status. This response alone does not establish the enum mapping.
LastUpdated string Observed UTC date-time string.
DateCreated string Observed UTC date-time string.
Void boolean Void flag; inclusion and reversal semantics are not established by a normal lookup.
ProjectIncome number Numeric project income value. Calculation and currency semantics remain unverified.
ProjectManagerId null or number Project-manager reference; preserve nulls.
Address object Address object or null. AddressLines and contact/location fields may contain confidential data.
ProjectRestrictionSettings object Project-level nominal-code restrictions object; see nested settings below.

These types combine the observed complete project list with the tested lookup. They do not establish requiredness, every possible null, populated relationship shapes or a complete formal schema.

Nested project settings

Path Meaning / limits
Address Optional address data when populated; the tested list contained populated objects. The original article also shows null, so handle optional address data and verify that case for your integration.
ProjectRestrictionSettings.AvailableNominalCodeIds Nominal-code references in the supplied response shape. Numeric entries were observed; selection and enforcement rules still need verification.
ProjectRestrictionSettings.RestrictNominals Restriction configuration flag; enforcement behaviour is unverified.
ProjectRestrictionSettings.SetNominalsAsBudget Configuration flag; this response does not establish budget calculation behaviour.
ProjectRestrictionSettings.NominalsRestrictionPriorityType Numeric configuration enum; meanings are not established by this request.

Handling failures

The invalid-key test returned HTTP 401 with:

{
  "ApiMessage": "The API key is missing or not recognised.",
  "StatusCode": 401
}

Check the HTTP status and then inspect the body before using it. Do not convert network failures into empty results. The supplied clients make one request and do not automatically retry it.

Integration notes

  • Use ProjectId for ID-based calls and retain ProjectCode separately for business-facing lookups.
  • Inspect Void and Status deliberately. A returned project is not proof that it is available for every transaction.
  • Tenancy keys and business-unit keys have different scopes; follow the authentication section on each method rather than substituting them.
  • The request examples use environment variables, timeouts and HTTP status checks. They do not automatically retry.
  • A successful HTTP response may still contain [], null or false; the exact meaning belongs to the method’s contract.
  • Keep numeric resource IDs separate from display codes, names and enum values. Never infer an enum mapping from an example number.
  • The API collection is the available definition source for this documentation. An OpenAPI/Swagger contract has not been supplied. Unknown behaviour is labelled on each article.
  • Start write integrations in a disposable test business with known records, record before/after state, and reconcile uncertain outcomes before retrying.
  • The SDK link in the documentation navigation is an additional starting point. Its examples still require review against the method and your business configuration.
  • Case/format rules, permissions beyond the tested context, rate limits, complete nullability and undocumented variants remain unverified.

Verification

Verified on 25 November 2026 with an authorised business-unit key on the production API. cURL, JavaScript and Python each completed successfully. An invalid-key request was exercised. Empty-business-unit behaviour was not tested for this full-list request.

THE API REFERENCE

Find your building blocks.

Browse 149 published reference pages across 25 resources. New and updated articles appear here as they’re published.

BROWSE BY RESOURCE

We’re expanding the reference. Each page shows the currently published documentation; detail varies by method.

MADE FOR PEOPLE. READABLE BY AGENTS.

The right context.
Better integrations.

Skip the copy-and-paste. Give your coding agent the index URL and let it follow links to the published documentation it needs.

How it works →
Prefer to start with code?Explore the Node.js SDK on GitHub ↗