#lennard-mongo

1 messages ยท Page 1 of 1 (latest)

final yew
#

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

formal sonnet
#

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 )

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

formal sonnet
#

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.

final yew
#

is it an API key for your own system?

#

or an API key for a user's Stripe account

formal sonnet
#

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 ๐Ÿ™‚

final yew
#

It's a own Key for my own system.
ah gotcha

so what do you need help with, sorry that part wasn't clear

formal sonnet
#

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.

final yew
#

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

formal sonnet
#

I am working with nodeJS and expressJS.

formal sonnet
final yew
#

ah well that depends on what you need to store. Which Stripe guide are you referencing? and are you using Stripe Billing?

formal sonnet
#

I am using a stripe product which is paid per unit.

#

(prod_LDCa6wh9hrtFDV)

#

I just were not sure if there are actual requirements, so it works guaranteed and secured.

final yew
#

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

formal sonnet
#

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.

final yew
#

np! best of luck!