Skip to content
preview buildno database is connected, so orders placed here are not kept. see what is live and what is not

HOW THE STORE RUNS

The flow

this page is generated from the running store, not drawn by hand. the stages below are the ones the code actually has, the counts were read when you loaded this, and a stage that is not connected to anything says so instead of showing a zero.

STORAGE
in-process memory, not durable
READ AT
20 Sept 2026, 14:20
CONTRACT
v1

The pipeline

eight stages, in order. each one names the data it owns, where that data comes from and where it goes next. the count beside each stage was read when this page loaded.

  • livecarrying real data.
  • awaiting feedbuilt, not yet connected.
  • awaiting providerneeds a commercial account.
  • preview onlythis instance only.
  1. stage 1 of 8.live

    Catalogue

    WHAT WE SELL

    16products, 81 variants

    products, variants, prices and copy. versioned in the repository, so a price change is a commit with an author and a date.

    FROMthe repositoryTOstorefront, stock, basket

    OWNS
    • handle
    • name
    • price
    • variants
    • images
    • copy

    VIAno external system. this stage is ours end to end.

  2. stage 2 of 8.preview only

    Stock

    WHAT IS ON THE SHELF

    75skus in stock of 81

    held in this instance memory. a restart clears it.

    one number per sku. the only stage a warehouse system is allowed to write to, and it writes nothing else.

    FROMwarehouse feedTOstorefront availability, order reservation

    OWNS
    • sku
    • onHand
    • updatedAt

    VIAstock feedPOST /api/inbound/stock

  3. stage 3 of 8.live

    Basket

    BEFORE THEY COMMIT

    not counted on our side.held client-side by design

    held in the customer browser, never on our server, until they check out. nothing to count here and nothing to leak.

    FROMthe customer's browserTOcheckout

    OWNS
    • sku
    • quantity

    VIAno external system. this stage is ours end to end.

  4. stage 4 of 8.preview only

    Order

    TAKEN

    0orders

    held in this instance memory. a restart clears it.

    the moment a basket becomes a commitment. prices are copied onto the order and never read back from the catalogue again.

    FROMcheckoutTOpayment, fulfilment

    OWNS
    • reference
    • lines
    • unitPrice
    • address
    • totals
    • vat

    VIAno external system. this stage is ours end to end.

  5. stage 5 of 8.awaiting provider

    Payment

    MONEY IN

    nothing reported yet.orders paid

    no provider account yet. this is a measure of wiring, not of demand.

    a provider confirms, and the order carries its reference from then on. we never hold a card number.

    FROMpayment providerTOfulfilment

    OWNS
    • paymentRef
    • paidAt

    VIAStripePOST /api/webhooks/stripe

  6. stage 6 of 8.awaiting feed

    Fulfilment

    PICKED AND PACKED

    nothing reported yet.orders in the warehouse

    no feed is writing here yet, so this is what we hold, not what the warehouse holds.

    the warehouse moves the order through picking and packing, and pushes each step back to us.

    FROMwarehouseTOshipping

    OWNS
    • stage
    • history

    VIAfulfilment feedPOST /api/inbound/order-status

  7. stage 7 of 8.awaiting provider

    Shipping

    ON ITS WAY

    nothing reported yet.parcels out

    no provider account yet. this is a measure of wiring, not of demand.

    a carrier takes the parcel and gives us a tracking reference, which goes straight to the customer.

    FROMcarrierTOthe customer

    OWNS
    • trackingRef
    • dispatchedAt

    VIAcarrierPOST /api/inbound/order-status

  8. stage 8 of 8.awaiting provider

    Delivered

    DONE

    nothing reported yet.completed

    no provider account yet. this is a measure of wiring, not of demand.

    the end of the line, and the start of the returns window.

    FROMcarrierTOreturns, accounts

    OWNS
    • deliveredAt

    VIAno external system. this stage is ours end to end.


The contract

  • version 1
  • sluggers.uk

this store has no shared database and no shared code with anything else. whatever sits on the other side, a warehouse system, a spreadsheet, a nightly job, only has to produce the shapes below over plain http.

in the examples, a value that reads like a description is describing the type. the keys and the paths are exact.

AUTH

Authorization: Bearer <INBOUND_TOKEN>

every inbound request carries that header. when the token is not set on our side the endpoints refuse everything, because an unset secret must never mean an open door. the token is compared in constant time, so a wrong one cannot be found a character at a time.

INBOUND, INTO THE STORE

  • POST/api/inbound/stock

    set on-hand quantity per sku

    EXAMPLE BODY

    {
      "at": "ISO timestamp (optional)",
      "levels": [
        {
          "sku": "SLUK-HOOD-BLK-M",
          "onHand": 12
        }
      ]
    }

    RETURNS

    applied
    number
    unknown
    array of sku strings this catalogue does not have

    NOTES

    absolute levels, not deltas. the whole push is applied in one statement.

  • POST/api/inbound/order-status

    move an order forward and attach a tracking reference

    EXAMPLE BODY

    {
      "reference": "SL-XXXX-XXXX",
      "stage": "dispatched",
      "trackingRef": "AB123456789GB"
    }

    RETURNS

    reference
    string
    stage
    string

    NOTES

    stages only move forward. cancelled puts the stock back.

OUTBOUND, OUT OF THE STORE

  • GET/api/outbound/orders?since=<ISO>

    pull orders that need picking

    RETURNS

    orders
    array of order objects with lines, sizes and address

THE TWO THINGS BOTH SIDES MUST AGREE ON

SKU FORMAT
SLUK-<PRODUCT>-<COLOUR>-<SIZE>, e.g. SLUK-BJRS-ORGBLK-L
a sku the catalogue does not have is reported back rather than ignored, so a mapping mistake on the other side shows up on the first push.
CURRENCY
GBP, integer pence, VAT inclusive
money crosses this boundary as whole pence, never as a decimal, and never rounded on the way.