APSync Documentation

Testing an order: the Tests page

The Tests page lets you describe an order in plain words and see exactly what APSync does with it. Nobody has to write a test. You can run it instantly, or for real on the test systems, and every result says how much of it was real.

Open it from the Tests button on the main page.

The two modes

Build an order describes any order with the dropdowns and runs it. Canonical tests lists the five canonical test invoices (see the testing guide, "The canonical test invoices"): DEMO-TIER-MULTI, DEMO-TIER-100, DEMO-BREAKOUT, DEMO-BUNDLE and DEMO-ADDR-SPLIT. Four of them were modeled on one real MOM invoice each, picked from the fifty-odd we hold as PDFs, so clicking one shows that MOM invoice beside HubSpot's invoice for the latest live run (or APSync's harness rendering until there is one). Run live rebuilds exactly that order on the test pair. No packing slip is shown unless MOM kept one for that very order.

The two ways to run

Recorded (instant). Runs APSync's real shipping code right now. The starting point is either a recording of a real run of this same order, or, if none exists yet, an educated guess from the product list. The result says which. It never touches HubSpot or QuickBooks.

Live on the test pair (a few minutes). Really creates the invoice in the AP Test HubSpot portal, presses Revise, writes it to the QuickBooks sandbox, waits for it to be tagged, and runs shipping. It saves a recording so the instant run knows the truth next time. It can only ever write to AP Test and the sandbox; it refuses anything else.

Describing the order

Reading the result

Every step of the run is listed as it happens. Each step carries a badge:

BadgeMeaning
realAPSync's own code ran on this order
recordedthe starting point was captured from a real run on the test pair
assumedbuilt from the product list because no real run exists yet
simulatedAPSync's real arithmetic decided it, but the runner built the lines itself
skippedthat part of the pipeline did not run here

A live run also says where each step ran (this tool or the deployed app) and how long it took.

"Okay, you can look at this now" appears inside a step the moment something exists to look at: the invoice in HubSpot, the invoice in the QuickBooks sandbox, the packing slip and ShipStation file from each shipping run, and at the end HubSpot's own rendered invoice PDF. Click and look while the run carries on.

Below the steps: the freight, what each shipping run sent (the ShipStation file as a table and the packing slip itself), HubSpot's invoice as the customer would see it, one MOM printout beside its like where we have one, and every line's final state.

The drift guard. When the instant run's assumption differs from what QuickBooks really held, the result says so under "The instant runner would have got this wrong". That is how a counting error in bundles was found on 2026-09-17. The order then replays from its recording, so it is right from there on.

Settings that change the result

The card on the left lists the shipping settings: release complete kits, hold the whole order when anything is short, ship an incomplete breakout, and shipping methods. Each says what it does when off and when on, and whether it is on right now. They are switched on the Feature Flags page, under "Shipping". Defaults are the conservative choice: whole orders, complete kits, complete breakouts. One rule no switch changes: a bundle never ships incomplete.

The Ledger card (canonical runs)

A live run of a canonical test ends with a Ledger card: what the QuickBooks sandbox posted because of that one invoice, read from QuickBooks' own Journal report and filtered to the run's document number, so nothing from any other invoice appears. Postings are grouped as receivable, revenue, sales tax, cost of goods sold and inventory asset, with the debits and credits totalled and checked. Above the table, the run's own steps are listed with the ones that could have moved the books marked POSTS: only steps that save the QuickBooks invoice can. Run Shipping rewrites status text and moves no amount; HubSpot is not the ledger. QuickBooks keeps only the current posting of an invoice, so the card is the invoice as it stands at the end, not a history. Stock the runner pinned is shown apart and flagged as the runner's doing.

About the HubSpot PDF

HubSpot does not render a PDF for a draft invoice. At the end of a live run the runner opens the invoice, which makes HubSpot render it, and fetches that PDF. Two things follow: HubSpot renumbers the invoice (UT-xxxxxx becomes INV-nnnn; the result tells you both), and nothing else can be changed on that invoice afterwards. Untick "fetch HubSpot's rendered PDF" if you want to keep editing it.

Good to know

See also