Skip to main content
POST

Query Parameters

offerTypes
string[]

Only apply offers of these types, such as appCoupon or personalOffer. Repeat the parameter for several. Omitted, every type.

excludedOfferTypes
string[]

Never apply offers of these types. Repeat the parameter for several. Omitted, no type is left out.

benefitTypes
enum<string>[]

Only apply offers granting these benefits: Discount, Bonus or both. Repeat the parameter for several. Omitted, both.

What an offer gives the customer at checkout.

  • Discount: a lower price, taken off the line or the basket total.
  • Bonus: loyalty bonus, granted on top of the price.

This list is not final. Lobyco may add a value at any time, and a consumer must not fail on a value it does not know.

Available options:
Discount,
Bonus
skipReservation
boolean

true to price the basket without reserving the coupons it applied, for example a basket the customer has not committed to yet. Default false: the applied coupons are reserved for a short time, 1 minute by default, under the basket's id.

preserveExternalDiscounts
boolean

true to return the discounts the POS sent as already applied, beside the ones Lobyco applied; false to leave them out. Omitted, your environment's setting applies, which is off unless Lobyco has turned it on.

Body

application/json

The basket as it stands.

The basket as it stands, to calculate discounts for.

id
string
required

The basket's id, such as the receipt id the sale will be recorded with. Lobyco reserves the coupons it applies under it, so a reservation can be released with the same value.

storeId
string
required

The store where the sale happens. Only coupons and offers valid in this store are applied.

total
number<double>
required

The basket total before Lobyco's discounts: the sum of the line items' totalSalePrice, with or without the basket-level discounts sent. A total that does not add up is refused.

lineItems
object[]
required

The lines of the basket, one per product and price.

discounts
object[]
required

Basket-level discounts the POS has already applied, with each line's share. Lobyco calculates on the prices after them. Empty when there are none.

coupons
object[]
required

The coupons behind the basket-level discounts the POS applied itself. Lobyco does not evaluate them. Empty when there are none.

customer
object | null

The checked-in customer. Omitted, the basket is anonymous and gets no discounts.

checkoutType
string | null

The kind of checkout, such as Pos or SelfCheckout. Set, only offers valid for that kind are applied; omitted, offers for every kind.

purchaseTime
string<date-time> | null

Evaluate the basket as of this time instead of now, so the coupons valid then are applied. Set it to replay an earlier purchase, as Lobyco's bonus allocation does; a POS pricing a sale now leaves it out.

Response

The basket with the discounts applied: finalTotal, each line's finalTotalSalePrice, and the discounts and coupons behind them. A basket with no applicable discounts comes back unchanged.

The basket with the discounts Lobyco applied: the final totals, and the discounts and coupons behind them.

id
string
required

The basket's id, as sent.

total
number<double>
required

The basket total as sent, before Lobyco's discounts.

finalTotal
number<double>
required

The basket total after every discount Lobyco applied, at line and basket level. On a return, the recommended refund as a negative amount.

lineItems
object[]
required

The lines as sent, each with its final price and the discounts and coupons applied to it.

discounts
object[]
required

The basket-level discounts Lobyco applied, each with its share per line. Preceded by the ones the POS sent when they are preserved.

bonuses
object[]
required

The basket-level bonus benefits Lobyco applied, when any offer grants bonus.

coupons
object[]
required

The coupons behind the basket-level discounts and bonuses. Redeem them once the sale completes.

Last modified on August 10, 2026