The Charge_SubscriptionModel
describes a recurring charge subscription.
When a new recurring charge is created, we silently create a subscription model under the hood. The subscription model holds the current details of a recurring plan, and is updated via web hook callback events.
This isn't the Membership Subscription The subscription model refers to the recurring payment on a charge only, not a membership subscription. A membership subscription can have a related subscription, but it might not.
You can use the Charge_SubscriptionModel
to accurately get the current state of any recurring payment detail for any charge. This is especially useful for exposing details like the date of the next payment for a customer.
Because subscriptions change and have activity outside of the Craft site, we keep this updated via web hooks.
Make sure your web hooks are configured Charge keeps the subscription model up to date via web hook callback events. If you've not got your callbacks properly enabled, the subscription model details can fall out of step with the actual details.
id
NumberchargeId
NumbercustomerId
NumberstripeId
Stringmode
String, live
or test
active
Booltrue
if active.status
Stringtrialing
, active
, past_due
, canceled
, or unpaid
. A subscription still in its trial period is trialing
and moves to active
when the trial period is over. When payment to renew the subscription fails, the subscription becomes past_due
. After Stripe has exhausted all payment retry attempts, the subscription ends up with a status of either canceled
or unpaid
depending on your retry settings.cancelAtPeriodEnd
BoolcurrentPeriodStart
Numberdate
filters to format this.currentPeriodEnd
Numberdate
filters to format this.endedAt
Number, or null
null
otherwise.trialStart
Number, or null
trialEnd
Number, or null
canceledAt
Number, or null
applicationFeePercent
NumberplanAmount
NumberplanName
StringplanInterval
String, day
, week
, month
, year
planIntervalCount
NumberplanTrialPeriodDays
NumberplanCurrency
Stringusd
.formatPlanNameShort
stripeLink
Stringhttps://dashboard.stripe.com/test/plans/sub_00000000