I have successfully applied the following coupon on the subscription: sub_B11QoX8cG4AjeW
ID: scoutingtagging-chf-month
Amount off: CHF 90.00 CHF off
Duration: once
Valid: true
Now I want to switch all the subscribed plans to yearly plan, with prorate = true
.
The upcoming invoice doesn't seem to return the correct proration items:
stripe.invoices.retrieveUpcoming(
'cus_B11QxiyQHkGzmI',
'sub_B11QoX8cG4AjeW',
{
subscription: 'sub_B11QoX8cG4AjeW',
subscription_items: [
{ id: 'si_1AezNfBHxc8EdGrxyahMO3p5', plan: 'starter-chf-year-1' },
{ id: 'si_1AezNfBHxc8EdGrxUeIGuYgP', plan: 'advancedsearch-chf-year-1' },
{ id: 'si_1AezNfBHxc8EdGrx03cnFrdO', plan: 'scouting-chf-year-1' },
{ id: 'si_1AezNfBHxc8EdGrxF9S1QkM8', plan: 'tagging-chf-year-1' }
],
subscription_prorate: true
}
)
The strange thing is the proration items seems to have the discount applied to every single item: (which it shouldn't, because this is one time coupon, and it apply to subscription as a whole)
"Unused time on Tagging (with CHF 90.00 off) after 13 Jul 2017",
"Unused time on Scouting (with CHF 90.00 off) after 13 Jul 2017",
"Unused time on Advanced Search (with CHF 90.00 off) after 13 Jul 2017"
"Unused time on Starter (with CHF 90.00 off) after 13 Jul 2017"
Results JSON for references:
{
"object": "invoice",
"amount_due": 604406,
"application_fee": null,
"attempt_count": 0,
"attempted": false,
"charge": null,
"closed": false,
"currency": "chf",
"customer": "cus_B11QxiyQHkGzmI",
"date": 1499922274,
"description": null,
"discount": null,
"ending_balance": null,
"forgiven": false,
"lines": {
"object": "list",
"data": [
{
"id": "ii_1AezV8BHxc8EdGrxKRa08nm7",
"object": "line_item",
"amount": -4699,
"currency": "chf",
"description": "Unused time on Tagging (with CHF 90.00 off) after 13 Jul 2017",
"discountable": false,
"livemode": false,
"metadata": {
},
"period": {
"start": 1499922274,
"end": 1502600211
},
"plan": {
"id": "tagging-chf-month-1",
"object": "plan",
"amount": 13700,
"created": 1499767901,
"currency": "chf",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
"tagging": "true",
"videoMinutesPercentage": "0.5",
"sort": "40",
"type": "package",
"texts": "[]"
},
"name": "Tagging",
"statement_descriptor": null,
"trial_period_days": null
},
"proration": true,
"quantity": 1,
"subscription": "sub_B11QoX8cG4AjeW",
"subscription_item": "si_1AezNfBHxc8EdGrxF9S1QkM8",
"type": "invoiceitem"
},
{
"id": "ii_1AezV8BHxc8EdGrxV0y5WiIS",
"object": "line_item",
"amount": -4699,
"currency": "chf",
"description": "Unused time on Scouting (with CHF 90.00 off) after 13 Jul 2017",
"discountable": false,
"livemode": false,
"metadata": {
},
"period": {
"start": 1499922274,
"end": 1502600211
},
"plan": {
"id": "scouting-chf-month-1",
"object": "plan",
"amount": 13700,
"created": 1499767901,
"currency": "chf",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
"scouting": "true",
"sort": "30",
"type": "package",
"texts": "[]"
},
"name": "Scouting",
"statement_descriptor": null,
"trial_period_days": null
},
"proration": true,
"quantity": 1,
"subscription": "sub_B11QoX8cG4AjeW",
"subscription_item": "si_1AezNfBHxc8EdGrx03cnFrdO",
"type": "invoiceitem"
},
{
"id": "ii_1AezV8BHxc8EdGrxwaLYOBEJ",
"object": "line_item",
"amount": 0,
"currency": "chf",
"description": "Unused time on Advanced Search (with CHF 90.00 off) after 13 Jul 2017",
"discountable": false,
"livemode": false,
"metadata": {
},
"period": {
"start": 1499922274,
"end": 1502600211
},
"plan": {
"id": "advancedsearch-chf-month-1",
"object": "plan",
"amount": 1100,
"created": 1499767901,
"currency": "chf",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
"advancedSearch": "true",
"sort": "10",
"type": "package",
"texts": "[]"
},
"name": "Advanced Search",
"statement_descriptor": null,
"trial_period_days": null
},
"proration": true,
"quantity": 1,
"subscription": "sub_B11QoX8cG4AjeW",
"subscription_item": "si_1AezNfBHxc8EdGrxUeIGuYgP",
"type": "invoiceitem"
},
{
"id": "ii_1AezV8BHxc8EdGrxVH0DDpNc",
"object": "line_item",
"amount": -20896,
"currency": "chf",
"description": "Unused time on Starter (with CHF 90.00 off) after 13 Jul 2017",
"discountable": false,
"livemode": false,
"metadata": {
},
"period": {
"start": 1499922274,
"end": 1502600211
},
"plan": {
"id": "starter-chf-month-1",
"object": "plan",
"amount": 29900,
"created": 1499767900,
"currency": "chf",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {
"videoMinutes": "120",
"videoDownloads": "false",
"playerRequest": "true",
"playerTrading": "true",
"sort": "20",
"texts": "[\"Platform\",\"Quick Search\",\"Communication external\",\"Communication internal\",\"Mobile Communication Apps for staff and players\",\"Player Requests\",\"Player Trading\"]"
},
"name": "Starter",
"statement_descriptor": null,
"trial_period_days": null
},
"proration": true,
"quantity": 1,
"subscription": "sub_B11QoX8cG4AjeW",
"subscription_item": "si_1AezNfBHxc8EdGrxyahMO3p5",
"type": "invoiceitem"
},
{
"id": "sub_B11QoX8cG4AjeW",
"object": "line_item",
"amount": 322900,
"currency": "chf",
"description": null,
"discountable": true,
"livemode": false,
"metadata": {
"lastUpdatedBy": "000000000000000000000004",
"organizationId": "55c8d10fa7a84b636d94adc7",
"organizationType": "team"
},
"period": {
"start": 1499922274,
"end": 1531458274
},
"plan": {
"id": "starter-chf-year-1",
"object": "plan",
"amount": 322900,
"created": 1499767898,
"currency": "chf",
"interval": "year",
"interval_count": 1,
"livemode": false,
"metadata": {
"videoMinutes": "1440",
"videoDownloads": "false",
"playerRequest": "true",
"playerTrading": "true",
"sort": "20",
"texts": "[\"Platform\",\"Quick Search\",\"Communication external\",\"Communication internal\",\"Mobile Communication Apps for staff and players\",\"Player Requests\",\"Player Trading\"]"
},
"name": "Starter",
"statement_descriptor": null,
"trial_period_days": null
},
"proration": false,
"quantity": 1,
"subscription": null,
"subscription_item": "si_1AezNfBHxc8EdGrxyahMO3p5",
"type": "subscription"
},
{
"id": "sub_B11QoX8cG4AjeW",
"object": "line_item",
"amount": 12000,
"currency": "chf",
"description": null,
"discountable": true,
"livemode": false,
"metadata": {
"lastUpdatedBy": "000000000000000000000004",
"organizationId": "55c8d10fa7a84b636d94adc7",
"organizationType": "team"
},
"period": {
"start": 1499922274,
"end": 1531458274
},
"plan": {
"id": "advancedsearch-chf-year-1",
"object": "plan",
"amount": 12000,
"created": 1499767901,
"currency": "chf",
"interval": "year",
"interval_count": 1,
"livemode": false,
"metadata": {
"advancedSearch": "true",
"sort": "10",
"type": "package",
"texts": "[]"
},
"name": "Advanced Search",
"statement_descriptor": null,
"trial_period_days": null
},
"proration": false,
"quantity": 1,
"subscription": null,
"subscription_item": "si_1AezNfBHxc8EdGrxUeIGuYgP",
"type": "subscription"
},
{
"id": "sub_B11QoX8cG4AjeW",
"object": "line_item",
"amount": 149900,
"currency": "chf",
"description": null,
"discountable": true,
"livemode": false,
"metadata": {
"lastUpdatedBy": "000000000000000000000004",
"organizationId": "55c8d10fa7a84b636d94adc7",
"organizationType": "team"
},
"period": {
"start": 1499922274,
"end": 1531458274
},
"plan": {
"id": "scouting-chf-year-1",
"object": "plan",
"amount": 149900,
"created": 1499767901,
"currency": "chf",
"interval": "year",
"interval_count": 1,
"livemode": false,
"metadata": {
"scouting": "true",
"sort": "30",
"type": "package",
"texts": "[]"
},
"name": "Scouting",
"statement_descriptor": null,
"trial_period_days": null
},
"proration": false,
"quantity": 1,
"subscription": null,
"subscription_item": "si_1AezNfBHxc8EdGrx03cnFrdO",
"type": "subscription"
},
{
"id": "sub_B11QoX8cG4AjeW",
"object": "line_item",
"amount": 149900,
"currency": "chf",
"description": null,
"discountable": true,
"livemode": false,
"metadata": {
"lastUpdatedBy": "000000000000000000000004",
"organizationId": "55c8d10fa7a84b636d94adc7",
"organizationType": "team"
},
"period": {
"start": 1499922274,
"end": 1531458274
},
"plan": {
"id": "tagging-chf-year-1",
"object": "plan",
"amount": 149900,
"created": 1499767901,
"currency": "chf",
"interval": "year",
"interval_count": 1,
"livemode": false,
"metadata": {
"tagging": "true",
"videoMinutesPercentage": "0.5",
"sort": "40",
"type": "package",
"texts": "[]"
},
"name": "Tagging",
"statement_descriptor": null,
"trial_period_days": null
},
"proration": false,
"quantity": 1,
"subscription": null,
"subscription_item": "si_1AezNfBHxc8EdGrxF9S1QkM8",
"type": "subscription"
}
],
"has_more": false,
"total_count": 8,
"url": "\/v1\/invoices\/upcoming\/lines?customer=cus_B11QxiyQHkGzmI&subscription=sub_B11QoX8cG4AjeW&subscription_prorate=true"
},
"livemode": false,
"metadata": {
},
"next_payment_attempt": 1499925874,
"paid": false,
"period_end": 1499922274,
"period_start": 1499922274,
"receipt_number": null,
"starting_balance": 0,
"statement_descriptor": null,
"subscription": "sub_B11QoX8cG4AjeW",
"subscription_proration_date": 1499922274,
"subtotal": 604406,
"tax": null,
"tax_percent": null,
"total": 604406,
"webhooks_delivered_at": null
}