Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Cupons de marketing ativos na vitrine.
storefront.coupons.list()
storefront.coupons.validate()
data: ['coupons']
id
string
name
code
discountType
'PERCENT' | 'CURRENCY'
amount
number
totalAvailable
0
usedCount
singleUsePerCustomer
boolean
automaticApply
startAt
endAt
string | null
const { nodes: coupons } = await storefront.coupons.list({ subtotal: cartSubtotal }); coupons.map((coupon) => ( <button key={coupon.id} type="button"> {coupon.code} — {coupon.amount} {coupon.discountType === 'PERCENT' ? '%' : ''} </button> ));
Was this page helpful?