Skip to main content

discounts

Manage discounts, coupons, and promotional campaigns. Includes 8 shortcut commands and 15 API commands.

Shortcuts

Search existing discounts.

shoplazza discounts +search [flags]
FlagTypeDescription
--querystringSearch by discount name
--discount-codestringSearch by discount code
--progressstringProgress filter: ongoing, not_started, finished, paused
--discount-typestringDiscount type filter
--discount-targetstringTarget filter: product, order, shipping
--discount-methodstringMethod filter: automatic, discount_code
--page-limitintPage size (1–250)
shoplazza discounts +search
shoplazza discounts +search --query "Summer"
shoplazza discounts +search --discount-code SALE20
shoplazza discounts +search --progress ongoing --discount-type flashsale
shoplazza discounts +search --discount-target product --discount-method automatic

+rebate

Create an automatic tiered rebate (spend-and-save / buy-more-save-more).

shoplazza discounts +rebate [flags]
FlagTypeRequiredDescription
--targetstringYesScope: order or product
--tiersstringYesThreshold:discount pairs (comma-separated, e.g. 100:10,200:25)
--typestringType: amount-off, amount-percent, qty-off, qty-percent (default: amount-off)
--productsstringProduct IDs (comma-separated; for target=product)
--collectionsstringCollection IDs (mutually exclusive with --products)
--variantsstringVariant IDs (mutually exclusive with --products)
--excludeboolTreat IDs as exclusion list (default: false)
--limit-maxintMax total uses
--limit-userintMax uses per user
--limit-order-onceboolApply at most once per order (default: true)
--combinesstringCombinable with: order, product, shipping
--customer-segmentsstringRestrict to customer segment IDs
--namestringCampaign name (auto-generated if omitted)
--startstringStart time (default: now)
--endstringEnd time (default: -1, never expires)
# Order-level: $10 off at $100, $25 off at $200
shoplazza discounts +rebate --target order --tiers "100:10,200:25"

# Product-level: 20% off when buying 3+
shoplazza discounts +rebate --target product --type qty-percent \
--tiers "3:20" --products "id1,id2"

# With usage limits and expiry
shoplazza discounts +rebate --target order --tiers "100:10" \
--limit-max 1000 --limit-user 3 --start now --end "+7d"

+flashsale

Create a flash sale (automatic, time-limited).

shoplazza discounts +flashsale [flags]
FlagTypeRequiredDescription
--valuefloatYesDiscount value: percent → 1–99; fixed-price → new price; off → amount off
--typestringType: percent, fixed-price, off (default: percent)
--variantsstringVariant IDs (mutually exclusive with --collections)
--collectionsstringCollection IDs (mutually exclusive with --variants)
--price-rulestringBased on: price (sale price) or compare_at_price (default: price)
--limit-user-variantintMax quantity per user per variant
--limit-user-productintMax quantity per user per product
--limit-user-allintMax quantity per user across all sale products
--stockintDiscount-specific stock cap
--combinesstringCombinable with: order, product, shipping
--customer-segmentsstringRestrict to customer segments
--namestringCampaign name
--startstringStart time (default: now)
--endstringEnd time (default: -1)
# 20% off sitewide
shoplazza discounts +flashsale --value 20

# Fixed price $19.99 for specific variants
shoplazza discounts +flashsale --value 19.99 --type fixed-price --variants "v1,v2"

# $5 off by collection
shoplazza discounts +flashsale --value 5 --type off --collections "c1,c2"

# With stock and user limits
shoplazza discounts +flashsale --value 30 --stock 100 --limit-user-variant 2

+mn-discount

Create an Nth-item discount (buy M, get Nth at X% off).

shoplazza discounts +mn-discount [flags]
FlagTypeRequiredDescription
--tiersstringYesN:percent pairs (e.g. 2:30,3:50 — buy 2, 2nd item 30% off; buy 3, 3rd item 50% off)
--scopestringApply level: highest, all, highest-all (default: highest)
--productsstringProduct IDs
--collectionsstringCollection IDs
--variantsstringVariant IDs
--excludeboolTreat IDs as exclusion list (default: false)
--price-sortstringPrice sort direction: desc (high→low) or asc (default: desc)
--combinesstringCombinable with: order, product, shipping
--limit-maxintMax total uses
--limit-userintMax uses per user
--customer-segmentsstringRestrict to customer segments
--namestringCampaign name
--startstringStart time (default: now)
--endstringEnd time (default: -1)
# Buy 2, 2nd item 30% off; buy 3, 3rd item 50% off
shoplazza discounts +mn-discount --tiers "2:30,3:50"

# Scoped to specific products
shoplazza discounts +mn-discount --tiers "3:50" --products "id1,id2"

+percent-code

Create a percentage-off discount code.

shoplazza discounts +percent-code [flags]
FlagTypeRequiredDescription
--targetstringYesScope: order or product
--percentfloatYesDiscount percentage (1–99)
--productsstringProduct IDs (for target=product)
--variantsstringVariant IDs
--collectionsstringCollection IDs
--excludeboolTreat IDs as exclusion list
--min-amountfloatMinimum order amount (for target=order)
--min-quantityintMinimum item quantity (for target=product, default: 1)
--codestringDiscount code (auto-generated if omitted)
--combinesstringCombinable with: order, product, shipping
--limit-maxintMax total uses
--limit-userintMax uses per user
--customer-segmentsstringRestrict to customer segments
--namestringCampaign name
--startstringStart time (default: now)
--endstringEnd time (default: -1)
# Order-level 20% off
shoplazza discounts +percent-code --target order --percent 20

# Product-level 15% off for specific products
shoplazza discounts +percent-code --target product --percent 15 --products "id1,id2"

# Custom code with limits
shoplazza discounts +percent-code --target order --percent 10 --code SAVE10 \
--min-amount 50 --limit-max 500 --limit-user 1

+amount-code

Create a fixed-amount-off discount code.

shoplazza discounts +amount-code [flags]
FlagTypeRequiredDescription
--targetstringYesScope: order or product
--offfloatYesFixed amount off
--productsstringProduct IDs
--variantsstringVariant IDs
--collectionsstringCollection IDs
--excludeboolTreat IDs as exclusion list
--min-amountfloatMinimum order amount
--min-quantityintMinimum item quantity (default: 1)
--limit-order-onceboolApply at most once per order (default: true)
--codestringDiscount code
--combinesstringCombinable with: order, product, shipping
--limit-maxintMax total uses
--limit-userintMax uses per user
--customer-segmentsstringRestrict to customer segments
--namestringCampaign name
--startstringStart time (default: now)
--endstringEnd time (default: -1)
# Order-level $10 off
shoplazza discounts +amount-code --target order --off 10

# Product-level $5 off, min 2 items
shoplazza discounts +amount-code --target product --off 5 --min-quantity 2 --products "id1"

# Custom code with minimum order
shoplazza discounts +amount-code --target order --off 20 --code OFF20 --min-amount 100

+bxgy-code

Create a buy-X-get-Y discount code.

shoplazza discounts +bxgy-code [flags]
FlagTypeRequiredDescription
--productsstringBuy-side product IDs
--variantsstringBuy-side variant IDs
--collectionsstringBuy-side collection IDs
--excludeboolTreat buy-side IDs as exclusion list
--buy-quantityintTrigger quantity (mutually exclusive with --buy-amount)
--buy-amountfloatTrigger amount (mutually exclusive with --buy-quantity)
--get-productsstringGet-side product IDs
--get-variantsstringGet-side variant IDs
--get-collectionsstringGet-side collection IDs
--get-quantityintYesNumber of get items
--get-percentintGet-side discount % (1–99; one of percent/off/free required)
--get-offfloatGet-side fixed amount off
--get-freeboolGet items for free
--codestringDiscount code
--limit-orderintMax applications per order (default: 1, -1 for unlimited)
--combinesstringCombinable with: order, product, shipping
--limit-maxintMax total uses
--limit-userintMax uses per user
--customer-segmentsstringRestrict to customer segments
--namestringCampaign name
--startstringStart time (default: now)
--endstringEnd time (default: -1)
# Buy 3 of product A, get 1 of product B free
shoplazza discounts +bxgy-code --products "prodA" --buy-quantity 3 \
--get-products "prodB" --get-quantity 1 --get-free

# Spend $100 on A, get B at 50% off
shoplazza discounts +bxgy-code --products "prodA" --buy-amount 100 \
--get-products "prodB" --get-quantity 1 --get-percent 50

+free-shipping-code

Create a free shipping discount code.

shoplazza discounts +free-shipping-code [flags]
FlagTypeDescription
--offfloatShipping discount amount (omit for full free shipping)
--min-amountfloatMinimum order amount (mutually exclusive with --min-quantity)
--min-quantityintMinimum item quantity (mutually exclusive with --min-amount)
--countriesstringISO country codes (comma-separated) or all
--codestringDiscount code
--combinesstringCombinable with: order, product, shipping
--limit-maxintMax total uses
--limit-userintMax uses per user
--customer-segmentsstringRestrict to customer segments
--namestringCampaign name
--startstringStart time (default: now)
--endstringEnd time (default: -1)
# Full free shipping
shoplazza discounts +free-shipping-code

# $5 off shipping
shoplazza discounts +free-shipping-code --off 5

# Free shipping over $100
shoplazza discounts +free-shipping-code --min-amount 100

# Specific countries with custom code
shoplazza discounts +free-shipping-code --countries US,CA --code FREESHIP

API commands

All dynamic API commands share these flags:

FlagShortDescription
--paramsPath/query parameters as JSON
--dataRequest body as JSON
--jq-qjq expression to filter output
--dry-runPreview the request without executing

discounts

shoplazza discounts list
shoplazza discounts get --params '{"discount_id":"123"}'
shoplazza discounts create-automatic --data @discount.json
shoplazza discounts create-non-automatic --data @discount.json
shoplazza discounts update-automatic --params '{"discount_id":"123"}' --data @discount.json
shoplazza discounts update-non-automatic --params '{"discount_id":"123"}' --data @discount.json
shoplazza discounts delete --params '{"discount_id":"123"}'
shoplazza discounts batch-delete --data '{"ids":["123","456"]}'
shoplazza discounts get-by-code --params '{"code":"SALE20"}'
shoplazza discounts cancel --params '{"discount_id":"123"}'
shoplazza discounts restart --params '{"discount_id":"123"}'
shoplazza discounts combine --data @combine.json

discounts coupons

shoplazza discounts coupons create --data @coupon.json
shoplazza discounts coupons get --params '{"coupon_id":"123"}'
shoplazza discounts coupons update --params '{"coupon_id":"123"}' --data @coupon.json

Schema introspection

shoplazza schema discounts
shoplazza schema discounts.create-automatic