SetPriceOverride writes a custom price directly onto a SubscriptionItem, bypassing the plan’s default price for that subscriber. Use it to offer negotiated pricing, loyalty discounts, or temporary promotional rates on individual subscription items. When the override is cleared, the item reverts to the next price in the fallback chain (snapshot or live plan price).
Setting an override
Pass theSubscription, the target SubscriptionItem, a price in minor currency units (cents), and an optional expiry date.
Clearing an override
Passnull as the price to remove the override. Both price_override and price_override_expires_at are set to null.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
$subscription | Subscription | Yes | The subscription that owns the item |
$item | SubscriptionItem | Yes | The subscription item to override |
$price | int|null | Yes | Override price in minor currency units (cents), or null to clear |
$expiresAt | CarbonImmutable|null | No | When the override expires. null means permanent. Ignored when clearing. |
Return value
Returns the updatedSubscriptionItem model with refreshed attributes.
Validation
The action verifies that theSubscriptionItem belongs to the given Subscription. If the relationship does not match, a SubscriptionException is thrown.
Expiry behavior
When you set a time-limited override, theprice_override_expires_at column stores the expiry date. The override remains active until that date passes. At renewal time, RenewSubscription detects expired overrides, clears them, and fires the SubscriptionPriceOverrideReverted event.
Permanent overrides (no expiry) stay in effect indefinitely until you explicitly clear them.
Events fired
SubscriptionUpdated is dispatched after the override is saved.
SubscriptionPriceOverrideReverted is fired by the renewal process — not by this action.