Xatern One API
Xatern One holds your data: catalog, orders, customers and payments. Your website owns the design. The API connects the two.
How it fits
- Your shop team works in Xatern One as usual.
- Your website reads the catalog and sends new orders through the API.
- Xatern One tells your own systems about changes with webhooks.
You never need to share a staff login. You use keys that you make and stop yourself.
Base address for every call:
Base address
https://api.xatern.com/v1Quick start
- Make a key. In Xatern One, open Settings, then Developers, then Make a key. Pick publishable for browser code or secret for your server. Copy the key. It is shown once.
- Make a first call. Ask the API who you are.
- Read the catalog. Then place a test order from your own code.
With curl
curl
curl https://api.xatern.com/v1/me \
-H "Authorization: Bearer xsk_live_YOUR_SECRET_KEY"With fetch
JavaScript
const res = await fetch("https://api.xatern.com/v1/catalog", {
headers: { Authorization: "Bearer xpk_live_YOUR_PUBLISHABLE_KEY" }
});
const data = await res.json();
if (!data.ok) throw new Error(data.error);
console.log(data.catalog.products.length, "products");What you get back
JSON
{
"ok": true,
"company": "Example Shop Co",
"kind": "secret",
"scopes": ["catalog:read", "orders:create", "orders:read", "customers:read", "subscribers:create", "leads:create", "webhooks:manage"]
}Keep secret keys on your server only. Never put one in browser code or a public repository. See Keys and scopes.
Where to go next
- Keys and scopes: what each key can do and the limits.
- Endpoints: every call with examples.
- Orders: the order object and how to place one.
- Webhooks: get told when an order changes.
- Errors and limits: what the error codes mean.
Xatern One API v1. Example data on these pages is made up.