discounts
Manage discounts, coupons, and promotional campaigns. Includes 8 shortcut commands and 15 API commands.
Shortcuts
+search
Search existing discounts.
shoplazza discounts +search [flags]
| Flag | Type | Description |
|---|---|---|
--query | string | Search by discount name |
--discount-code | string | Search by discount code |
--progress | string | Progress filter: ongoing, not_started, finished, paused |
--discount-type | string | Discount type filter |
--discount-target | string | Target filter: product, order, shipping |
--discount-method | string | Method filter: automatic, discount_code |
--page-limit | int | Page 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]
| Flag | Type | Required | Description |
|---|---|---|---|
--target | string | Yes | Scope: order or product |
--tiers | string | Yes | Threshold:discount pairs (comma-separated, e.g. 100:10,200:25) |
--type | string | Type: amount-off, amount-percent, qty-off, qty-percent (default: amount-off) | |
--products | string | Product IDs (comma-separated; for target=product) | |
--collections | string | Collection IDs (mutually exclusive with --products) | |
--variants | string | Variant IDs (mutually exclusive with --products) | |
--exclude | bool | Treat IDs as exclusion list (default: false) | |
--limit-max | int | Max total uses | |
--limit-user | int | Max uses per user | |
--limit-order-once | bool | Apply at most once per order (default: true) | |
--combines | string | Combinable with: order, product, shipping | |
--customer-segments | string | Restrict to customer segment IDs | |
--name | string | Campaign name (auto-generated if omitted) | |
--start | string | Start time (default: now) | |
--end | string | End 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]
| Flag | Type | Required | Description |
|---|---|---|---|
--value | float | Yes | Discount value: percent → 1–99; fixed-price → new price; off → amount off |
--type | string | Type: percent, fixed-price, off (default: percent) | |
--variants | string | Variant IDs (mutually exclusive with --collections) | |
--collections | string | Collection IDs (mutually exclusive with --variants) | |
--price-rule | string | Based on: price (sale price) or compare_at_price (default: price) | |
--limit-user-variant | int | Max quantity per user per variant | |
--limit-user-product | int | Max quantity per user per product | |
--limit-user-all | int | Max quantity per user across all sale products | |
--stock | int | Discount-specific stock cap | |
--combines | string | Combinable with: order, product, shipping | |
--customer-segments | string | Restrict to customer segments | |
--name | string | Campaign name | |
--start | string | Start time (default: now) | |
--end | string | End 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]
| Flag | Type | Required | Description |
|---|---|---|---|
--tiers | string | Yes | N:percent pairs (e.g. 2:30,3:50 — buy 2, 2nd item 30% off; buy 3, 3rd item 50% off) |
--scope | string | Apply level: highest, all, highest-all (default: highest) | |
--products | string | Product IDs | |
--collections | string | Collection IDs | |
--variants | string | Variant IDs | |
--exclude | bool | Treat IDs as exclusion list (default: false) | |
--price-sort | string | Price sort direction: desc (high→low) or asc (default: desc) | |
--combines | string | Combinable with: order, product, shipping | |
--limit-max | int | Max total uses | |
--limit-user | int | Max uses per user | |
--customer-segments | string | Restrict to customer segments | |
--name | string | Campaign name | |
--start | string | Start time (default: now) | |
--end | string | End 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]
| Flag | Type | Required | Description |
|---|---|---|---|
--target | string | Yes | Scope: order or product |
--percent | float | Yes | Discount percentage (1–99) |
--products | string | Product IDs (for target=product) | |
--variants | string | Variant IDs | |
--collections | string | Collection IDs | |
--exclude | bool | Treat IDs as exclusion list | |
--min-amount | float | Minimum order amount (for target=order) | |
--min-quantity | int | Minimum item quantity (for target=product, default: 1) | |
--code | string | Discount code (auto-generated if omitted) | |
--combines | string | Combinable with: order, product, shipping | |
--limit-max | int | Max total uses | |
--limit-user | int | Max uses per user | |
--customer-segments | string | Restrict to customer segments | |
--name | string | Campaign name | |
--start | string | Start time (default: now) | |
--end | string | End 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]
| Flag | Type | Required | Description |
|---|---|---|---|
--target | string | Yes | Scope: order or product |
--off | float | Yes | Fixed amount off |
--products | string | Product IDs | |
--variants | string | Variant IDs | |
--collections | string | Collection IDs | |
--exclude | bool | Treat IDs as exclusion list | |
--min-amount | float | Minimum order amount | |
--min-quantity | int | Minimum item quantity (default: 1) | |
--limit-order-once | bool | Apply at most once per order (default: true) | |
--code | string | Discount code | |
--combines | string | Combinable with: order, product, shipping | |
--limit-max | int | Max total uses | |
--limit-user | int | Max uses per user | |
--customer-segments | string | Restrict to customer segments | |
--name | string | Campaign name | |
--start | string | Start time (default: now) | |
--end | string | End 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]
| Flag | Type | Required | Description |
|---|---|---|---|
--products | string | Buy-side product IDs | |
--variants | string | Buy-side variant IDs | |
--collections | string | Buy-side collection IDs | |
--exclude | bool | Treat buy-side IDs as exclusion list | |
--buy-quantity | int | Trigger quantity (mutually exclusive with --buy-amount) | |
--buy-amount | float | Trigger amount (mutually exclusive with --buy-quantity) | |
--get-products | string | Get-side product IDs | |
--get-variants | string | Get-side variant IDs | |
--get-collections | string | Get-side collection IDs | |
--get-quantity | int | Yes | Number of get items |
--get-percent | int | Get-side discount % (1–99; one of percent/off/free required) | |
--get-off | float | Get-side fixed amount off | |
--get-free | bool | Get items for free | |
--code | string | Discount code | |
--limit-order | int | Max applications per order (default: 1, -1 for unlimited) | |
--combines | string | Combinable with: order, product, shipping | |
--limit-max | int | Max total uses | |
--limit-user | int | Max uses per user | |
--customer-segments | string | Restrict to customer segments | |
--name | string | Campaign name | |
--start | string | Start time (default: now) | |
--end | string | End 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]
| Flag | Type | Description |
|---|---|---|
--off | float | Shipping discount amount (omit for full free shipping) |
--min-amount | float | Minimum order amount (mutually exclusive with --min-quantity) |
--min-quantity | int | Minimum item quantity (mutually exclusive with --min-amount) |
--countries | string | ISO country codes (comma-separated) or all |
--code | string | Discount code |
--combines | string | Combinable with: order, product, shipping |
--limit-max | int | Max total uses |
--limit-user | int | Max uses per user |
--customer-segments | string | Restrict to customer segments |
--name | string | Campaign name |
--start | string | Start time (default: now) |
--end | string | End 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:
| Flag | Short | Description |
|---|---|---|
--params | Path/query parameters as JSON | |
--data | Request body as JSON | |
--jq | -q | jq expression to filter output |
--dry-run | Preview 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