tillwire Read the guide
Recipes

Real jobs. With the code.

Tillwire does not have a button for every service you use. It has doors that are the same for you and for the engine: signed events, an API and modules in your own fork. Here is how people use them.

Can it…

Can it do this? An honest answer.

Four answers: built in, something you add, coming, or not yet. Built in means it is on main today: some of it reaches a shop with the next deploy. A package that is not built in is never marked as built in. Type what you need, for example “accounting”, “courier” or “theme”.

What is built in, and what you add
You want toAnswerHow
Sell products with optionsBuilt inUp to 3 options a product, such as size and colour, each variant with its own SKU, price and stock.
Group products into collectionsBuilt inHand-picked collections, and collections made by rules.
Let buyers check out without an accountBuilt inGuest checkout with no passwords. A buyer can sign in later by a link or a code.
Run sales, coupons and combosBuilt inSale prices, coupons, promotions and combos, with VAT.
Take a card paymentBuilt inTwo card gateways, signed notifications and refunds. Another gateway is a change to the engine.
Take a bank transfer or cash on deliveryBuilt inBank transfer at the checkout. Cash on delivery is off until you switch it on.
Sell gift cardsBuilt inSale, issue, redeem at checkout with part use, refunds to the card.
Show live courier rates and book a courierBuilt inRates, pickup points, booking, labels and tracking through one courier port.
Let buyers collect from a shopBuilt inCollection places, and free shipping per product.
Sell digital downloadsBuilt inSigned download links with limits, withdrawn on refund.
Print a tax invoice or a credit noteBuilt inAlso a pro forma, a quotation and a statement. Their numbers are in orders.get.
Quote a price to a business clientBuilt inQuotes for goods with a quotation and revisions, credit terms, and orders the shop enters.
Give staff roles and rightsBuilt inRights for each screen and each act.
Review a product before it goes liveBuilt inA review list, held changes, a note and a photo request.
Draft product text with AIComingThe engine part and its settings are on main. The screens where a person approves a draft are in progress. It stays off until you add a key.
Send marketing mail with proof of consentBuilt inTopics, contacts, segments, campaigns, A/B subject lines and click reports.
Start mail flows automaticallyBuilt inWelcome, abandoned cart, post-purchase and review request. Each flow is off until you switch it on.
Ask the buyer your own question at the checkoutBuilt inThe owner sets the questions and a gift option in the back office. The order event carries each answer.
Keep stock in many placesBuilt inLocations, a movement ledger, stock-takes, transfers and low-stock notices.
Feed a shopping channelBuilt inA product feed in XML and CSV. Off by default.
Redirect old addressesBuilt inA table of 301 and 302 redirects, with an import that previews first.
Ask for cookie consentBuilt inA banner and a settings page. Nothing loads before a choice.
Order from suppliersBuilt inSuppliers and supplier orders, with an event when one is made or changes state.
Back up while the shop runsBuilt inOne binary, one database, backed up while it runs, with restore and health checks.
Tell another system when something happensBuilt in40 signed event types as a feed or as webhooks, with retries and replay.
Send orders and refunds to an accounting packageYou add itThe engine has no connector for a named package. It gives you the order event with every field an invoice needs. See the recipe.
Add your own screen to the back officeYou add itA table, a screen, a menu entry and a staff right, in four files. See the four files.
Connect a courier of your ownYou add itYour own HTTP service on the courier protocol, proved with one certify command.
Change how the whole shop looksYou add itA theme: a folder on the storefront contract. See themes.
Sell at a tillComingA point of sale is in progress. It is not finished.
Sell subscriptionsComingSubscriptions work with the test gateway only.
Run a separate buyer app over an APINot yetBuyers shop on the engine’s own pages, in your theme. A separate buyer front is not built.
Recipe 1

Paid orders to your accounting package.

