Best answer

Error: Missing 'File' field when automatically loading Stripe invoice to Dropbox via Zap

  • 15 February 2024
  • 14 replies
  • 53 views

Userlevel 1
Badge

Hi guys,

I have built a zap that loads a Stripe invoice into a DropBox folder whenever it is created.

When I test the Zap and then transfer the data, everything works fine. There is no error message and the PDF files end up in the DropBox folder.

If the Zap now runs automatically, the error message "Required field "File" (file) is missing." appears.

I ask Stripe for a URL in which the PDF is stored. So I can enter the URL in the browser and get a direct download of the PDF file. As I said, the same thing also works when testing and also when transferring the data for the first time, but not automatically.

Does anyone have an idea?

icon

Best answer by SamB 15 March 2024, 15:42

View original

14 replies

Userlevel 1
Badge

Hi guys, 
 

Just a small addition to my post above. AI Support has asked for the PDF. I can also download this file if I enter the URL via a private window. So it is not necessary to be logged in to access the file.

This is what the Zap run actually says when I look at the error:

file:    {{226344646__invoice_pdf}}
 

Userlevel 7
Badge +6

Hi there @Oliver21,

Whenever you see those {{...}} curly braces around entries in the Data In of an action, this means that there is a field mapped there in the Zap Editor, but when the Zap ran live this data was not sent from a previous step.

I have a hunch that Stripe might take a minute to generate an invoice since the “New Invoice” trigger is tagged as an instant trigger. Could you please try adding a 3-5 minutes Delay (Delay for) after the trigger step?

You can learn more about Delay by Zapier here: https://help.zapier.com/hc/en-us/articles/8496288754829-Add-delays-to-Zaps

Kindly give it a try and let me know how it goes? I'll keep an eye out for your response!

Userlevel 1
Badge

Hi @ken.a,

that sounds very reasonable. I have upgraded my plan to Starter to be able to use the delay function.

I now have to wait until a new invoice is created.  Then I'll be happy to give you feedback on whether it worked.

Somehow the Zap doesn't seem to work when I switch on the test mode in Stripe. So I'll have to wait for a real purchase.

Userlevel 7
Badge +6

Hi @Oliver21,

Thanks for trying that out!

Please let me know if my suggestion worked. If not, I’d be happy to help troubleshoot further!

Thanks! 🤗

Userlevel 1
Badge

Hi @ken.a,

there was a new purchase today, but unfortunately the same error occurs, even with a 5-minute delay timer:

file:

{{226354082__invoice_pdf}}

directory:

/Stripe Invoices/CCN

root_id:

55831320

overwrite:

false

 

Any idea how to troubleshoot this?

Userlevel 7
Badge +6

Hi @Oliver21,

Thanks for the update here.

I did some digging into this, and it seems like this is a known bug with the “New Invoice” trigger.  Our team is aware of the issue and is working on a fix. I've added your email address as another affected user. That does a few things:

  • Bring this to the attention of the integration developers
  • Help track and prioritize fixes
  • Allows us to notify you via email if/when this is fixed

Unfortunately, I do not have an ETA, but I’ve added you to the list of users affected by this issue so we can let you know as soon as we have any updates.

Having said that, the workaround you can try is adding a Delay step after the trigger and a Find Invoice in Stripe step after the Delay step or you can follow this loom.com video: 

Hopefully, this helps!

Userlevel 1
Badge

Hi @ken.a,

thank you so much for your effort and time. This workaround helps me a lot. I will try this out.

In the meantime I had also contact to the stripe support which was also really helpful. I will share what they told me about the delay of finalizing the invoices:

 

I understand that you still have a question regarding the timeframe for creating the PDF. I am happy to help with this.
 
I have done extensive research of our documentation and a conversation with our technical team and I can tell you the following:
 
There is a time period of approximately one hour until the invoice is "finalized". This period is useful for edits and therefore we allow some changes to be made. After this time has elapsed, the invoice can no longer be edited.
 
The PDF will only be generated after this hour, as it must contain the completed version. I ask for your understanding and recommend that you adapt your integration to this period. 
 
For your reference, I am sending you two links to our documentation. I hope you find them useful:
 
https://docs.stripe.com/billing/invoices/subscription#manage-invoices 
https://docs.stripe.com/api/invoices/object#invoice_object-invoice_pdf 


Please do not forget that I am at your disposal to clarify your questions or help you with any requests.

 

I will try to set the delay timer to more than one hour first and then I try the workaround described in the video.

Userlevel 7
Badge +11

Thanks so much for sharing those details from Stripe support team, @Oliver21 - that is good to know!

Hopefully setting a Delay to over an hour will do the trick and save you having to set up that workaround using webhooks. But if you run into any further trouble on this do let us know - always happy to help further! 🙂

Userlevel 1
Badge

Hi @all,

the Zap with only the daly of 65 mins didn’t work out right. I don’t know why. So I also used a workaround. This works for me also with the receipts that are created with every charge. So you can download either the invoice or the receipt from Stripe and upload it to your Dropbox.

Here is a template from what I used:

 

https://zapier.com/shared/090aaf1a9dc83611783a7582f727ce9591b2ab8d

Userlevel 7
Badge +6

That’s great to hear @Oliver21! We’re glad to hear that the workaround worked! 🎉

Happy Zapping! ⚡️

Userlevel 7
Badge +11

Hey folks! 👋

I’ve just seen that an updated version of the New Invoice trigger has been added to the Stripe app which defaults to triggering on "open" (finalised) invoices instead of draft invoices. This should help to resolve the issue of the Zaps triggering for new invoices before they’re finalised.

Can you all give that updated New Invoice Stripe trigger a try and confirm whether that has fixed things? 

Userlevel 1
Badge

Hey @SamB,

Thank you for the tip about the revised app.

I tried it out straight away last night. Unfortunately, the request with the finalized invoices did not lead to the desired result. But the app has even more options. For me, the request for paid invoices led to the right results and I no longer needed a 65-minute delay.

Very cool!

Userlevel 7
Badge +11

Thanks for the update @Oliver21

I’m so pleased those new options helped and allowed you to get rid of that Delay action. Sounds like you’re all set for now but if there’s anything else I can help with do let me know! 🙂

Userlevel 1
Badge

Hi @SamB,

Retrieving invoices works perfectly with the new setting.

Unfortunately, there are always errors when retrieving the receipts. I don't know exactly what the problem is. Sometimes it doesn't work sometimes. I have already written to Stripe support about this. Unfortunately, I can't currently pinpoint more clearly what the problem might be.

Reply