#Markan97

1 messages ยท Page 1 of 1 (latest)

ancient ginkgoBOT
shy kelp
#

๐Ÿ‘‹ happy to help

ornate bay
#

I think I've already tried this, and it didn't work. It was related to metered usage, according to what I saw on the dashboard.

shy kelp
#

you can use amount_gte

ornate bay
#

I will try again, give me some time to attempt it, and I will get back to you to let you know how it went.

shy kelp
ornate bay
#

When do I define the threshold for a subscription - when updating the subscription or when creating the subscription?

shy kelp
#

you can do both

ornate bay
#

let me try

#

Can you please check why the charge was not made? Could you please take a look at this subscription: sub_1MgQwoC59TMCvkXUrVeSMIoH?

shy kelp
#

yes sure

ornate bay
#

ty

shy kelp
#

which charge was not paid?

#

would you mind giving me an example of your use case?

ornate bay
#

I set the first 12 to be $0, which is fine, and was not charged. The 13th unit should be charged $350 immediately upon exceeding the 12th unit, but this did not happen. Instead, it was added to the next subscription billing, which is for one year, and this doesn't work for me.

#

The threshold is set to charge immediately upon exceeding $100.

shy kelp
#

ok I do understand now

#

in that case what you need to do is use the first threshold (monetary-threshold) that I've sent you earlier with amount_gte

#

instead of the usage threshold

#

you can set the amount_gte to 350

ornate bay
#

Can you give me an example of how to set this up?

#

This is how I did it this.stripe.subscriptions.create({ customer: 'cus_NR608Z7zYkO28h', payment_settings: { save_default_payment_method: 'on_subscription', }, items: [ { price: 'price_1MgCctC59TMCvkXUAwK3itGZ', }, ], payment_behavior: 'default_incomplete', proration_behavior: 'always_invoice', expand: ['latest_invoice.payment_intent', 'plan.product.default_price'], cancel_at_period_end: false, billing_thresholds: { amount_gte: 35000, reset_billing_cycle_anchor: false, }, });

ionic marsh
#

And what is happening and what are you expecting exactly ?

ornate bay
#

I'm expecting to charge 13th unit

#

as I sent u sub ID

#

sub_1MgQwoC59TMCvkXUrVeSMIoH

ionic marsh
#

Let me check..

ornate bay
#

Cannot create a usage record with usage type `licensed`. You can only create a usage record for metered plans. run into this error

ionic marsh
ornate bay
#

next error ๐Ÿ˜„

#

Your amount-based billing threshold of 35000 is smaller than or equal to the total amount of 360000 of all flat fees on metered prices.

ionic marsh
#

Yeah, threshold need to be greater than of all flat fees on metered prices. I think the error is quiet explicit.