Purchase
One checkout. Every line the buyer bought hangs off it, every source that paid for it, and everything it created.
Fields
idID!confirmationCodeString!The short code the buyer reads off their confirmation and gives at the desk, like 7KQ2-XM9P. Derived from the id, so it never changes and needs no lookup table; staff can search for it.
statusPurchaseStatus!adConversionPurchaseAdConversion!What the order is worth to an ad platform: the pre-tax amount after discounts, less what has been refunded (no tax, tip or donation), with the currency upper-cased. The hosted page's ad tags and the server-side upload report this same value. See documentation/features/ad-conversions.md.
buyerBuyer!Who bought it. An anonymous buyer is a name and an email on the order, not a manufactured account.
items[PurchaseItem!]!currencyString!ISO 4217 currency code, lowercase.
subtotalInt!Sum of the lines before discounts and tax, in cents.
discountTotalInt!Total taken off by codes and rules, as a positive number.
taxTotalInt!taxBreakdown[TaxBreakdownLine!]!taxTotal by jurisdiction, as the order's receipt splits it (GST and QST in Quebec), each with the rate it was charged at. Empty when the order recorded no split: draw one line for taxTotal then. When the lines fall short of taxTotal (an order taxed before its split was recorded in full), the rest is the receipt's "Other tax".
tipTotalInt!Gratuity, added after tax and never itself taxed.
donationTotalInt!Donation to the business, added after tax beside the tip and never taxed.
totalInt!What the buyer pays: tax-, tip- and donation-inclusive. Every funding is stated against this same number, so they sum to it on a fully paid order.
balanceDueInt!What is still owed — total less what has been funded. Non-zero on a deferred collection, which confirms the booking and collects afterwards, and on a deposit order between the deposit and the final settlement.
depositAmountIntWhat this order asked for at checkout when it asked for less than its total — the deposit. Null on an ordinary order and on a wholly deferred one; neither asked for a part of itself.
Recorded rather than read back off the fundings, so a deposit split across a card and a gift card still reads as one deposit, and a refund cannot rewrite what was asked for.
bookings[Booking!]!entitlements[Entitlement!]!agreementDocumentPurchaseAgreementDocumentThe PDF of what the buyer agreed to and signed at checkout, when the order had a contract, acknowledgement or signature block.
formResponses[PurchaseBlockResponse!]!The buyer's answers to the product's purchase-page blocks, as recorded.
placedAtDateTime!completedAtDateTime