#dizzydizz1101_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1265920151665119275
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- dizzydizz1101_webhooks, 19 hours ago, 63 messages
- dizzydizz1101_webhooks, 2 days ago, 67 messages
- dizzydizz1101_api, 5 days ago, 86 messages
it continues from the webhooks 19 hours ago
we want to test a webhoook for charge.dispute.created with our subscripiton models and struggle with the fixtures to trigger the webook with the right data in the cli
everything else is working but we are alwys stuck at this part
{
"name": "subscription_items",
"path": "/v1/subscription_items",
"method": "get",
"params": {
"subscription": "${subscription:id}"
}
},
{
"name": "usage_record",
"path": "/v1/subscription_items/${subscription_items:[0].id}/usage_records",
"method": "post",
"params": {
"quantity": 10,
"timestamp": "now"
}
},
tells us allways No such subscription item: '${subscription_items:[0].id} no matter how we try to get the subscription item
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
sure req_cktNV3RJMY7Vwm
Looks like you are passing "${subscription_items:[0].id}" string as the subscription item ID
I believe ${subscription_items:[0].id} is a variable that carry the ID of the subscription item.
i mean you see the fixture above also
where i use it in the path of the usage record. so we also think it is a variable, but how do we then integrate it in the fixutre path of the usage record
we could not find anything in the stripe doctumatnion how to handle a var or "wildcard" in the path for usage records for fixturesw
OK, what Stripe CLI command did you use trigger the event? are you using the latest version of Stripe CLI
OK, is the purpose is to trigger a charge.dispute.created event, I'd suggest you to create a payment with these test cards https://docs.stripe.com/testing#disputes
unfortunately i can not send you the complete fixture caus it complains it is to long
bet we alredy use the test cards
{
"_meta": {
"template_version": 0
},
"fixtures": [
{
"name": "test_clock",
"path": "/v1/test_helpers/test_clocks",
"method": "post",
"params": {
"frozen_time": 1596840000,
"name": "Test clock for subscription"
}
},
{
"name": "customer",
"path": "/v1/customers",
"method": "post",
"params": {
"name": "New Customer",
"email": "new_customer@example.com",
"metadata": {
"created_by": "Stripe CLI"
}
}
},
{
"name": "product",
"path": "/v1/products",
"method": "post",
"params": {
"name": "Sample Product",
"type": "service"
}
},
{
"name": "price",
"path": "/v1/prices",
"method": "post",
"params": {
"product": "${product:id}",
"unit_amount": 2000,
"currency": "eur",
"recurring": {
"interval": "month",
"usage_type": "metered"
}
}
},
{
"name": "payment_method",
"path": "/v1/payment_methods/pm_card_createDisputeProductNotReceived/attach",
"method": "post",
"params": {
"customer": "${customer:id}"
}
},
๐ I'm taking over this thread, catching up now
hi river ๐
Checking what is the correct syntax to get the subscription item ID
thanks.. if it helps we also tried to add a "subscription_item_retrieve" step inbetween to "get" the subscripiton id to make sure we having it but seemed also not to work
Can you try to use {subscription_items:data.0.id}?
sure one secion without the dollar sign?
Sorry that I missed it out. Dollar sign should be included! ${subscription_items:data.0.id}
it did not throw an error at least but still the first invoice was 0dollar
That's great! This means that the subscription item ID is retrieved correctly. Can you share the invoice ID (in_xxx)?
sure in_1PgM0DAgeNa2VITfcZlgUzZW
this is definetly create that it took the right subscription id already.. took us hours and hours yesterday
we definetly can work with the test clock
if we advance time we can simulate the dispute
unfortunately it did not trigger charge.dispute.created but invoice.payment_failed
do we then need to take a different testcard insted of pm_card_createDisputeProductNotReceived
Thanks for sharing! For usage based billing, the customer will only be billed at end of the billing cycle
Why are you creating the invoice manually? For usage billing, subscription will create invoice automatically
dont now thought in the fixture we need to use it this way
In addition, usage records is the legacy integration. New usage billing should use metered events: https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide
and we have a really really important understanding question to this legacy thing
can we ask you this right here, or do we need to open a new thread?
cause you are not in the topic already for a little bit
It's fine to use the same thread
Okay, to give you small overview what we do we have actually a saas for b2b and three different prices small, medium, premium where the companies get charged on the amount of employess "per-seat" they have in there.. but they can quickly swith also inbetween the month and say this user is small now and this one is premium now
back then beeing relatively new to stripe we thought the only solution to be this flexible with per-seat pricing would be using metered prices and create usage record which was the soltion back then. the new meters and everything was not there already
so one of the other support members also told us that the stuff we using is legacy and we urgently should update all our customers to meters and the the usage-based billing.
now that we need to do a lot of work an somehow migrate all the customers would you recomend to just update the subscription of the user with monthly recuring prices just a plain subscription with three different prices.. or would you go with the meters
cuause we definetly dont want that if the customer swithces from premium to small, that in the end the customer is charged twice
i hope you understand what i try to tell you here? ๐
Thanks for sharing the information. When do you expect to charge to the customer? At the start or end of the billing cycle? For example, if the customer changes from small to premium in the middle of cycle, how would you like to charge to the customer?
at the end of the billing cycle we charge, so if the change in the middle from small to premium the next invoice should contain premium instead of small
Thanks for sharing! In this case, I'd recommend using https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide. Before the cycle ends, you can update to the right price and its usage
okay thanks. so the other way without useage based you would recommend when the customer is charged at the begining of the month?
For non-usage based, customer will be charged at the beginning of the month! If there is any change in the plan, proration will occur: https://docs.stripe.com/billing/subscriptions/upgrade-downgrade
Okay proration sounds interesting so thanks for sharing the article we will instensely compary both soltions
and the with the new usage-based with is using a meter, it is also possible to then see in realtime the current propably revenue in realtime
cause currentyl we struggle that it is not possbible to see what is the total active revenue, which defiently is possbile with the upgrade downgrade subscriptions thig cause there you would see MRR
i guess
This channel is for technical integration questions. We don't have necessary expertise with MRR. Our support team will be able to assist you better than I can: https://support.stripe.com/contact/email
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
yeah sorry i know this.. but its a hard topic cause it depends on both worlds. like if i use this kind of API subscription will it then show this or that values in the dashboard
anyways you helped a lot and we have to do our homework now, read a lot documentation and try to build a small prototype..
also the fixture hint from you helped a lot so thanks again for this as well