Help

Help with QR-Invoice API Integration with Airtable (Saving PDF as Attachment)

Solved
Jump to Solution
425 5
cancel
Showing results for 
Search instead for 
Did you mean: 
tanzheit
4 - Data Explorer
4 - Data Explorer

Hello everyone,

I am working on a script where I send invoice data from Airtable to the QR-Invoice API to receive a QR invoice in PDF format. I then want to store this PDF as an attachment in an Airtable table for a specific customer.

My goal is to automate the entire process (sending data, receiving the QR invoice, and saving the PDF as an attachment) within a single Airtable script, without the need for another automation tool like Zapier or Integromat. The process I'm envisioning is as follows:

  1. Invoice data from Airtable: I fetch the invoice data from an Airtable table.
  2. Sending data to QR-Invoice: The data is sent to the QR-Invoice API to receive a QR invoice in PDF format.
  3. Saving and linking the PDF: Once I receive the PDF, I want to save it as an attachment in the same Airtable table for the corresponding customer.

My question is:

  • Can this entire workflow be achieved entirely within a single Airtable script?
  • Or would I need to integrate additional automation tools (e.g., Zapier, Integromat, etc.)?

I look forward to any insights or solutions on how to implement this workflow directly in Airtable.

Thank you in advance!

1 Solution

Accepted Solutions
tanzheit
4 - Data Explorer
4 - Data Explorer

I set up the entire automation in Make. Here’s how I solved the problem:

  1. Monitoring new entries in Airtable: The automation starts when a new record is added to the "Rechnungen" (Invoices) table. Make automatically extracts the reference number and the amount from the new entry.

  2. API request to QR-Invoice: These details (reference number and amount) are sent via an HTTP API request to the QR-Invoice service.

  3. Receiving the PDF invoice: I receive the generated invoice as a PDF from the QR-Invoice service.

  4. Converting to Base64: The PDF is converted into a Base64-encoded string using the base64() function, making it suitable for storage as an attachment in Airtable.

  5. Sending back to Airtable: Finally, the Base64-encoded invoice is sent back to Airtable via an HTTP API request and saved directly in the appropriate attachment field of the new record with the attachement endpoints from https://airtable.com/developers/web/api/upload-attachment.

The problem is now successfully solved, and the automation is working perfectly. Thank you for the support!

See Solution in Thread

5 Replies 5
sally_andsundry
5 - Automation Enthusiast
5 - Automation Enthusiast

This will depend on how the API's returns the attachment. If it is a link, you can paste it directly into the attachment field. However if it is a filestream/blob, i believe you'll need zapier/make to manage that.

------------- Edit -------------

Roughly skimming the API docs: https://rest.qr-invoice.cloud/swagger-ui/index.html#/11%20Payment%20Part%20%26%20Receipt%20(QR%20Bil...

It looks like they return files in binary, so this will have to be handled in Zapier: https://www.qr-invoice.ch/angebot/zapier/

@tanzheit 

If you'd like to do all of that in ONE SINGLE WORKFLOW with ONE SINGLE SCRIPT, you can do all of that with ONE SINGLE SCRIPT by using Documint's advanced documents for Airtable, which would also handle the QR code generation for you as well.

Any other way of doing this would require at least 1 script + 1 external automation + 2 external tools. For example, you could use Make's built-in QR Code generation tools, and you could instantly trigger Make with this script, but you would still need to involve a PDF document-generating app (which could be Documint, Google Docs, Microsoft Word, or whatever you want). 

Hope this helps! If you’d like to hire an expert Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld

 

re: Can this entire workflow be achieved entirely within a single Airtable script?

I reckon you could, yeah.  Tricky bit is what @sally_andsundry mentioned with the file upload.  You'd just need to figure out how to upload the returned pdf into Cloudinary or something so that you could feed that into an attachment field

Could also try using the upload attachment endpoint for this too: https://airtable.com/developers/web/api/upload-attachment

 

tanzheit
4 - Data Explorer
4 - Data Explorer

I set up the entire automation in Make. Here’s how I solved the problem:

  1. Monitoring new entries in Airtable: The automation starts when a new record is added to the "Rechnungen" (Invoices) table. Make automatically extracts the reference number and the amount from the new entry.

  2. API request to QR-Invoice: These details (reference number and amount) are sent via an HTTP API request to the QR-Invoice service.

  3. Receiving the PDF invoice: I receive the generated invoice as a PDF from the QR-Invoice service.

  4. Converting to Base64: The PDF is converted into a Base64-encoded string using the base64() function, making it suitable for storage as an attachment in Airtable.

  5. Sending back to Airtable: Finally, the Base64-encoded invoice is sent back to Airtable via an HTTP API request and saved directly in the appropriate attachment field of the new record with the attachement endpoints from https://airtable.com/developers/web/api/upload-attachment.

The problem is now successfully solved, and the automation is working perfectly. Thank you for the support!

To clarify for those people reading this thread, you used Make's HTTP module to make your API calls.