API
WAMA REST API guide
Integrate your systems with WAMA using the HTTPS JSON API at https://www.wama.cloud.
This page covers API key authentication, multi-tenant point-of-sale context, pagination, and errors. For request and response fields, open the interactive OpenAPI reference (full screen).
Getting started
- Create an API key in the WAMA web app (Settings → Integrations). Prefer read only unless your integration must write data.
- Call
/api/**with headerAuthorization: Bearer <api_key>(orX-Api-Key). - Use the interactive API reference for request/response fields.
Base URL: https://www.wama.cloud
Tip
API keys are the supported way for scripts, partner apps, and AI / MCP. Do not use interactive user login (email/password OAuth) for machine integrations.
Authentication
Create an API key
- Sign in to WAMA in the browser as an account administrator (
ROLE_USER/ Administrator). - Open Settings → Integrations.
- Choose Create API key, set a name, the point of sale the key is bound to, a scope, and an optional expiry date.
- Copy the key immediately — the full secret is shown only once.
Key format:
Store it like a password (environment variable or secret manager). Never commit keys to source control or paste them into public tickets.
Scopes
| Scope | Wire value | Behaviour |
|---|---|---|
| Read only | read | GET / HEAD / OPTIONS only; mutating methods return 403 |
| Read & write | read_write | Same access as the creating user for that point of sale (except key management) |
Prefer read only for reporting, sync, and AI assistants unless writes are required.
Call the API
Send the key as an HTTP header on every request:
Optional alias (same key):
If both a JWT Authorization: Bearer … and X-Api-Key are present, the JWT wins and X-Api-Key is ignored.
Example:
Equivalent with X-Api-Key:
Revoke or rotate
Revoke keys from Settings → Integrations. Revoked or expired keys return 401. Create a new key to rotate; update your client and revoke the old one.
API keys cannot create, list, or revoke other API keys — manage keys only from the web app (session login).
Connect WAMA (PKCE)
MCP hosts can obtain a key without paste using OAuth Authorization Code + PKCE against the public client wama-mcp (no client secret). After browser login and consent (point of sale + scope, default read), the token response’s access_token is the long-lived wama_… key (also returned as integration_api_key for compatibility).
For simple setup in each AI tool, see the MCP guide. Paste from Settings → Integrations remains fully supported.
Point of sale (tenancy)
All inventory, sales, and related data belong to a point of sale (POS).
Each API key is bound to one POS at creation. Requests authenticated with that key always use that POS — you do not switch POS with POST /api/point-of-sales/... when using an API key.
Create a separate key per warehouse/store if you need multiple POS contexts.
Pagination
List endpoints accept Spring Data pagination query parameters:
| Parameter | Description |
|---|---|
page | Zero-based page index |
size | Page size |
sort | Field and direction, e.g. timeModified,desc |
Successful list responses include:
| Header | Description |
|---|---|
X-Total-Count | Total matching items across all pages |
Errors
Most failures return JSON shaped like:
Parameterized domain errors may return { "message": "...", "params": ["..."] } instead.
Common auth outcomes:
| Status | Meaning |
|---|---|
| 401 | Missing, invalid, revoked, or expired API key |
| 403 | Key scope is read-only and the method mutates data |
Conventions
- JSON request and response bodies (
Content-Type: application/json) - Dates as ISO-8601 with offset (e.g.
2026-03-15T10:30:00.000Z) - Money as decimal amounts paired with currency objects where applicable
- Ids are server-assigned; omit them (or send
null) when creating resources
Example: list products
OpenAPI reference
Browse every public endpoint: