Admin guide: Settings

API & webhooks

On this page

Menu group: Settings · Permission needed: api

This is where you let other software work with your shop. An API key lets another system read your products, orders and stock, and change stock, prices and order status, but only what you tick. A webhook sends another system a message the moment something happens, such as a new order or a product running out. Only the Super Admin and Grokeeper can open it, because a key can change things in your shop. Nothing here can take payments, refund money, use coupons or delete anything.

What you see on this page#

Five tabs run across the top.

  • API keys - the keys you have made, what each may do, its limits, how much it was used, when it was last used and whether it is active, paused, expired or revoked. Create API key opens the form
  • Webhooks - the addresses your shop sends messages to, which events each gets, whether it is on, when it last worked and how often it succeeded in the last 7 days
  • Delivery log - every attempt to send a message, with the answer of the receiving system. Filter by endpoint, event, status or date; open a row to see the payload and the answer
  • Request log - every call made with a key (which key, what was called, the result, the time and the address). It never stores what was sent or returned and is kept 30 days
  • Documentation - the full guide for your developer: quick start, keys, every call with examples in curl, PHP and JavaScript, webhooks and how to check their signature, the retry schedule, Zapier and Make recipes, and downloads for an OpenAPI 3.1 file and a Postman collection

API keys and what they may do#

Give each system its own key and tick only what it needs. A key can never do more than the person who made it, and write permissions can only be given by a Super Admin.

  • Read products, Read orders, Read stock, Read customers, Read categories - the system can look but not change. Read orders includes the customer's name, contact details and delivery address, because shipping needs them. Read customers hides email and phone (a***@example.com) unless you switch on the personal details option
  • Write products - create draft products, change name, description, category, HSN, GST rate, sizes and prices, publish a complete product, and archive. It can never delete: removing a product only archives it, like Archive in All products
  • Update orders - move an order to its next status, add shipment details (courier, AWB, tracking link) and internal notes. It follows the same rules as the order page: a cancelled order is final and an online order must be paid before it is packed or shipped. It never marks an order paid and never refunds
  • Write stock - add, remove or set stock with a reason. Every change is in the stock history with the key as its author, and it cannot remove more than is available
  • Allowed IP addresses - leave empty for any address, or list the addresses (or ranges like 203.0.113.0/24) the key may be used from
  • Expires on - after that day the key stops working. Requests per minute - the key's own limit (default 120); over it the system gets "too many requests" until the minute is over
  • Pause, Rotate secret and Revoke - Pause stops the key for now and can be undone. Rotate gives the key a new secret and the old one stops at once. Revoke is permanent. Each is written to the Audit log
  • The secret is shown ONCE, when the key is created or rotated. Only a scrambled copy is kept, so if it is lost nobody can look it up: rotate the key. Keys made before this update keep working and can read products and orders, as they always did

Webhooks and the delivery log#

A webhook is a message from your shop to another system. Every message is signed so the receiver can check it really came from you.

  • Events - new order, paid, status changes (updated, cancelled, shipped, out for delivery, delivered), refund recorded, shipment details changed, product created, updated or archived, stock low or out, a new contact, and a new review. Tick the ones you want, or All events (which also includes events added later)
  • Signing secret - made for you, shown once, and kept encrypted. Rotate secret creates a new one and the old one keeps signing for 24 hours, so the receiving system can switch without losing messages
  • Include customers' personal details - on (as before) the order messages carry the customer's name, email, phone and address. Off hides the email and phone and leaves the street address out
  • Send test event - sends one made-up example (never a real customer) so you can see it arrive. It is marked as a test and is not retried
  • If 20 messages in a row are given up on, the endpoint is switched off automatically, the bell tells you and an email can be added (Settings > Emails > Webhook switched off). You can change the number, or set 0 to never switch off. Switch it on again from the endpoint's page
  • Delivery log - Delivered, Failed (a retry is planned), Given up and Waiting. Open a row for the payload that was sent and the first 500 characters of the answer. Redeliver sends the same event again with the same event id, marked manual. Redact personal details removes the customer's details from the stored copy and cancels any retry still waiting. The log is kept 30 days (failures 90 days)
  • For safety only public internet addresses are accepted: private, internal and localhost addresses are refused when you save and again each time a message is sent

Keeping it safe#

