TTocler Docs
Dashboard
Developers›Your shop’s API

The shop API: your first request

Make a key with only what your server needs, send it from your server, and read your shop.

Updated 3 November 2026Live from Tocler
  1. Make a key (store owner)

    Dashboard → Settings → Developers → API keys → Make a key. Choose only the permissions (scopes) your server needs, optionally the addresses it calls from, and how long the key works. Confirm with your password (and your 2-step code). Copy the key — it is shown once.

  2. Keep it on your server

    Put it in your server’s secret settings (an environment variable). Never in a web page, an app or a repository — Tocler refuses calls from browsers.

  3. Send your first request

    Read the key itself — GET /v1/key needs no scope and tells you what the key may do.

Your first request
curl https://api.tocler.com/v1/key \
  -H "Authorization: Bearer $TOCLER_KEY"

Changing things safely

Every POST and PATCH needs an Idempotency-Key header — make one per action (for example your own cart or order id) and send the same one when you retry after a timeout. Tocler then answers with the first result instead of doing it twice.

Errors you will meet

  • 401 invalid_key / key_revoked / key_expired — the key. Rotate it in the Dashboard.
  • 403 missing_scope — the key wasn’t given that permission. Make a key with it.
  • 403 ip_not_allowed — the call came from an address not on the key’s list.
  • 429 rate_limited — wait Retry-After seconds.
  • 409 conflict — something changed meanwhile (a sale took the stock you saw). Read again.

Rotating a key

Rotate makes a new key with the same permissions; the old one can keep working up to 24 hours so you can switch without a gap. You get an email 14 days before a key expires, and every new or revoked key is emailed to the store owner.

Was this page helpful?