Xatern OneAPI v1

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

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/v1

Quick start

  1. 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.
  2. Make a first call. Ask the API who you are.
  3. 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

Xatern One API v1. Example data on these pages is made up.