Orders

Order Types

Order, OrderItem, OrderTax, OrderDiscount, OrderCustomer, and OrderAmounts — the shapes returned by every Orders API endpoint.

Schemas returned by the Orders API and embedded inside CheckoutSession responses and Webhook payloads.

All monetary amounts are CurrencyAmount values in the order's currency (e.g. cents for USD, pence for GBP, etc).

Order

The full order resource.

FieldTypeDescription
idOrderIdUnique order identifier.
externalIdstring/nullYour internal order identifier, if provided at creation time. Unique per organization and mode.
providerstringSystem that holds the order's record: native for orders held by Decal, square or clover for POS.
currencyFiatCurrencyThe currency the order is charged in. Every amount on the order is in this currency.
statusstringopen, completed, or cancelled.
paymentStatusstringunpaid, partially_paid, paid, overpaid, partially_refunded, or refunded.
collectionMethodOrderCollectionMethodHow payment is expected. See OrderCollectionMethod.
issuedAtDateTimeWhen the bill was issued to the payer. Omitted on an immediate purchase or a bill not yet sent.
dueAtDateTimeWhen payment is expected. Omitted on an immediate purchase.
sourceOrderSourceRead-only. The channel that created the order. Always present. See OrderSource.
amountsOrderAmountsMonetary amounts for the order.
itemsOrderItem[]Line items.
taxesOrderTax[]Taxes applied to the order.
discountsOrderDiscount[]Discounts applied to the order.
customerOrderCustomer / nullCustomer snapshot at time of order.
shippingAddressShippingAddress / nullShipping address.
locationIdLocationId / nullID of the associated merchant location, if any.
metadataMetadata / nullKey/value data attached to the order.
paidAtDateTime / nullWhen payment was received.
createdAtDateTimeWhen the order was created.
updatedAtDateTimeWhen the order was last modified.
versionintegerRevision counter, starting at 1. Increments only when the order actually changes, so it is safe to compare across two reads or two webhook deliveries to decide which is newer. Unlike updatedAt, it does not move when a sync rewrites the order with identical data.

OrderCollectionMethod

How payment on an order is expected, returned as the collectionMethod field on every Order. It is a string union:

type OrderCollectionMethod = "immediate" | "invoice";
ValueDescription
immediateA purchase paid at checkout. issuedAt and dueAt are omitted.
invoiceA bill paid later. dueAt says when payment is expected; issuedAt is omitted until the bill is sent.

OrderSource

The channel that created an order, returned as the source field on every Order. It is set once when the order is created and never changes. It is read-only: no request accepts it, and orders created through the API are always api. It is a string union:

type OrderSource =
  | "storefront"
  | "checkout_link"
  | "api"
  | "dashboard"
  | "terminal"
  | "external_pos";
ValueDescription
storefrontPlaced by a customer on the merchant's Decal storefront.
checkout_linkCreated when a customer opened a checkout or payment link.
apiCreated through the Decal API.
dashboardCreated by the merchant's staff in the Decal dashboard.
terminalRung up on Decal's own counter systems.
external_posRung up on a connected third-party point of sale, such as Square.

source is independent of provider, which names the system that holds the order's record: an order created on a Decal storefront can still be held by a connected POS.

OrderAmounts

Grouped monetary amounts for the order.

FieldTypeDescription
subtotalCurrencyAmountSum of item totals.
taxCurrencyAmountTotal tax amount.
discountCurrencyAmountTotal discount amount.
tipCurrencyAmountTip amount.
totalCurrencyAmountAmount due: subtotal + tax - discount + tip.
paidCurrencyAmountAmount paid so far. Drives paymentStatus.

OrderItem

A line item on an order.

On create/update requests:

FieldTypeRequiredDescription
namestringyesDisplay name for the line item.
quantityintegeryesQuantity (must be a positive integer).
unitPriceCurrencyAmountyesPrice per unit. Must be non-negative.
descriptionstringnoItem description.
externalIdstringnoYour internal product identifier (SKU, POS ID, etc.).
metadataMetadatanoKey/value data for the item.

On responses, additional fields:

FieldTypeDescription
idstringItem identifier.
totalPriceCurrencyAmountunitPrice × quantity.
imageUrlstring/nullURL to an image for the item.
itemTypestringproduct for standard items, value_load for stored value reloads.

OrderTax

A tax line on the order.

On create/update requests:

FieldTypeRequiredDescription
typestringyesadditive (added on top of subtotal) or inclusive (already embedded in item prices).
amountCurrencyAmountyesTax amount. Must be positive.
namestringnoLabel shown on the receipt. Defaults to Tax.
externalIdstringnoYour internal tax identifier (e.g. from your POS or accounting system).

On responses, additional fields:

FieldTypeDescription
idstringTax identifier.
ratenumber/nullPercentage rate as a number (e.g. 8.5 for 8.5%) if applicable, otherwise null for flat amounts.
scopestringorder for order-level taxes, line_item for per-item taxes.

OrderDiscount

A discount line on the order. Provide one of two shapes on create/update depending on type.

Fixed amount (type: "fixed"):

FieldTypeRequiredDescription
typestringyesMust be fixed.
amountCurrencyAmountyesDiscount amount. Must be positive.
namestringnoLabel shown on the receipt. Defaults to Discount.
externalIdstringnoYour internal discount identifier (e.g. from your POS or coupon system).

Percentage (type: "percentage"):

FieldTypeRequiredDescription
typestringyesMust be percentage.
amountnumberyesPercentage to discount (e.g. 10 = 10% off), from 0.01 to 100. Rounded to two decimal places.
namestringnoLabel shown on the receipt. Defaults to Discount.
externalIdstringnoYour internal discount identifier (e.g. from your POS or coupon system).

Percentage discounts are calculated against the entire items subtotal automatically.

On responses, every discount has the same shape regardless of type:

FieldTypeDescription
idstringDiscount identifier.
namestringDiscount label.
typestringfixed or percentage.
amountnumberDeprecated — read percentOff and appliedAmount instead. For fixed discounts: CurrencyAmount. For percentage discounts: the percentage value (e.g. 10).
percentOffnumber/nullFor percentage discounts: the percentage taken off, to two decimal places (e.g. 12.5 for 12.5% off). null for fixed discounts.
appliedAmountnumberThe money the discount takes off, as a CurrencyAmount, for either type.
scopestringorder for order-level discounts, line_item for per-item discounts.
externalIdstringYour internal discount identifier, if provided at creation time.

OrderCustomer

On create/update requests — provide one of these to associate or create a customer:

FieldTypeDescription
idCustomerIdExisting Decal customer ID.
externalIdstringYour own customer identifier. Creates a customer record if none exists for this external ID.
emailstringCustomer email. Creates the customer record if they don't exist.
phonestringCustomer phone number. Creates the customer record if they don't exist.
namestringCustomer display name.

Resolution priority: id > externalId > email > phone. When a new customer is created via email or phone, the provided externalId (if any) is also stored on the record.

On responses:

FieldTypeDescription
idCustomerId / nullDecal customer ID, if a customer record exists.
externalIdstring/nullYour own customer identifier, if set on the customer record.
emailstring/nullCustomer email address.
phonestring/nullCustomer phone number.
namestring/nullCustomer display name.