Discount subscriptions per billed period

discount (label, percent_off or amount_off, duration once, repeating or
forever) when creating subscriptions and per subscription of checkout
sessions, the discount field on subscriptions and the
subscription.discount_ended event type.
This commit is contained in:
Maurice Preuß committed 2026-11-04 21:24:22 +01:00
1 parent 5cc1a519c3
commit bf21142f72
10 files changed
+104 -2

No files matched your search

+3 -1
View File
@@ -27,7 +27,8 @@ class Subscriptions extends BaseCollection
* ends_at: null|string,
* trial_days?: null|int,
* trial_ends_at?: null|string,
* trial_once?: bool
* trial_once?: bool,
* discount?: null|array{label: string, percent_off?: float|string, amount_off?: float|string, duration: string, duration_in_periods?: int}
* } $attributes The subscription data:
* - group: The group (optional)
* - name: The name
@@ -42,6 +43,7 @@ class Subscriptions extends BaseCollection
* - trial_days: A free trial of 1–365 days from the user's confirmation on (optional)
* - trial_ends_at: Or a fixed end of the free trial (ISO 8601, in the future; optional)
* - trial_once: Refuse the trial if the user already had one with the app in the group (optional)
* - discount: A discount per billed period, see AppSubscriptions::create() (optional)
* @throws Throwable
*/
public function create(array $attributes): Subscription