API and webhooks
Pass orders and stock to inventory management, accounting or shipping services.
For connecting other software, there is an Admin API and webhooks. You find both under Settings.
API keys
Under Settings → API keys, you create a key with the permissions it needs (e.g. read orders only). The key is shown only once – store it securely. The API is located at /api/v1; the key is sent as Authorization: Bearer …. Each key is allowed 120 requests per minute.
Typical requests:
GET /api/v1/orders– orders (filter by status and date)GET /api/v1/orders/{number}– one order with its itemsPOST /api/v1/orders/{number}/fulfillment– mark as shipped; with"notify": truethe customer gets the shipping confirmationGET /api/v1/orders/{number}/shipments– shipments of the order with tracking numbers and tracking linksPOST /api/v1/orders/{number}/shipments– record a shipment from another system, e.g.{"carrier": "DPD", "tracking_numbers": ["09812345"], "notify": true}. The order is marked as shipped ("fulfill": falseprevents that); for unknown carriers, give a link with{number}astracking_url. Every order also containstracking– the parcels of all shipments that are not cancelled.GET /api/v1/productsandGET /api/v1/products/{handle}– productsGET /api/v1/inventory– stock per item and location (filterssku,tracked=1),GET /api/v1/inventory/locations– stock locationsPOST /api/v1/inventory– set or change stock, up to 250 items at once, e.g.{"items": [{"sku": "SK-1", "quantity": 12}, {"sku": "SK-2", "adjust": -1, "location": "Store"}], "note": "Till"}. If one item has an error, nothing is changed. With"track": true, “Track stock” is switched on for items that do not track stock yet.POST /api/v1/inventory/transfers– move goods, e.g.{"sku": "SK-1", "from": "Store", "to": "Warehouse", "quantity": 2}(location as ID or name). Besidesquantity(total stock) the API returnssellable: what the online shop can sell, without locations that do not sell online.
For stock, the key needs the permissions Read stock or Change stock.
Webhooks
Under Settings → Webhooks, you enter an HTTPS address and choose the events (order placed, paid, shipped, cancelled or refunded, shipment created or cancelled, stock changed, newsletter subscribed or unsubscribed) for which the shop sends a message there. Every message is signed with the webhook’s secret (header X-Thimbly-Signature, HMAC-SHA256) – verify the signature in your software. If delivery fails, the shop retries up to six times at increasing intervals; you can see the history in the webhook.
Shipment created (shipment.created) and Shipment cancelled (shipment.cancelled) are sent for every shipping label and every recorded shipment – from the admin or the API – with the order and the shipment under shipment.
Newsletter subscribed (newsletter.subscribed) is sent as soon as someone has confirmed the subscription by e-mail, Newsletter unsubscribed (newsletter.unsubscribed) on unsubscribing – each with e-mail, language, source (checkout, account or form for the sign-up form), customer ID and time under subscriber. Newsletter subscriber erased (newsletter.erased) is sent when a subscription was deleted at the person's request (erasure request in the admin or deleted customer account) – even if it had been unsubscribed already – and contains only ID, e-mail and time (erased_at). Delete the contact in the newsletter service as well. Use them to keep a newsletter service up to date.
Stock changed (inventory.updated) is sent on every stock change – order, cancellation, adjustment, import, API or transfer – with the reason (reason) and the changed items with their stock per location (items, as in GET /api/v1/inventory).