getReceiptPdf

suspend fun getReceiptPdf(receiptId: String, applicationId: String, isPrintedVersion: Boolean = false, includeReturnReceipts: Boolean = false, fileName: String? = null): ApiResult<Uri>

Creates a pdf file containing a receipt from the user's receipt list

Return

(Success) ->ApiResult.Success<Uri> containing a Uri for the newly created PDF File
(Generic Error) ->ApiResult.GenericError with codes:
250 -> User is not logged in
400 -> Returns if the receipt could not be exported
401 -> Unauthorized
403 -> Returns if the appUser is not authorized to access the receipt
440 -> Returns if the receipt could not be found
405 -> Returns if failed to save pdf to storage
440 -> Failed to Refresh Token
450 -> Failed to create Uri in locale cache
499 -> Unknown Error occurred
(Network Error) ->ApiResult.NetworkError\

Parameters

receiptId

Receipt Id which should be exported to a PDF file

applicationId

String Valid application id of the calling application. Used for FileProvider Authority

isPrintedVersion

If set to true, PDF is rendered as multi page DIN A4 PDF.

includeReturnReceipts

If set to true, PDF includes all Return Receipts mentioned in Bill.Misc.ReceiptRelations

fileName

String optional filename for the locally cached uri. Use Receipt.getPDFFileName() if receipt model is available. Has to end with .pdf.