-
Notifications
You must be signed in to change notification settings - Fork 43
PROMO-1050 Add shipping discount action #358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
c66a71d
fd39e6d
5236071
a47c1ba
d15febb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ paths: | |
get: | ||
tags: | ||
- Promotions (Bulk) | ||
summary: Get All Promotions | ||
summary: Get All Promotions | ||
description: |- | ||
Returns a list of *promotions*. | ||
|
||
|
@@ -120,7 +120,7 @@ paths: | |
get: | ||
tags: | ||
- Promotions (Single) | ||
summary: Get Promotion | ||
summary: Get Promotion | ||
description: |- | ||
Returns a single *promotion*. | ||
|
||
|
@@ -170,7 +170,7 @@ paths: | |
delete: | ||
tags: | ||
- Promotions (Single) | ||
summary: Delete Promotion | ||
summary: Delete Promotion | ||
description: |- | ||
Deletes a promotion. | ||
|
||
|
@@ -189,7 +189,7 @@ paths: | |
get: | ||
tags: | ||
- Coupon Codes (Bulk) | ||
summary: Get Coupon Codes | ||
summary: Get Coupon Codes | ||
description: |- | ||
Get codes for a particular promotion. | ||
|
||
|
@@ -204,7 +204,7 @@ paths: | |
post: | ||
tags: | ||
- Coupon Codes (Single) | ||
summary: Create A Coupon Code | ||
summary: Create A Coupon Code | ||
description: |- | ||
Create a new code for the promotion. | ||
|
||
|
@@ -242,7 +242,7 @@ paths: | |
delete: | ||
tags: | ||
- Coupon Codes (Bulk) | ||
summary: Delete Multiple Coupon Codes | ||
summary: Delete Multiple Coupon Codes | ||
description: |- | ||
Deletes multiple coupon codes relating to the given promotion. Currently, batches are limited to 50 coupon codes. | ||
|
||
|
@@ -819,6 +819,39 @@ components: | |
minimum: 1 | ||
required: | ||
- zone_ids | ||
ShippingDiscountAction: | ||
title: Shipping Discount Action | ||
type: object | ||
description: |- | ||
**Shipping Discount Action** | ||
Discounts shipping, optionally restricted to specific shipping methods. | ||
properties: | ||
shipping_discount: | ||
type: object | ||
properties: | ||
discount: | ||
$ref: '#/components/schemas/Discount' | ||
as_total: | ||
type: boolean | ||
description: |- | ||
Set this value to true to distribute the discount as a total among shipping destinations. By default, the discount applies to each destination. | ||
Example: If set to false, the discount is $10 and you have 2 shipping destinations eligible for this discount, the shipping cost for both destinations will be discounted by $10, with a total of $20 off the order. | ||
If set to true, $10 will be distributed among the 2 shipping destinations, weighted by their respective price. In a case where there are 2 destinations sharing the same cost, each will be discounted by $5. | ||
method_ids: | ||
description: '' | ||
oneOf: | ||
- type: string | ||
enum: | ||
- '*' | ||
description: All configured shipping methods. | ||
- type: array | ||
uniqueItems: true | ||
description: List of shipping method IDs to which the shipping discount can apply. | ||
items: | ||
type: integer | ||
minimum: 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to enforce some sort of sanity check maximum? Just so we don't inevitably have merchants finding creative ways to abuse this and potentially listing hundreds of shipping methods? We can always increase the limit if discover a legit use case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely! |
||
required: | ||
- method_ids | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Discount: | ||
title: Discount | ||
description: '**Discount**' | ||
|
@@ -928,9 +961,9 @@ components: | |
type: array | ||
description: Specifies where the notification message will be displayed. | ||
example: | ||
- HOME_PAGE | ||
- PRODUCT_PAGE | ||
- CART_PAGE | ||
- HOME_PAGE | ||
- PRODUCT_PAGE | ||
- CART_PAGE | ||
- CHECKOUT_PAGE | ||
items: | ||
type: string | ||
|
@@ -1338,7 +1371,7 @@ components: | |
success: 0 | ||
failed: 0 | ||
422 - Error Deleting: | ||
example: | ||
example: | ||
errors: | ||
- status: 422 | ||
title: Errors occurred in bulk delete action. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice this during initial UX review.
I'm wondering if this can be omitted to "per destination" for the 1st iteration ? distribute as a total amount is definitely doable engineering wise, but from past experience, it's also a source of rounding bugs, so we only want to take on the additional complexity when we're sure that the demand is there.
Probably worth asking JW to confirm if this is required for WD, if not, we can reduce the scope a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! Let's see if we can limit it to per desitination then expand with this later if needed.