Skip to main content

SubscriptionUpdatePreview

creditinteger<int32>required

Unused time that would be credited at the current price, in the smallest currency unit.

Example: 500
chargeinteger<int32>required

Time that would be charged at the new price, in the smallest currency unit. An interval change charges the full new price rather than a fraction of it.

Example: 1200
netinteger<int32>required

The computed difference, charge minus credit. This is the amount that would move, in full: a refund the period's funding cannot cover is rejected rather than reduced, so a preview that returns a settlement returns the whole of it.

Example: 700
directionstringrequired

Whether the difference would be charged, refunded, or neither. none means the difference rounds to zero and no money moves.

Possible values: [charge, refund, none]

Example: charge
refundCappedbooleanrequireddeprecated

Always false. A refund is now either covered in full or the change is rejected, so there is no partial refund for this to report. Do not branch on it.

Example: false
effectiveAtinteger<int64>required

The date the change would take effect.

Example: 1636366897
currentPeriodEndnumber<int64>required

The end date of the current subscription period. Measured in seconds since the Unix epoch.

Example: 1636366897
newPeriodEndinteger<int64>

The end of the billing period the change would start. Present only when the change resets the period: an interval or intervalCount change, which restarts it from now, or a nextPaymentAt change, which moves the end to the new date.

Example: 1667902897
nextPaymentAtinteger<int64>

When the next payment would be taken. Present on the same changes as newPeriodEnd, and equal to it.

Example: 1667902897
SubscriptionUpdatePreview
{
"credit": 500,
"charge": 1200,
"net": 700,
"direction": "charge",
"effectiveAt": 1636366897,
"currentPeriodEnd": 1636366897,
"newPeriodEnd": 1667902897,
"nextPaymentAt": 1667902897
}