API for uploading files to invoices/purchases?

Is there any way through the API to attach a file (e.g. a scanned receipt) to a sales invoice or purchase record? There are documented APIs to create a purchase and an invoice, and to upload an untagged file to the receipt hub, but I can’t find anything to bridge the gap and associate an uploaded file with a particular purchase or sales invoice.

Is there something I’ve missed, and/or is it on the radar for future development?

(Background - I use a cloud-based EPOS system that gives me Z readings as web pages at a stable URL. Currently I manually create a sales invoice from the Z reading and include the URL as a note, I’m considering writing a script to automate this and I figured it would be prudent to attach a copy of the HTML Z reading page directly to the sales invoice in QuickFile in case we ever decide to move to a different EPOS and lose access to the current online records. If this could be scripted it would be handy not only for creating new invoices but also to save me having to go back and manually upload a hundred plus HTML files for the existing invoices).

It’s not something we currently support with the API, but I can certainly make a recommendation.

I’ve logged this for now and I will report back when there’s any movement on this.

I note the thread is a year old and I’d had a look over the most recent API documentation, but cannot see this facility in action yet.

Rather than hack a solution with cURL that logs into the UI, per chance is this going to be available soon?

Hi @ricardo81

There is a little function that may help here, but it’s undocumented. It’s the Receipt_Upload function.

You can find the schema docs here: http://www.quickfile.co.uk/WebServices/API/Schemas/invoices/Receipt_Upload.xsd

This will allow the upload of PDF, JPG and GIF files via the API.

However, it doesn’t automatically assign them to a purchase invoice. It will put these in the receipt hub to be assigned.

Hope that helps?

That does sound helpful. Is there a way to associate the upload with the Purchase? I’m just about to upload 600 purchases via Purchase_Create, if there was a way to associate them with the Receipt_Upload’s that would be most excellent.

The bad news is, unfortunately not.

The good news however, is we’ve logged this on our planner to re-visit it, get it documented and perhaps add an option to supply a purchase invoice ID.

Watch this thread for updates

If you could also allow a sales invoice ID that would be great (my original use case was for creating sales records from my EPOS).

Sounds good, hope it’s soon! I suppose an OK workaround at least for me, is to add a “note” with each purchase that references the uploaded file.

@ian_roberts - I am aware that the files for sales invoices are handled slightly differently to purchase invoices, so not sure how feasible this is. I have however logged it with our dev team to take a closer look, and will update this thread in due course.

@ricardo81 - As part of the schema, you can specify a file name. Perhaps you could use this as a way of specifying the date and supply name for easy identification?
<ReceiptName>Supplier1 - 2016-09-28</ReceiptName>

That’d work for me. As long as I can reference one from the other, problem solved. For completeness in the API, it’d be great if you could upload the file with the Purchase_Create call, maybe a < name > and < data > encoded in base64

Cheers

This is currently being looked into further and the current method (Receipt_Upload) is used internally by the old iPhone app, which although has been discontinued, is still being used by some users.

However, we are looking into a new method for the API which would broader in terms of it’s functionality compared to the existing method. The existing method only allows image files, whereas a new one will allow more file types.

We’ll keep you posted.

I’m pleased to announce that there is now a brand new Document_Upload method for handling various document upload scenarios. We haven’t yet documented this method although it is available to test in the API Sandbox. The following diagram will illustrate what is possible, there’s also a sample XML document in the API Sandbox you can use for test purposes.

This Document_Upload API method will handle the following scenarios:

  • Upload a document to the Receipt Hub (Untagged)
  • Upload a document directly to a purchase invoice
  • Upload a sales invoice attachment (with optional notes)
  • Upload a standalone file to the Document Manager

We should have the documentation live by tomorrow but if you have any questions in the mean time please get back to us.

1 Like

Fantastic. Now if you could just make it possible to override the VAT amount when creating invoice lines via the API then I could get rid of my horrible screen-scraping script altogether :wink:

(Context: I sell a mixture of 0%, 5% and 20% items in my shop, my EPOS calculates VAT on each item individually and tells me the exact net, VAT and gross totals to enter when I’m creating an invoice from the Z report. Currently I enter the net, set VAT to 20%, then override the value in the VAT amount box as per the EPOS report - the API lets you set a VAT percentage but not a specific amount)

We’ll look into that, it should be possible.

Official documentation for Document_Upload is now available here.

http://api.quickfile.co.uk/1_1/methodView.aspx?schema=Document_Upload

@ian_roberts

We have just released an update to the Invoice_Create API method that will allow VAT amounts to be overriden.

If you supply a value in TaxAmount this will override the automatic calculation derived from TaxPercentage.

Hopefully that will allow you to retire the screen scraping tool :slight_smile:

1 Like

Thanks, I’ll have a play with it in the next few days.

1 Like

Actually I’ve had a go already and it seems to work fine, though I will reiterate a comment I’ve seen before and say that it would be useful to us developers if you could document your response message formats somewhere in a similar way to the request ones.

1 Like