A few habits protect your shop.

  • Make a separate key for each system and tick the narrowest permissions. If one system is lost or hacked you revoke one key and nothing else stops
  • Never paste a key into a web page, a mobile app, a chat or a public repository. Treat it like a password
  • Set an expiry date or an allowed address when the system has a fixed address. Rotate keys now and then, and revoke any you no longer use (the keys list shows when each was last used)
  • Look at the Request log if something seems wrong: a burst of "401" or "403" results means someone is trying keys that do not work
  • Only a Super Admin should have the personal details option switched on, and only for a system that really needs customers' email addresses and phone numbers

Zapier and Make#

There is no ready-made GroKeeper app in Zapier or Make. They work through their general webhook tools.

  • A native Zapier app is NOT built. Use Webhooks by Zapier (Catch Hook) to receive events, and Webhooks by Zapier (Custom Request) to call the API. Zapier and Make can receive webhooks, so no dedicated GroKeeper app is needed
  • The Documentation tab has step-by-step recipes: a new order to a Google Sheet, stock running low to Slack or email, marking an order shipped from a spreadsheet row, and updating stock from a sheet; and the same in Make with Custom webhook and HTTP > Make a request
  • Zapier cannot check the signature, so keep the Zap's secret address private and switch off personal details if the Zap does not need them

What it cannot do#

Some things are deliberately left out.

  • No checkout, cart, payment, refund, credit note or coupon calls exist, and an order's payment status and amounts cannot be changed
  • Nothing can be deleted: removing a product archives it, and sizes cannot be removed through the API
  • Stock is never accepted on a product or size. It changes only through stock adjustments, which need a reason and are written to the stock history
  • Product imports do not send product webhooks (they would flood the receiver)

How do I create an API key?#

Also asked as: create api key; new api key; make an api key; generate api key; api key; api keys; rest api key; integration key; connect software; accounting sync key; create a key; key scopes; api permissions; read only api key

Steps

  1. Open SETTINGS > API & webhooks. It opens on API keys.
  2. Click Create API key.
  3. Give it a name that says what will use it, for example "Warehouse system".
  4. Tick only the permissions it needs. Reading is Read products, Read orders, Read stock, Read customers and Read categories. Changing things is Write products, Update orders and Write stock (only a Super Admin can give these).
  5. Optionally list the allowed IP addresses, set an expiry date and the requests-per-minute limit. Leave "Show customers' personal details" off unless the system truly needs emails and phone numbers.
  6. Click Create key. Copy the key shown at the top: it is shown only once. Give it to the developer and tell them to read the Documentation tab.

Tips

  • If the key is lost, open it and use Rotate secret to get a new one. Revoke any key you no longer use.
  • Make one key per system, with the narrowest permissions.

Why is my webhook failing?#

Also asked as: webhook failing; webhook failed; webhook not working; webhook is not working; webhook not arriving; webhook error; webhook retry; webhook switched off; webhook disabled; webhook delivery; delivery log; webhook timeout; webhook 500; webhook overdue; retries overdue; webhook problem

Steps

  1. Open SETTINGS > API & webhooks > Delivery log and filter by the endpoint (and status Failed or Given up).
  2. Open the failed row. "Problem" says what happened (for example HTTP 500, a time-out, or "Not sent" because the address points to a private network) and "What the receiver answered" shows the first part of its reply.
  3. Fix the receiving system: the address must be public and use https, it must answer with a 2xx status within 5 seconds, and it must not redirect to another site.
  4. Press Send test event on the endpoint's page to check it works, then Redeliver on any message that was missed.
  5. If the endpoint says Switched off, too many messages in a row were given up on. Fix the receiver, then open the endpoint and click Switch on.

Tips

  • A message is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours, then given up on (8 attempts).
  • If the receiver rejects the signature, check it uses the raw body and the right secret; Rotate secret gives you a new one.

How do I connect Zapier?#

Also asked as: connect zapier; zapier; zap; make.com; make integromat; integromat; catch hook; webhooks by zapier; automation; google sheets new order; send orders to google sheets; zapier webhook; zapier api

Steps

  1. There is no ready-made GroKeeper app in Zapier: you use Webhooks by Zapier (Zapier and Make can both receive webhooks, so no dedicated app is needed).
  2. To react to something in your shop: in Zapier make a Zap with the trigger Webhooks by Zapier > Catch Hook and copy the Custom Webhook URL.
  3. In SETTINGS > API & webhooks > Webhooks click Add webhook, paste that address, tick the events you want (for example Order created) and save. Switch off "Include customers' personal details" if the Zap does not need them.
  4. Open the endpoint and press Send test event. In Zapier press Test trigger: the example appears so you can pick its fields.
  5. To change something in your shop from Zapier: make a key with the narrowest write permission (for example Update orders) and use Webhooks by Zapier > Custom Request to call the address shown in the Documentation tab, with the key in an Authorization header.

Tips

  • The Documentation tab has four ready recipes (new order to a sheet, low stock alert, mark an order shipped, update stock) and the Make equivalents.
  • Keep the Zap's secret address private: Zapier cannot check the signature.

How do I update stock from another system?#

Also asked as: update stock from another system; update stock api; sync stock; stock sync; warehouse system stock; push stock; set stock from spreadsheet; inventory api; stock adjustment api; update stock automatically; stock from erp; update inventory from software

Steps

  1. Create a key with Write stock (and Read stock if the system also reads levels) in SETTINGS > API & webhooks > Create API key.
  2. The other system sends a request to POST /api/v1/inventory/adjustments with the size's SKU (or id), the mode (add, remove or set), the quantity and a reason such as received, damaged or correction. The Documentation tab has the exact example for curl, PHP and JavaScript.
  3. Use mode set with a counted number to make stock exactly that number (reason correction or other). Use add with received for a delivery.
  4. Ask the developer to send an Idempotency-Key with every request so a retry never adds stock twice.
  5. Check the result in Products > Inventory > Stock history: each line shows the reason, the balance after and the key that made it.

Tips

  • A change that would take stock below zero is refused. The SKU of a size can be set through the API when sizes are created or edited (a product with one size can also be found by the product SKU).
  • Stock cannot be changed any other way through the API.

How do I rotate, pause or revoke an API key?#

Also asked as: rotate api key; revoke api key; pause api key; lost api key; api key leaked; api key compromised; new secret; delete api key; stop api key; disable api key; switch off api key; change api key

Steps

  1. Open SETTINGS > API & webhooks and click Manage on the key.
  2. Pause key stops it for now (software using it gets an error) and Switch key on starts it again.
  3. Rotate secret gives the key a new secret and the old one stops working at once. Copy the new secret when it is shown: it is shown only once. Update the software that uses it.
  4. Revoke key stops it for good. It cannot be switched on again: create a new key if something still needs access.

Tips

  • If a key may have leaked, rotate or revoke it first, then look in the Request log for calls you do not recognise.

How do I add a webhook?#

Also asked as: add webhook; new webhook; create webhook; webhook url; webhook events; webhook secret; send test webhook; test webhook; webhook endpoint; order webhook

Steps

  1. Open SETTINGS > API & webhooks > Webhooks and click Add webhook.
  2. Enter a name and the address (URL) of the receiving system. It must be a public https address.
  3. Tick the events you want, or All events.
  4. Decide whether to include customers' personal details, then click Create webhook.
  5. Copy the signing secret shown at the top: it is shown only once. Give it to the developer so the receiving system can check each message.
  6. Press Send test event to see a made-up example arrive.

Tips

  • The developer can see how to check the signature (PHP, Node.js and Python samples) in the Documentation tab.

How do I send a webhook again?#

Also asked as: redeliver webhook; resend webhook; send webhook again; replay webhook; missed webhook; webhook missed; redact webhook; remove personal data webhook; webhook payload

Steps

  1. Open SETTINGS > API & webhooks > Delivery log and find the message (filter by endpoint, event, status or date, or paste its event id).
  2. Click View, check the payload and the answer, then click Redeliver.
  3. The same event is sent again with the same event id, marked manual, once. The receiving system should ignore events it already handled.
  4. To remove a customer's details from the stored copy, click Redact personal details on that page.

Tips

  • A message larger than 64 KB is stored cut, so it cannot be redelivered.

Where is the API documentation?#

Also asked as: api documentation; api docs; openapi; swagger; postman; api guide; developer guide; api reference; api examples; webhook signature; verify signature; check webhook signature; hmac

Steps

  1. Open SETTINGS > API & webhooks > Documentation.
  2. It lists every call with examples in curl, PHP and JavaScript, the permissions each needs, the error codes, and the webhook events with example messages.
  3. Webhooks > Check the signature has code for PHP, Node.js and Python.
  4. Use Download OpenAPI 3.1 or Postman collection at the top for tools that read them.

Tips

  • The address shown there comes from your store's web address setting, so it is the real one to use.