#MarkoBoras

1 messages · Page 1 of 1 (latest)

tender latchBOT
jovial cipher
pale rover
#

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?

rancid turret
#

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.

pale rover
#

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

rancid turret
#

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

pale rover
#
  • 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
rancid turret
pale rover
#

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

rancid turret
#

yep but that's what I meant. It's not a great system.

pale rover
#

so I mark it as it is paid outside of stripe

#

and I can edit invoice with some data?

rancid turret
#

you'd edit it before you mark it as paid but yes

pale rover
#

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*

rancid turret
pale rover
#

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

rancid turret
#

if you use paid_out_of_band we don't charge the customer as part of the Invoice no

pale rover
#

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

rancid turret
#

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

pale rover
#

Okay

#

Can we leave this thread open to ask you more question while I implement it

#

I'll be off for some time

rancid turret
#

we close the thread after about 30 minutes of inactivity

pale rover
#

okay

#

i'll ask agian

#

again

rancid turret
#

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.

pale rover
#

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

rancid turret
#

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

pale rover
#

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

rancid turret
#

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.

pale rover
#

I understand

#

Thanks man

rancid turret
#

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

pale rover
#

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

rancid turret
#

you're using an old version of the stripe-node library

pale rover
#

"stripe": "10.0.0"

#

updated it

#

now it works

rancid turret
pale rover
#

thanks man

pale rover
#

{"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

pale rover
#

will mails be sent in test mode also?

analog saffron
#

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).

pale rover
#

so if I create user in app === email on the stripe dashboard, email will trigger in test mode in only that case?

analog saffron
#

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

pale rover
#

stupid question

#

where can I check email that stripe is registered wth

#

my team lead added me in stripe as a developer role

analog saffron