#Shra_1
1 messages · Page 1 of 1 (latest)
hello! yes, all API requests expect amounts to be provided in a currency’s smallest unit. For example, to charge 10 USD, provide an amount value of 1000 (that is, 1000 cents).
okay thank you.
How to generate Invoice for a particular period of time through api. I have priceId and quantity?
are you referring to a subscription? if yes, you'd want to look at https://stripe.com/docs/billing
yeah subscription,
I just want to create invoice through create invoice api with the priceId and quantity I have, but how do I do it ?
To clarify, this a recurring payment e.g. $50/month?
yeah, lets assume its a montly subscription.
but when customer wants to update(add) the quantity, i'll not enable prorate, i'll just collect the amount for complete month through generating invoice and then update the subscription on payment
i think what you're looking for is payment_behavior=pending_if_incomplete where you make changes to subscriptions only if payment succeeds on the new invoice - https://stripe.com/docs/billing/subscriptions/pending-updates
but to achieve this, I need to generate Invoice thorugh api, How do I do it is what my question is
if you want to explicitly create an invoice then you follow the guide here : https://stripe.com/docs/invoicing/integration / https://stripe.com/docs/invoicing/integration/quickstart
thank you so much, i'll follow this guide and if I stuck anywhere i'll get back
I don't know why this api is giving empty response
const cards = await stripe.customers.listSources(
'cus_MOm2GvE2fOcsFX',
{object: 'card', limit: 3}
);
that customer has test card details in his payment method
you should use https://stripe.com/docs/api/payment_methods/customer_list