#josula_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1334152510071640086
๐ 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.
- josula_api, 6 days ago, 23 messages
Nope
all via API
our flow is:
- check if customer exists (via stripe id), if not create customer, else return stripe customer
- create invoice via API
- Add invoice items via API
- finalise invoice
what I meant by manually creating the invoice is mainly in relation to whether this is related or not to subscriptions
this is called manual invoice
its one time payments
const invoice = await stripe.invoices.create({
customer: stripeCustomer.id,
collection_method: "send_invoice",
auto_advance: false,
currency: "eur",
days_until_due: new Decimal(30).toNumber(),
shipping_cost: {
shipping_rate_data: {
display_name: cart.shipping_methods?.[0]?.name || "Versand",
type: "fixed_amount",
fixed_amount: {
amount: new Decimal(cart.shipping_methods?.[0]?.amount as number)
.times(100)
.toNumber(),
currency: "eur",
},
},
},
custom_fields: [
...(cart.metadata?.internal_order_id
? [
{
Does that make sense? See how we can only link it to a single customer via id? I would love to assign the customer but also set an invoice email here that takes precedence over the customer's email but the invoice should be still linked to the customer object.
I know what you mean
Is there a best practice for that? ๐
unfortunately that's not possible today ๐ฆ
So what would you do? Update the customer's email every single time?
Or create a new customer object?
both seems very error prone
I agree with you
but we don't have any other solutions today for that
this is really good feedback to submit to https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.