Discount codes
Discount codes are created and managed in the Stripe dashboard, not in Beluga.
Checkout sets allow_promotion_codes, so Stripe’s hosted page owns the code field
and everything behind it: validation, expiry, usage caps, per-customer limits.
Beluga records what came off as discountCents on the order and shows it on the
confirmation page, the admin order, the confirmation email, the CSV export and the
order.paid webhook. It does not create, list or edit codes.
discountCents is stored, not subtracted: subtotalCents is Stripe’s pre-discount
figure and totalCents its post-discount one, so deducting it again would double it.
Owning codes in Beluga would mean owning validation, races on usage caps, and coupon synchronisation. This way the feature is complete and correct on day one.
Cart-condition discounts (“10% off orders over $50”) are not supported, because computing them Beluga-side would break the rule that prices only ever come from the database. Stripe’s own “minimum order amount” restriction on a promotion code covers the common case.