The engine raises an event when it records a payment. It does not wait for the buyer’s browser, so a buyer who closes the tab after paying still produces the event. Your module hears it and sends an invoice to the package.

  1. 01

    Queue it, fast

    The order hook runs inside the engine’s own write transaction, so it only writes one row of your own table. The event’s number is the key, so a try that repeats the same event does nothing. A refund that is later tied to lines comes as a new event with RefundTied true: skip it.

    engine/acme/accounts/queue.go
    func queue(ctx context.Context, tx ext.Tx, e ext.OrderEvent) error {
      switch e.Kind {
      case ext.OrderPaid, ext.OrderAccepted,
           ext.OrderRefunded, ext.OrderPartRefunded:
      default:
        return nil
      }
      if e.RefundTied { return nil } // booked when the refund was made
      body, err := json.Marshal(e)
      if err != nil { return err }
      _, err = tx.Exec(ctx, `INSERT INTO x_accounts_outbox
        (event_id, kind, number, body) VALUES (?, ?, ?, ?)
        ON CONFLICT (event_id) DO NOTHING`,
        e.ID, e.Kind, e.Number, string(body))
      return err
    }
  2. 02

    Send it, slowly

    A job on the engine’s worker runs outside any transaction, reads the unsent rows and calls the package. If the call fails, the job tries again with backoff. Send the event’s number as the package’s own reference, so a second try never makes a second invoice.

    engine/acme/accounts/module.go
    func init() {
      ext.RegisterMigrations("accounts", sql)
      ext.RegisterOrderHook("accounts", queue)
      ext.RegisterJob("accounts", "x_accounts_send",
        time.Minute, send)
      ext.RegisterEraser("accounts", erase)
    }
  3. 03

    Map what the event gives

    The event holds the order number, the buyer and the business, the billing and delivery addresses, each line with its tax class and rate, how it was paid, and the seller. For a refund it holds the amount, the lines and how the money went back. The guide lists each field and where it is.

    Three facts keep the books right. PaymentMode says live, test or unrecorded: pass on only a live sale. The gateway’s fee, GatewayFeeMinor, is valid only when GatewayFeeKnown is true, because unknown is not 0: when the gateway did not report it, take the fee from the gateway’s own report. A refund gives its VAT and the rest of it from its credit note, RefundVATMinor and RefundNetMinor, valid only when RefundVATKnown is true.

    The guide is docs/ACCOUNTING-MODULE.md in the repository.

    what the guide covers
    paid         invoice and payment
    part_refunded credit note for the amount
    refunded     credit note for the order
    RefundTied   skip: already booked
    ClientID     an order on account
    SellerKey    which seller's books
    PaymentMode  pass on only a live sale
    GatewayFee   only when known: unknown is not 0
    RefundVAT    from the refund's credit note

Why not a webhook for this? The webhook body is thin on purpose. Three events carry the money of a refund: order.part_refunded, order.refunded and order.cancelled (the cancel of a paid order). Each gives the amount, how the money went back, and the VAT of the refund’s credit note when it issued one, and the sum of their amounts is what was refunded. order.paid gives payment_mode, and gateway_fee_minor when the gateway reported the fee. None gives the lines, the buyer or the seller. A module hears every kind and gets the order facts in the event. Use a webhook service for a read-only job.

Recipe 2

Check a webhook. Try it here.

Every webhook has an Ecl-Signature header: a time and an HMAC-SHA256 of the time, a full stop and the exact bytes of the body. This box does the same check in your browser. Nothing you type is sent anywhere.

This box needs a browser with Web Crypto. The rule is in the webhook guide: sign t + "." + body with HMAC-SHA256, compare any v1 in constant time, and reject a time more than 5 minutes off.

The test vector is the one in the engine’s webhook guide: secret whsec_secret-one, time 1760000000, body {"id":"7","type":"order.paid"}.

Recipe 3

Tell your team when stock is low.

The event stock.low fires when a variant falls to its reorder level or below it, from above. Its data has the location, the stock on hand and the reorder level. A small receiver passes it on.

receiver.py
def handle(headers, body):
    if not verify(headers["Ecl-Signature"], body, SECRET):
        return 400
    event = json.loads(body)
    if event["type"] == "stock.low":
        d = event["data"]
        notify(f"{event['object']['id']} is low at {d['location']}: "
               f"{d['on_hand']} left, reorder at {d['reorder']}")
    return 200   # answer 2xx at once; a repeat has the same Ecl-Event-Id

The check function is the one in the webhook guide, in Python and Node.js. Register the receiver with POST /api/v1/webhooks/endpoints and the type stock.low.

More

Where to go next.

Guide

Build an accounting module

Which hook, each field an invoice needs, how to make a call safe to repeat, and what to do for a refund.

docs/ACCOUNTING-MODULE.md
Guide

Receive webhooks

The signature, the retries, the log and the replay, with code and a test vector.

specs/api/WEBHOOKS-INTEGRATOR.md
Guide

Add your own feature

A table, a screen, a menu entry and a staff right, in four files.

See the four files