#maxime1992
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- maxime1992, 21 hours ago, 30 messages
Can you share a sub_xxx and/or in_xxx ID that demonstrates this please
Actually, maybe the req_xxx ID from one of your requets to the upcoming invoice endpoint that returns the unexpected amount
req id: req_ITYtYa7VcDtLLu
Taking a look
Can you share the lines field from the JSON response of that request? We don't log GET request responses unfortunately
yup 1s
<com.stripe.model.InvoiceLineItemCollection@739333799 id=> JSON: {
"object": "list",
"data": [
{
"amount": 0,
"amount_excluding_tax": 0,
"currency": "gbp",
"description": "------",
"discount_amounts": [],
"discountable": true,
"discounts": [],
"id": "il_tmp_16905eJdX8lIDNiaac5ea562",
"invoice_item": null,
"livemode": false,
"metadata": {},
"object": "line_item",
"period": {
"end": 1705569417,
"start": 1704964617
},
"plan": {
"active": true,
"aggregate_usage": null,
"amount": 99500,
"amount_decimal": 99500,
"billing_scheme": "per_unit",
"created": 1702376066,
"currency": "gbp",
"deleted": null,
"id": "price_1OMSysJdX8lIDNiaiEotS1Er",
"interval": "year",
"interval_count": 1,
"livemode": false,
"metadata": {},
"nickname": null,
"object": "plan",
"product": "prod_PAoKjg1aro5eOA",
"tiers": null,
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"price": {
"active": true,
"billing_scheme": "per_unit",
"created": 1702376066,
"currency": "gbp",
"currency_options": null,
"custom_unit_amount": null,
"deleted": null,
"id": "price_1OMSysJdX8lIDNiaiEotS1Er",
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"object": "price",
"product": "prod_PAoKjg1aro5eOA",
"recurring": {
"aggregate_usage": null,
"interval": "year",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers": null,
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 99500,
"unit_amount_decimal": 99500
},
"proration": false,
"proration_details": {
"credited_items": null
},
"quantity": 1,
"subscription": "sub_1OXKNjJdX8lIDNia9ZvQJwA1",
"subscription_item": "si_PM2S2aKqmj6OTX",
"tax_amounts": [],
"tax_rates": [],
"type": "subscription",
"unit_amount_excluding_tax": 0
}
],
"has_more": false,
"url": "/v1/invoices/upcoming/lines?subscription\u003dsub_1OXKNjJdX8lIDNia9ZvQJwA1\u0026subscription_proration_date\u003d1704964619\u0026subscription_proration_behavior\u003dcreate_prorations\u0026subscription_items%5B0%5D%5Bid%5D\u003dsi_PM2S2aKqmj6OTX\u0026subscription_items%5B0%5D%5Bprice%5D\u003dprice_1OMSysJdX8lIDNiaiEotS1Er\u0026customer\u003dcus_PM2SuPHqziDiYq",
"request_params": null
}
I think it might be because you're passing a timestamp to subscription_proration_date and when the request is actually received that timestamp is in the past. Try omitting that parameter
I removed .setSubscriptionProrationDate(prorationDate) but I still get 0
Req ID for the request req_DLOEF7htPdPqKe
Ok, thinking some more
What is the desired outcome? To immediately charge for the full 995£?
I'd think so
If the one with no change in the simulation gives the price for the monthly price, switching to the annual price, I'd expect to pay the annual price
Try pass: subscription_billing_cycle_anchor: 'now'
Trial end (1705570652) cannot be after billing_cycle_anchor (1704965852). Consider ending the trial (trial_end=now).; request-id: req_pFbImTU4gOG1Hj
I thought it'd be set at the end of the trial by default, which would make sense
Wait, isn't this expected? The subscription is still in a trial period isn't it: 2024-01-18 09:16:57
So yeah that error message prescribes the solution: add subscription_trial_end: 'now'
I'm not sure. Maybe? If that's expected, why the first one with the monthly price would give me £99 but the annual one would give me £0?
Plus, if a customer still has a trial but wants to change the sub from monthly to yearly before he gets billed, I'd rather prefer to let him do so without ending his trial
But that is exactly what is happening in your requests to the preview invoice endpoint. The amount is 0 because of the existing trial period
Uuuumh
Indeed
.setSubscriptionProrationBehavior(InvoiceUpcomingParams.SubscriptionProrationBehavior.CREATE_PRORATIONS) .setSubscriptionBillingCycleAnchor(InvoiceUpcomingParams.SubscriptionBillingCycleAnchor.NOW) .setSubscriptionTrialEnd(InvoiceUpcomingParams.SubscriptionTrialEnd.NOW)
Gives me £995 🙂
thanks a lot