API guide
Let another system, such as an accounting, stock or reporting tool, read your itsPOS products, stock and sales with an API key. The API is read-only: a key can never change anything in itsPOS.
Who can create keys
- Owners (and the Admin role, unless you changed it) create, rename and revoke keys on Integrations › API keys in the back office (app.itspos.io).
- API keys are part of your plan. If you don't see the page, ask us.
- You can only give a key access you have yourself. Only someone who sees every shop can give a key every shop.
Create a key
- Open Integrations › API keys and press Create API key.
- Name: what the key is for, for example "Stock tool" (1 to 40 characters).
- What this key can read: any of
- Products and prices (products and categories),
- Stock levels,
- Sales.
- Shops this key can read: every shop, or only the shops you choose. A key limited to Leeds can't read York's stock or sales. You can change the shops later; the key keeps working.
- Expires: after 30 days, 90 days, 1 year (the default) or never.
- Allowed IP addresses (optional): one per line, as an address (
203.0.113.7) or a range (203.0.113.0/24). Calls from anywhere else are refused. - Press Create. The key is shown once, starting
itk_. Copy it into the other system straight away. itsPOS keeps only a fingerprint of it and can never show it again.
To change a key's access, create a new key, move your other system to it, then Revoke the old key. A revoked key stops working at once.
Call the API
Send each request to https://app.itspos.io/api/method/<method> with two headers:
GET https://app.itspos.io/api/method/itspos.api.inventory.list_stock?page=1&page_length=50
Authorization: Bearer itk_…
X-itsPOS-Site: <your account>
X-itsPOS-Siteis your account, shown in the example on the API keys page.- Reads accept
GET(arguments as query parameters; objects JSON-encoded) orPOSTwith a JSON body (at most 64 KB). - Answers are JSON:
{ "data": [...], "total": 123 }for a list,{ "data": {...} }for one record. Ignore keys you don't know: new ones are added over time. - Money is in pounds as a number (
12.4is £12.40). Times are UTC (RFC 3339); dates areYYYY-MM-DD.
Methods a key can call
Only reading methods of products, stock and sales pass: itspos.api.catalog.*, itspos.api.inventory.* and itspos.api.sales.* whose name starts list_ or get_. Each also needs the matching access on the key. The ones most systems need:
| Method | Needs | Returns |
|---|---|---|
itspos.api.catalog.list_product |
Products and prices | Products with prices, barcodes and VAT |
itspos.api.catalog.get_product (name) |
Products and prices | One product |
itspos.api.catalog.list_category |
Products and prices | Categories |
itspos.api.inventory.list_stock |
Stock levels | Stock on hand per product and shop |
itspos.api.sales.list_transaction |
Sales | Sales and refunds, newest first |
itspos.api.sales.get_transaction (name) |
Sales | One sale with its lines, payments and VAT |
A method outside this pattern answers 404 "This method is not available with an API key.", and one the key's access doesn't cover answers 403.
Lists
Every list_ method takes:
| Argument | Meaning |
|---|---|
search |
Text to search for |
filters |
A JSON object of filters (unknown keys are refused) |
from_date, to_date |
Dates, inclusive, where the records have a date (sales) |
outlet |
One shop's code, for example OUT-0001. A key limited to some shops gets only those shops; asking for another one is refused |
page, page_length |
Pages start at 1; 20 a page unless you ask, at most 200 |
order_by |
"<field> asc" or "<field> desc" |
Errors
Errors are { "error": { "code": "...", "message": "..." } } with an HTTP status:
| Status | Code | Means |
|---|---|---|
| 400 | validation |
Something in the request is wrong; the message says what. A missing X-itsPOS-Site header is this too |
| 401 | unauthorized |
No key, an unknown key, or a revoked or expired one |
| 403 | forbidden |
The key can't read this, or a shop it isn't allowed, or the call came from an address that isn't allowed ("This API key cannot be used from this IP address.") |
| 403 | feature_disabled |
API keys aren't on your plan |
| 404 | not_found |
The record or method doesn't exist for API keys |
| 429 | rate_limited |
More than 600 calls a minute with this key. Wait a minute and slow down |
| 503 | unavailable |
itsPOS can't be reached right now. Try again shortly |
Keep your data safe
- Treat a key like a password. Don't put it in a web page, an app on a phone, or a shared spreadsheet; keep it on the server of the system that uses it.
- Give each system its own key, with only the access and shops it needs, and an expiry.
- Add allowed IP addresses when the other system has fixed ones.
- Sales can include your customers' names on receipts. Only give Sales access to a system you trust with that, and check that your agreement with its provider covers it. That provider works under your own agreement with them, not ITSolver's.
- Last used on the API keys page shows when each key was last used. Revoke any key you don't recognise.
- Creating, renaming, changing shops and revoking a key are in the Activity log.
Help
- Questions about the API: support@itspos.io.
- Questions or a complaint about how itsPOS handles data: privacy@itspos.io, or itspos.io/help#privacy. We acknowledge every complaint within 30 days.