BlogRunning a shop

Connect your other tools to Commstate: API keys and order webhooks, explained

Let your warehouse app, a sheet or your own script read your shop and hear about orders as they change, with keys that can only do what you allow.

AkshayaBackend & AI Engineer · 3 min read

In short

  • Give each tool its own API key, with only the permissions it needs.
  • Webhooks call your URL when an order changes, signed with your secret.
  • Keys never touch your team, billing or settings, and every key expires.

Most shops end up with a tool or two beside their store: a warehouse app, a sheet the accountant keeps, a small script someone on the team wrote. Each one needs your orders. The usual shortcut is to hand it someone’s login. That works until that person leaves, changes their password, or the tool does more than you meant it to.

Commstate’s API gives each tool its own key instead, and webhooks tell your tools the moment an order changes. Both are on Growth and up.

One key per tool, not one login for everything

An API key belongs to an integration, not a person. You make it in the Developer section of your admin:

  • Name it after the tool, like “Warehouse sync”.
  • Tick what it may do. Each tick is a permission, such as seeing orders. Read-only permissions are ticked to start with, so writing is always a choice you make.
  • Set when it expires. Every key expires, a year at most.

The key is shown once, with a copy button. Keys start with csk_, so if one ever leaks into a chat or a document, it’s easy to search for.

Namethe tool it's for Tickonly what it needs Expirein days, not never Copyit once, into the tool

What a key can never do

A key can do its permissions and nothing else. Whatever you tick, a key can never manage your team, billing or settings, connect stores, or reach the AI and workflow routes. And a member can only give a key permissions they hold themselves.

Making a key also takes a password, a two-factor code if you use one, and every owner of the shop gets an email. All keys sit on one screen with who made each one and when it was last used. Revoke one and it stops at its next request.

Your first call

The Developer section shows your shop’s base URL, your shop’s X-Tenant value and a ready curl to paste. A request sends the key in X-Api-Key with your shop’s value, asks for JSON, and gets orders, products or customers back. Each key has its own limit, 120 requests a minute by default; past it, the answer is a 429 with a Retry-After.

Webhooks: hear about orders as they change

Polling for changes every few minutes is slow and wasteful. A webhook turns it around: you give Commstate a URL and pick the events, and the shop calls you when something happens to an order.

  • Events: created, cancelled, fulfilled and delivered, and changes to status, payment and shipment.
  • Signed: set a secret, and each call carries an HMAC signature, so your tool can check it really came from your shop.
  • Logged: every delivery is recorded, so when a tool says it missed an order, you can see what was sent and what came back.
  • Private addresses are refused, so a webhook can’t be pointed at something inside a network it shouldn’t reach.

When someone leaves

Keys belong to the shop, so an integration keeps running when the person who set it up moves on. Owners are told when a key’s maker leaves, so they can decide whether to keep it, and whether its permissions still make sense.

Where to start

Pick the one tool that matters most, give it a key with read-only permissions, and see it work. Add writing, or a second tool, only when you need it. Everything on the API is on the developers page.

Want this working in your shop? Talk to us.

Tell us what you sell and how many orders you handle. We will call you within one working day, and you can try it on a real order.

  1. You send this. It takes under a minute.
  2. We call you. Ask anything about moving your shop.
  3. You try it on a real order, free for 14 days.

Rather call now? +91 80860 03644

CommstateWe call within one working day

Roughly how many orders a month?
Where do you sell most?

We use these details to reply to you. Privacy.

Try it on your next order.

Connect your store and let one order run through. 14 days free, no card.