#phillip_webhooks

1 messages ¡ Page 1 of 1 (latest)

shy yewBOT
#

👋 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/1294219265980764191

📝 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.

formal gull
#

hi! well when you call the API to create the subscription you can pass metadata with your own information, for instance.

#

you can't set the id field of the object itself, we generate that and it's unique

unique bobcat
#

Thanks @formal gull ! for some reason the metadata object is empty even though I added a key value pair in the dashboard. Will the metadata only be added when a new subscription has been created? (I've tested it with an already existing subscription and used a test clock)

formal gull
#

I'm not sure what specific part of the Dashboard you're referring to. Generally metadata is something you supply in the API request that your code makes to create the Subscription in your payments integration. or in an Update Subscription API call. I'm sure the Dashboard has ways to update an existing subscription too(but maybe you're updating a different object like the Customer or an Invoice). We mainly answer API/dev questions here.

unique bobcat
#

I think I know why. I added it to the product metadata. Then, I listen to the invoice.created webhook which returns an invoice object that also contains a product ID but not the product metadata. Is there a way I can expand that field or will I need to do a separate API call to retrieve the product with it's metadata?

formal gull
#

you can call the Product Retrieve endpoint or you can call Invoice Retrieve and pass expand:["lines.data.price.product"] and look at it through that path

shy yewBOT