#lennard-mongo
1 messages ยท Page 1 of 1 (latest)
hello, why are you linking to API keys? are you asking users for their API keys?
So: How can I create a MongoDB model for a client? In the webhook
this would not be something I can help with, recommend looking into online tutorials, they can help guide you
Hello,
maybe my description was bad.
My goal is after the payment webhook was called to store the client data.
(To then link a API key to it, and each time the client calls the api with the key, a charge is issued @final yew )
(To then link a API key to it, and each time the client calls the api with the key, a charge is issued @final yew )
yeah it looks like you're requesting API keys from clients which is not the right approach
sounds like you should use Connect instead to make requests on behalf of accounts
Oh with API key i mean a API key i do create, as a key to interact with my API ๐
So its a pay per request API, and I am using Stripe as billing.
It's a own Key for my own system.
And I would like to store the Client from the payment callback to save it in my DB, and connect the API key of my service to the Client, for billing.
@final yew I hope it is easier to understand like this ๐
It's a own Key for my own system.
ah gotcha
so what do you need help with, sorry that part wasn't clear
So I basically would like to ask if there is any scheme or even module to save the client as a mongoDB model in my DB.
So I can access it for the billing of my own key.
that I don't know, depends on what language/webframework you're working with
most languages have a mongo client you set up and then read/write from
I am working with nodeJS and expressJS.
Yes But i just were wondering what exactly i would need to save as Client Model to my DB, to then use the data in it for billing after each request.
ah well that depends on what you need to store. Which Stripe guide are you referencing? and are you using Stripe Billing?
I am using a stripe product which is paid per unit.
(prod_LDCa6wh9hrtFDV)
The guide was not from stripe, but it is here: https://fireship.io/lessons/api-monetization-stripe/
I just were not sure if there are actual requirements, so it works guaranteed and secured.
yeah so that is not a Stripe guide but it uses Metered Billing aka Metered Subscriptions
so you can store the Customer ID, the Price ID, the Metered Usage, the Subscription ID, plenty of things you could choose to store
Okay. Thank you, i will look up for Metered Subscriptions.
Thank you very much for the fast and good support, i wish you a good day.
np! best of luck!