Add an order discount. Reference an existing CatalogDiscount by
catalogObjectId (price tracks the catalog), or define one inline. For a
LINE_ITEM-scoped discount, give it a uid and reference that from each
line's appliedDiscounts.
Add a line item to the order
Line item details
Builder instance for chaining
Add multiple line items at once
Array of line items
Builder instance for chaining
Add an order tax. Define an ad hoc tax inline with name + percentage,
or reference an existing CatalogTax by catalogObjectId. For a
LINE_ITEM-scoped tax, give it a uid and reference that from each line's
appliedTaxes. To charge only the taxes you add, also set
withPricingOptions({ autoApplyTaxes: false }).
Shorthand for a DRAFT order with autoApplyDiscounts: true.
⚠️ Not valid for a subscription order template — Square rejects
auto_apply_discounts there (The order template amount must not have auto_apply_discounts set to true). For a subscription template, use
withState('DRAFT') and make the amount explicit via addDiscount(...)
(catalog-authoritative) or per-line basePriceMoney. This helper remains
for non-subscription DRAFT orders that do want auto-applied pricing rules.
Preview the order without creating it Returns the order configuration that would be sent
Reset the builder to start fresh
Set the currency for the order
Currency code
Builder instance for chaining
Associate a customer with the order
Square customer ID
Builder instance for chaining
Provide an explicit idempotency key. Useful for retrying subscription template creation without producing duplicate orders.
Add a note to the order
Builder instance for chaining
Set pricing options. autoApplyDiscounts: true is required for templates
that should pick up customer-group pricing rules (wholesale tiers) at each
subscription billing cycle.
Add a reference ID for external tracking
External reference ID
Builder instance for chaining
Set the order state. Use 'DRAFT' when creating an order template that
will back a subscription phase.
Add a tip to the order
Tip amount in cents
Builder instance for chaining
Fluent builder for creating Square orders
Example