Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Add write-only Invoice.couponIds #795

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions spec/components/schemas/Invoices/Invoice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ properties:
items:
allOf:
- $ref: "#/components/schemas/InvoiceTax"
couponIds:
type: array
nullable: true
description: |
A list of coupons to redeem on the customer and restrict to this invoice.
Read more about [coupons here](https://help.rebilly.com/invoices-and-subscriptions/coupons-discounts).

This parameter respects the following logic:
- When not passed then applied coupons will not be changed.
- When empty array passed then all applied coupon redemptions will be canceled.
- When list of coupons is passed then not applied yet coupons will be applied, already applied coupons
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- When list of coupons is passed then not applied yet coupons will be applied, already applied coupons
- When list of coupons is passed then coupons will be redeemed (if not yet redeemed) and applied (if not yet applied). If already redeemed and applied, the state will not change.

will not change their state, applied coupons that are not presented in passed list will be canceled.
writeOnly: true
items:
type: string
description: Coupon ID
discounts:
type: array
description: Discounts applied
Expand Down