From c2493b76fdc72406591f7f8495e8513736c7b546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurice=20Preu=C3=9F?= Date: Tue, 3 Nov 2026 12:43:17 +0100 Subject: [PATCH] Document monthly_cap, predecessor_id and expected_monthly_price Subscriptions (user token and app token) and checkout-session subscriptions take a net monthly cap and the subscription they replace (a resize shares the cap within the month). Attributes are passed through unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VbpgPaLqhBzo1AXHNs9Cx5 --- src/Id/Resources/AppCheckoutSessions.php | 2 ++ src/Id/Resources/AppSubscription.php | 3 +++ src/Id/Resources/AppSubscriptions.php | 6 ++++++ src/Id/Resources/Subscription.php | 5 +++++ src/Id/Resources/Subscriptions.php | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/src/Id/Resources/AppCheckoutSessions.php b/src/Id/Resources/AppCheckoutSessions.php index f4661f0..5c479f4 100644 --- a/src/Id/Resources/AppCheckoutSessions.php +++ b/src/Id/Resources/AppCheckoutSessions.php @@ -32,6 +32,8 @@ class AppCheckoutSessions * description?: null|string, * unit: string, * price: float|string, + * monthly_cap?: null|float|string, + * predecessor_id?: null|string, * vat_rate?: float, * payload?: null|array, * ends_at?: null|string diff --git a/src/Id/Resources/AppSubscription.php b/src/Id/Resources/AppSubscription.php index 03f3377..29b5549 100644 --- a/src/Id/Resources/AppSubscription.php +++ b/src/Id/Resources/AppSubscription.php @@ -17,6 +17,9 @@ use JsonSerializable; * @property ?string $description * @property string $unit * @property float $price + * @property ?float $monthly_cap net, at most this per calendar month (hour and day units) + * @property ?float $expected_monthly_price gross estimate for a month (720 hours, at most the monthly cap) + * @property ?string $predecessor_id the subscription this one replaced (a resize); they share the monthly cap * @property ?float $vat_rate * @property bool $active * @property bool $autorenew diff --git a/src/Id/Resources/AppSubscriptions.php b/src/Id/Resources/AppSubscriptions.php index e8e64f0..777da58 100644 --- a/src/Id/Resources/AppSubscriptions.php +++ b/src/Id/Resources/AppSubscriptions.php @@ -44,12 +44,18 @@ class AppSubscriptions * description?: null|string, * unit: string, * price: float|string, + * monthly_cap?: null|float|string, + * predecessor_id?: null|string, * vat_rate?: float, * payload?: null|array, * ends_at?: null|string, * idempotency_key?: null|string * } $attributes With an idempotency_key (max. 191 characters), a retried call returns the * subscription created by the first one instead of a duplicate. + * monthly_cap: net, at most this per calendar month (hour and day units only, + * at most 2 decimals, not below price; null = no cap). + * predecessor_id: the subscription this one replaces (a resize; same user and + * app, checked out, not cancelled): both share the monthly cap within a month. * * @throws ApiException */ diff --git a/src/Id/Resources/Subscription.php b/src/Id/Resources/Subscription.php index 58589fd..181d0f1 100644 --- a/src/Id/Resources/Subscription.php +++ b/src/Id/Resources/Subscription.php @@ -13,6 +13,9 @@ use Throwable; * @property string $description * @property string $unit * @property float $price + * @property ?float $monthly_cap net, at most this per calendar month (hour and day units) + * @property ?float $expected_monthly_price gross estimate for a month (720 hours, at most the monthly cap) + * @property ?string $predecessor_id the subscription this one replaced (a resize); they share the monthly cap * @property float $vat_rate * @property array $payload * @property string $ends_at @@ -32,6 +35,7 @@ class Subscription extends BaseResource * description: null|string, * unit: string, * price: float, + * monthly_cap?: null|float, * vat_rate: float, * payload: null|array, * ends_at: null|string @@ -41,6 +45,7 @@ class Subscription extends BaseResource * - description: The description (optional) * - unit: The unit (required when set, e.g. "hour", "day", "week", "month", "year") * - price: The price per unit (required when set) + * - monthly_cap: Net, at most this per calendar month (hour and day units; optional) * - vat_rate: The VAT rate (required when set) * - payload: The payload (optional) * - ends_at: The end date (optional) diff --git a/src/Id/Resources/Subscriptions.php b/src/Id/Resources/Subscriptions.php index 99b62d8..9b2a0f9 100644 --- a/src/Id/Resources/Subscriptions.php +++ b/src/Id/Resources/Subscriptions.php @@ -20,6 +20,8 @@ class Subscriptions extends BaseCollection * description: null|string, * unit: string, * price: float, + * monthly_cap?: null|float, + * predecessor_id?: null|string, * vat_rate: float, * payload: null|array, * ends_at: null|string @@ -29,6 +31,8 @@ class Subscriptions extends BaseCollection * - description: The description (optional) * - unit: The unit (e.g. "hour", "day", "week", "month", "year") * - price: The price per unit + * - monthly_cap: Net, at most this per calendar month (hour and day units, max. 2 decimals; optional) + * - predecessor_id: The subscription this one replaces (a resize); both share the monthly cap (optional) * - vat_rate: The VAT rate (required when set) * - payload: The payload (optional) * - ends_at: The end date (optional)