#MarkoBoras
1 messages · Page 1 of 1 (latest)
Checkout supports post-payment invoices natively: https://stripe.com/docs/payments/checkout/post-payment-invoices
I need to customize invoice with data. Problem is that I am here defining that data before checkout has succeeded. I need to create invoice with custom data after checkout finishes and I get some numbers from tax administration office
I don't know if I've explained right but the flow is this:
- User selects plan
- Goes on checkout
- Buys succesfully
- I am sending in webhook 'invoice.payment_succeeded' request to Croatia's tax administration office to fiscalize invoice
- They return me back their invoice with some data which is mandatory to be on invoice
- I don't want their PDF and I want to send to customer Stripe invoice with that data inserted
Problem is I get those numbers after checkout finishes
Do you understand me?
I understand you but I don't think this is directly possible, Invoices are immutable after they're finalised in Stripe, so it's not possible to update the invoice in this way
the only real option would be to update the Invoice metadata with your extra information, but that won't be reflected to the customer or in the PDF.
can I create invoice and mark it as paid after payment?
not through this way as it is
I have all necessary data in my webhooks which I can provide
you could do it that way(manually create an invoice instead of using the one Checkout creates), it's just naturally not a great system since the money in Stripe is not really connected to the invoice
- I don't want to create it manually
- I've got from Croatia's tax administration office where real invoice is issued all data, so that invoice would just serve as a preview of what user has bought
https://stripe.com/docs/api/invoices/pay#pay_invoice-paid_out_of_band can be used to make an invoice as paid
Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to false.
but payment is made through stripe
yep but that's what I meant. It's not a great system.
you'd edit it before you mark it as paid but yes
what's the api for creating invoice
can I create invoice, provide it some data, and mark it as paid
and send that to customer on e-mail
all that I'll do after user buys on checklut
checkout*
https://stripe.com/docs/invoicing/integration is the general guide for creating an invoice with various line items and other fields
ok
one more question before I try all this
if I create an invoice after user buys something in checkout and mark invoice as paid in creation of that invoice
will that be processed as payment or?
because what I want to achieve is just create PDF and send it to customer
and that's it
if you use paid_out_of_band we don't charge the customer as part of the Invoice no
so Stripe will also not take any fee from my company's account for that invoice?
I understand it'll take 1.5% + additioanl fee for payment that user has made through checkout
that's ok
but with this one I just want to create PDF and send it to customer
I'm not sure how our pricing works there. I don't think there's a fee for an invoice that does not take a payment, but I don't know this area of things, I work only with developers and the direct API
Okay
Can we leave this thread open to ask you more question while I implement it
I'll be off for some time
we close the thread after about 30 minutes of inactivity
overall I don't really suggest integrating this way. The best way would be to use Stripe Tax + Checkout and have Checkout create the post-payment Invoice (https://stripe.com/docs/payments/checkout/taxes). I don't know what these specific business requirements you have for Croatia here but I'd hope our Stripe Tax product supports it.
this is the only fucking issue
sorry for my language
there is something called "JIR" and "ZKI" and those numbers are generated from Croatia's tax administration office which are required to have on the invoice. If you don't have it someone can sue you.
I am creating fiscalized invoice after checkout succeeds and then I get those numbers.
I need to insert them in Stripe invoice.
that's the long story shoet
short*
I am using in my flow Stripe Tax + Checkouit
I see. Looking now, yes, we have some internal information on that and this invoice fiscalization process. It's only applicable if your business/merchant operates in Croatia itself. But yes, we don't really support this today, it's not prioritised. If it's important to you it's best to write to https://support.stripe.com/?contact=true or raise it to your sales contacts if you have them
so I suppose the only option is hacky workarounds like manually creating Invoices and setting this information into custom_fields on the Invoice, or generating your own PDFs entirely(probably what I would do) or using a third party invoicing product
yeah hacky workarounds
We are using some third party solution to create fiscalized invoices and they provide is with some PDF, but we've wanted to use Stripe Invoice because it looks way better
and we just wanted to insert in "custom_fields" those numbers
can I somewhere request a feature for Stripe Tax + Checkout for this flow in Croatia
yep you can write to https://support.stripe.com/?contact=true or raise it to your sales contacts if you have them
but candidly this Invoice fiscalization feature is not something we're likely to prioritise in the short term as this type of EMEA expansion is not a company priority right now so I would focus on workarounds.
so you can use that to add custom fields to the invoice Checkout would create. But you'd need to know the values _before _ the successful payment, so it might not work for your use case
Object literal may only specify known properties, and 'invoice_creation' does not exist in type 'SessionCreateParams'.ts(2345)
weird
when I try to do that in demo project typescript is not throwing errors
you're using an old version of the stripe-node library
yes, https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md#1120---2022-12-06 is the version where these fields are added to the types
thanks man
{"type":"StripeInvalidRequestError","raw":{"message":"You can only enable invoice creation when mode is set to payment. Invoices are created automatically when mode is set to subscription, and are unsupported when set to setup. To
where I can enable in dashboard to send invoice to user on e-mail when he makes successful payment
will mails be sent in test mode also?
No we don't send emails in test mode. You might be able to test it with your own email though (the email on the account).
so if I create user in app === email on the stripe dashboard, email will trigger in test mode in only that case?
Ah sorry, what I meant was the email that your stripe account is registered with.
You can try creating a test customer with that email
stupid question
where can I check email that stripe is registered wth
my team lead added me in stripe as a developer role
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.