Skip to content
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

DEVDOCS-5646 [update] Checkouts, changes to discounts #186

Merged
merged 4 commits into from
Mar 25, 2024
Merged
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
28 changes: 22 additions & 6 deletions reference/checkouts.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1604,14 +1604,19 @@ paths:
- Checkout Discounts
summary: Add Discount to Checkout
description: |-
Adds a discount to an existing *checkout*.

This discount only applies to `line_items`. When you call this API, you clear out all existing discounts applied to line items, including product and order-based discounts.
Adds a discount to an existing checkout.

Use this endpoint to apply the following discounts:
* Apply a manual discount to a cart. In this case, you can distribute the discount between each line item in the cart based on the item value.
* Apply a manual discount against a specific line item.
* Apply a manual discount at the item-level with a cart-level discount.

This endpoint splits the discount between line items based on the item value.
Notes:
* When you call this API, you clear out all existing discounts applied to line items, including product and order-based discounts.
* You cannot apply a manual discount to a specific line item if you have already applied a coupon or automatic promotion to it.

Required Fields
* discounted_amount
Required Fields:
* `discounted_amount` at the cart-level or at the item-level
operationId: addCheckoutDiscount
parameters:
- $ref: '#/components/parameters/checkoutId'
Expand Down Expand Up @@ -1639,6 +1644,17 @@ paths:
name:
type: string
example: manual
line_items:
type: array
items:
type: object
properties:
id:
type: string
example: 8edef915-8e8e-4ebd-bece-31fbb1191a7e
discounted_amount:
type: number
example: 15
required: false
responses:
'200':
Expand Down
Loading