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

Get invoice PDF via API

(1) ShareShare
ReportReport
Posted on by 63
Hi Team,

I am going to receive invoice PDF via API from Business Central, but BC returns the error message.
I use the cloud version of Business Central.

Example of the request:

https:/api.businesscentral.dynamics.com/api/v2.0/companies(111e9e8a-5177-ee11-817e-6045bdc893e2)/salesInvoices(f57ff210-c5af-ee11-a568-000d3a0b28bf)/pdfDocument/pdfDocumentContent

Response:
 
{
    /error/: {
        /code//RequestDataInvalid/,
        /message//Request data is invalid./
    }
}

What is the reason of this issue and how to fix it?


Also, I added web services:

 
 
 
 
  • Suggested answer
    Kevin Xia Profile Picture
    Microsoft Employee on at
    Get invoice PDF via API
    Hi,
    Please refrain from posting content on the forum that is not related to this forum, or advertising other products, as this will reduce the usefulness of the forum and lose its original relevance. Please delete that statement and thank you.
    Best regards,
    Kevin
  • Verified answer
    Andrew1986 Profile Picture
    63 on at
    Get invoice PDF via API
    I used this documentation - https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_salesquote_pdfdocument

    So, my request is

    https://api.businesscentral.dynamics.com/api/v2.0/companies(111e9e8a-5177-ee11-817e-6045bdc893e2)/salesInvoices(f57ff210-c5af-ee11-a568-000d3a0b28bf)/pdfDocument

    But Business Central returns that the request is invalid.

     
    {
        "error": {
            "code""RequestDataInvalid",
            "message""Request data is invalid."
        }
    }


    what is the reason of the issue and how I should fix it?
  • Suggested answer
    YUN ZHU Profile Picture
    78,972 Super User 2025 Season 1 on at
    Get invoice PDF via API
    Hi, an attachment in the Business Central standard API is defined as an Incoming Document (table 130), not Document Attachment (table 1173).
    I have used this standard API in Power Automate and hope it can give you some tips.
    How to automatically upload files from OneDrive to Business Central with Power Automate (No customization)
     
     
    Thanks.
    ZHU

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,020 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,837 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans