#nikunj-karolia_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/1476194454489661502
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ Hi there! Let me take a look
What happens when you run that command?
Is that the exact command you're running? I see that it says inovice instead of invoice in the override
stripe trigger invoice.paid
--override invoice:customer=cus_neonexiss_test
--override invoice:amount_paid=2900
--override invoice:lines.data[0].price.id=price_fixed_plan
--override invoice:lines.data[0].quantity=1
--override invoice:lines.data[0].amount=1900
--override invoice:lines.data[1].price.id=price_usage_metered
--override invoice:lines.data[1].quantity=100
--override invoice:lines.data[1].amount=1000
this is the actual stripe cli command
OK, and what problem are you having?
Trigger failed: Request failed, status=400, body={
"error": {
"code": "parameter_unknown",
"doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
"message": "Received unknown parameters: lines, amount_paid",
"param": "lines",
"request_log_url": "https://dashboard.stripe.com/acct_1R3uXtID9tx75xrh/test/workbench/logs?object=req_m9XQx20md9Ku3t",
"type": "invalid_request_error"
}
}
But THe invoice Object had the values lines and amount_paid don't know how to use it
Thanks. The trigger command is first creating an Invoice object, so it can then be paid. But there is no amount_paid parameter when creating an Invoice, and that's what you can see if you look at the request log URL
But you don't want to just use stripe trigger invoice.paid on its own? You need those specific details in the invoice?
okay so how to do it
yes see I want to test real subscription data as test get exact details that will come using the webhook so It could be handled safely
If you want to see what exact events you would see for a Subscription Invoice, then you should create a Subscription in a sandbox/testmode
When you use stripe trigger it's using simple test fixtures like this one: https://github.com/stripe/stripe-cli/blob/v1.35.1/pkg/fixtures/triggers/invoice.paid.json โ so it won't look exactly like a Subscription Invoice
so instead of trigger I should use fixtures correct but fixtures will use test mode correct ?
Yes, fixtures will run by default in testmode
You said you want to see real subscription data, to test your webhook endpoint. The best way to do that is to create a Subscription in testmode, as that will generate the real events for the Subscription and its invoices
okay got it, thanks