Skip to content

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 40 additions & 10 deletions reference/promotions.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ paths:
get:
tags:
- Promotions (Bulk)
summary: Get All Promotions
summary: Get All Promotions
description: |-
Returns a list of *promotions*.

Expand Down Expand Up @@ -120,7 +120,7 @@ paths:
get:
tags:
- Promotions (Single)
summary: Get Promotion
summary: Get Promotion
description: |-
Returns a single *promotion*.

Expand Down Expand Up @@ -170,7 +170,7 @@ paths:
delete:
tags:
- Promotions (Single)
summary: Delete Promotion
summary: Delete Promotion
description: |-
Deletes a promotion.

Expand All @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -819,6 +819,35 @@ 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'
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely!

maximum: 250
required:
- method_ids
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discount is probably required as well 😄

- discount
Discount:
title: Discount
description: '**Discount**'
Expand Down Expand Up @@ -928,9 +957,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
Expand All @@ -946,6 +975,7 @@ components:
- $ref: '#/components/schemas/GiftItemAction'
- $ref: '#/components/schemas/FixedPriceSetAction'
- $ref: '#/components/schemas/ShippingAction'
- $ref: '#/components/schemas/ShippingDiscountAction'
ProductOptionsItemMatcher:
title: Product Options Item Matcher
type: object
Expand Down Expand Up @@ -1338,7 +1368,7 @@ components:
success: 0
failed: 0
422 - Error Deleting:
example:
example:
errors:
- status: 422
title: Errors occurred in bulk delete action.
Expand Down
Loading