#ironbeard_object-deleted-webhook-events
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/1488197372306653214
๐ 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.
- ironbeard_events-v2-objects, 3 days ago, 20 messages
Hello, can you tell me more about what you are trying to do here? Of those I think just customer and coupon can't be retrieved after their delete calls
The other will still let you access their data in the API I believe
hey ๐ I've made mirror models for a few Stripe primatives to store the info in my local db (readonly), which get updated via webhooks. it's working pretty well, just wasn't sure which rows I should delete locally when getting a .deleted webhook.
Hi ๐
I'm stepping in as my colleague needs to go soon.
all good ๐
I"m not sure I follow what you are trying to understand from these webhook events. It's difficult to speak in the abstract though so can you provide some concrete examples?
I think the easiest thing to do would be to create these events yourself using test data and see how they correspond with the state of your data.
I suppose what i'm wondering is: since Customer doesn't have an "active" field like Product does, when a customer.deleted webhook is sent from Stripe, does that mean that the Customer object was actually deleted on Stripe servers (contrasted to product.deleted, where the Product still exists on Stripe servers, it's just marked as active=False, if I understand correctly).
I don't think your undestanding is correct here. I think .deleted don't just mean active=false. But I could be wrong. I recommend testing this.
You can even use the CLI to generate some of these events to see the state of the object after they occurr
Oh, good to know. I know how to create the objects using the SDK and listen for webhooks. Do I need to create the objects in SDK in order to trigger a delete event in the CLI?
For customer.deleted all you need to do is stripe trigger customer.deleted. All the objects will be created for you.
I just tested this and then I ran stripe get cus_XXX to retrieve the object from the API. All I saw was
{
"id": "cus_UFCW0FAnbXINmP",
"object": "customer",
"deleted": true
}
Oh, nice. I didn't see deleted listed as a Customer object property so I wasn't sure. But I see how to go forward now. Thanks ๐
Yeah, this is because the object itself has been deleted and we return this representation (which isn't really a Customer object)
OH, okay cool cool
I'm pretty sure the same is true for Products and Prices because we don't let you delete those if they have ever ben used
Yes, makes sense.
Once a Price has been used in a transaction, you can only mark it as inactive to prevent it from being used in the future
been learning a lot about Stripe CLI, very very useful
Yeah, just don't try to replace all your API scripts with it ๐
It's intended to allow for easy, rapid testing but not a substitute for scripting API interactions. But some devs try to use it like that. It never ends well
Happy to help ๐