web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to get invoice PDF via oData V4

(0) ShareShare
ReportReport
Posted on by 65

Hi.

Is there a standard endpoint to get direct URL-s to purchase invoice PDF-s?

There is some documentation about v2 API that does not seem to work in our current edition. (https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_purchaseinvoice_pdfdocument)

Is there oData V4 equivalent to this?

I have the same question (0)
  • JAngle Profile Picture
    133 on at

    Which version are you using?

  • Catharsis Profile Picture
    65 on at

    Version: W1 18.1 (platform 18.0.24800.26311 + application18.0.23013.23795)

  • Catharsis Profile Picture
    65 on at

    There is version update scheduled to latest version in May if somehow the methods differ from this version to latest

  • Catharsis Profile Picture
    65 on at

    No one?

  • matthias_rabus Profile Picture
    160 on at

    From your answers, I guess you use BC SaaS, right?

    If you do so, why doesn't API v2.0 work? I would investigate that first, because API is the best way to integrate  with other systems (regarding performance and invest from MS).

  • Catharsis Profile Picture
    65 on at

    Its on-premise.

    I'm already using dozens of oData V4 web service endpoints for integration in various ways. What I don't understand is how this API 2.0 differs from it. Using the URL logic from documentation does not work.

    Is there a webservice I can set-up to get direct URL-s to PDFs?

    So far I have tried objects 2821 nativeInvoicingPDFs and 5529 pdfDocument but using invoice systemid-s those endpoints simply respond that no such documents are found.

  • Verified answer
    Catharsis Profile Picture
    65 on at

    Ok. So I got 5529 pdfDocument web service endpoint to work.

    I falsely assumed that every invoice has PDF already generated by BC automatically. Which seemed logical to me. As it turns out it does not and not finding the document was correct response by the web service. After user has generated PDF for the invoice attachment manually, webservice does find and respond with the content url.

    Not perfect, but will do for now I guess

  • Verified answer
    Marco Mels Profile Picture
    on at

    Thank you for sharing final outcome!

  • Suggested answer
    Westeast Profile Picture
    10 on at

    Invoice doesnt need to be first generated manually for it be downloaded. This is not OData but I just tested and am able to download the corresponding pdf of a posted sales invoice using

    api.businesscentral.dynamics.com/.../pdfDocumentContent.

    This generates and downloads the invoice. You'll first need another query to figure the id of the invoice you need

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,226

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,047 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,257 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans