#Fattmonstoer-Node

1 messages · Page 1 of 1 (latest)

lofty harbor
#

Hi there, how can I help?

trim idol
#

Hi , i basically just want to initiaite a simple test of data going from my usage record script to the the usage of the particular customer for a subscription in the stripe dashboard

#

how would i setup my code and which files do i need to have. the documentation as detail as it is (which i appreciate) got me a little overwhelmed

lofty harbor
#

What's your current project setup?

trim idol
#

Not really a robust setup , our product is running in a different environment running on MERN tech stack

I wanted to test out the Stripe API's and created a landing page on a no code landing page creator (i can add custom code there) and have added a pricing table (subscriptions) . I now want to start sending customer usage data to the stripe dashboard from my end which i need help setting up

#

im also getting a 401 error while trying to retrieve customers

lofty harbor
#

Let me help you with the 401 error. Can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details

trim idol
#

acct_1LWZOKSG6IqiOBRf

#

is it this?

lofty harbor
#

Yes that's right

#

Can you also copy and paste the customer ID here?

trim idol
#

cus_MFngKKj7vbPNUe

#

i am getting same error for stripe.customers.list() aswell

lofty harbor
#

Show me the full error message?

#

And was this customer created with test clock?

trim idol
#

Aaah , error message is saying that my api key is not defined but as you can see above (blackened out i have provided it)

trim idol
lofty harbor
#

You should check your API key and make sure it's valid.

#

Did you pass in a key that starts with pk_ or sk_ ?

trim idol
#

yup

#

exactly copy pasted from the dashboard

#

ill try re pasting it

#

sk_

#

same error

lofty harbor
#

Ah I know the problem. You've created two stripe instance in your code, and you didn't pass API key in the second instance

trim idol
#

aah

#

yes

#

commenting out the second one works for me

#

thanks

#

i will try updating the usage now

#

if i face any issues will start a new thread

#

thanks a lot though jack really appreciate it

#

( also i dont know if this is intentional , but all support threads are public i can see all other support threads which have been created here)

lofty harbor
#

Yes all threads are public. If you prefer to have private discussions, you can send an email to Stripe support https://support.stripe.com/contact and ask them to route to support engineering.

trim idol
#

not a problem hahah was just curious thanks

#

Thanks a lot Jack

trim idol
#

HI @lofty harbor i need some clarity on setting up the pricing for my usage based subscriptions

#

i have a plan setup which is charging this amount per month, i need to enabled usage based billing. Usage will be sent to Stripe via our buisness logic but i need to be able to change the price. the price for usage quantity can be same as the price for the plan subscription which i am unable to find through the dashboard

#

one work around which i found was creating the plan with multiple prices , but when it appears in the pricing table only 1 price comes up, and i need to add the usage based pricing manually through the dashboard (can this be done through an api?) which then goes ahead and meets my requirement. in the second image the 0.05 is my price per usage for the plan

lofty harbor
trim idol
#

So basically there would be 1 Subscription Fee (recurring payment monthly) + a fee on usage (different price than that of the subscription fee) . For example $100 per month to subscribe to the plan and $0.01 per email sent through our platform. What would be the best way to setup this subscription in my pricing model where I am sending the amount of emails sent by my users to the stripe api