Stripe subscriptions can add one-off items to the first invoice
The first charge of a subscription can carry extra items, such as a product bought along with it. An adjustment makes sure the plan coupon does not discount twice.
Someone subscribing to a plan and buying a product at the same time expects to pay for everything at once. The function that creates the subscription now accepts one-off items, which go on the first invoice along with the plan.
How it works
The code using the library passes, for each item, the product, the amount, the currency and the quantity. The library converts them to the format Stripe expects. An incomplete item is ignored, and with no items the request sent is the same as before.
The coupon adjustment
The end-to-end test showed a charge lower than it should be. With one-off items, the coupon passed on the subscription was applied by Stripe to the whole invoice, including the extra item, which already arrived with its own discount.
The coupon is now applied to the plan item, not to the subscription as a whole. The one-off item keeps the amount the project calculated.
The tests cover the conversion of items, invalid items, the case with no items and the coupon separation. The integration was validated in Stripe's test environment.
Source: Core · req-195 · BATCH-199