My Products
Help
Daanensing_Lucanet
CONTRIBUTOR ***

Getting customer / supplier invoice document (PDF)

by Daanensing_Lucanet (Updated ‎02-02-2021 13:38 by Yıldırım VISMA )

Hi all,

 

I'm trying to find out if it is possible to download / open the invoice (PDF) in Visma using the API. I would like to know if somehow, i can use details which are extracted from the JournalTransactionV2 endpoint in order to get to the invoice (PDF). Hoping someone could point me in the right direction :). 

 

Kind regards, 

 

Daan 

6 REPLIES 6
Juliane Cappelen
CONTRIBUTOR *

by Juliane Cappelen

Hi Magnus, 

 

I've been able to find and use the PDF PRINT endpoints for CustomerInvoice and CustomerCreditNote, but unable to find the PDF PRINT option for SupplierInvoice. 
Will this be added any time soon? 

 

Br,

Juliane 

by Magnus Johnsen

There is no direct action for the supplierInvoices.

But you can get the attachments for the invoice with the attachmentID on the supplierInvoice and then get by id via the "Attachment" endpoint.

Juliane Cappelen
CONTRIBUTOR *

by Juliane Cappelen

Hi, 

Will I be able to print the PDFs as an octetstream through your described solution?

 

Can't see the print option from the Attachment endpoint: 

JulianeCappelen_0-1704890490773.png

 

by Magnus Johnsen

Hi,

Yes that is correct, please let us know if you run in to any issues. 

Daanensing_Lucanet
CONTRIBUTOR ***

by Daanensing_Lucanet

Hi Magnus,

 

Thanx for the quick and detailed response. I'm not familiar with octetstream yet but from the looks of it, this is exactly what i need. 

 

Regards,

 

Daan

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

 

This would depend on what the source document for the journalTransaction is.

 

Scenario 1 - Transaction is for a payment to an invoice:

From UI:

2020-12-09 07_45_59-Journal transactions.png

 

Get JournalTransaction:

2020-12-09 07_45_59-Journal transactions.png

2020-12-09 07_49_49-Postman.png

To get to the CustomerInvoice in this case you would first need to GET customerPayment, with the referenceNumber in the reply above:

2020-12-09 07_51_51-Postman.png

In the response from CustomerPayment, you would check the paymentLines for the invoice referenceNumber and continue with steps below.

 

Scenario 2 - Transaction is for the invoice:

2020-12-09 07_38_32-Journal transactions.png2020-12-09 07_39_03-Postman.png

Here you would directly get the referenceNumber from the lines and call the customerInvoice/InvoiceNumber/print endpoint:

2020-12-08 16_30_48-Visma.net Integrations Documentation.png

In the response you would receive the PDF as an octetstream:

2020-12-09 07_40_47-Postman.png