#_kevinx
1 messages · Page 1 of 1 (latest)
Hi 👋
Can you share the error you are receiving
Archive doesn't matter unfortunately. You will have to just set the look_up key on the live product instead of copying
Got you, one more question please, what happens to the subscription status if someone paid it then open dispute
Will Webhook change the subscription status?
So the payment is successful and then they dispute the charge?
Yes
I read stories recently that there are a lot scammers testing their stolen cards this way
Hmmm.... I'm pretty sure that the subscription would update and transition to incomplete
Based on this lifecycle diagram: https://stripe.com/docs/billing/subscriptions/overview#subscription-lifecycle
But raising the Dispute would set off a bunch of additional webook events
yeah, if dispute changes the status in subscription, that's all I need
otherwise, probably have to track dispute etc which might be a pain
We would recommend you track disputes anyway, using webhook events. https://stripe.com/docs/api/events/types#event_types-charge.dispute.created
Trying to update lookup_key for live mode and here is the error message
{
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such price: 'price_1NO2PfKAjj6I40xpfEKrf1rK'; a similar object exists in live mode, but a test mode key was used to make this request.",
"param": "price",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_vHF8pAQkQM2kc1?t=1688685387",
"type": "invalid_request_error"
}
}
I copied that key from live mode btw, not test mode
No the Test mode key is the key used to initialize the Stripe client library in this case
No we don't recommend that
I got similar error in my CLI too
Right because the CLI uses test mode by default
You can override the API key used but we don't recommend it https://stripe.com/docs/cli/flags
Both Stripe Shell and the CLI are designed to support testing
ok, how do I add the lookup keys for live mode then
it doesn't allow me to copy from test, and doesn't want me to use CLI
it doesn't allow me to delete those either
Do you only interact with the API via the CLI?
Or do you write server-side code with one of our libraries?
to set up price and product, yes, how else?
Yeah, I do write server side code for production flow, but not setting up things
In that case we have the API right here: https://stripe.com/docs/api/prices/update#update_price-lookup_key
You could even use a CURL command from the terminal
Just use the live mode API key
ok, thanks, let me try
in this case, I guess I just write something and run it then, instead of doing them one by one, thanks
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
const stripe = require('stripe')('sk_test_');
const price = await stripe.prices.update(
'id',
{
lookup_key: 'MY_LOOKUP_KEY',
}
);
btw, what needs to be passed here after update, if I update multiple ones
it doesn't look like object or array
I'm not sure I understand the question. Where are you referring to?
oh, what's the syntax if I need to pass a second id and lookup key, in this example, there is only one
I tried copy the same syntax for the second one, but it failed
can the API update multipe prices and lookup key
or do I have to do it one by one
No, you would need to iterate through one at a time
So put the API call inside a loop and get the Price ID & look up key
alright