lng
lng

Reputation: 805

Download PDF invoice using IPP .NET SDK for QuickBooks v3.0

I am using IPP .NET SDK for QuickBooks v3.0 in my .NET app to exchange the data between my app and QuickBooks Online. How can I download the PDF invoice from the QuickBooks using this SDK?

Upvotes: 0

Views: 508

Answers (2)

nimisha shrivastava
nimisha shrivastava

Reputation: 2367

The .Net SDK 2.3.0 is released which should be having support for PDFs too. https://developer.intuit.com/docs/0100_accounting/0500_developer_kits/0150_ipp_.net_devkit_3.0/intuit_.net_sdk_release_notes

Upvotes: 0

nimisha shrivastava
nimisha shrivastava

Reputation: 2367

.Net SDK 2.2.0 has support for QBO v3 service upto v79 only. In case you need support for this, then you need to make direct http calls using dev defined library. Sample GET and POST requests are added below. Modify the same for PDF endpoint- https://developer.intuit.com/docs/api/accounting/Invoice

GET https://gist.github.com/IntuitDeveloperRelations/0913b4c224de758fde0a

POST

//string res = CreateV3Customer(consumerKey, consumerSecret, accessToken, accessTokenSecret, realmId);
public string CreateV3Customer(string consumerKey, string consumerSecret, string accessToken, string accessTokenSecret, string realmId)
    {

        StringBuilder request = new StringBuilder();
        StringBuilder response = new StringBuilder();



        var requestBody = "{\"FamilyName\":\"Jack\"}";

        HttpWebRequest httpWebRequest = WebRequest.Create("https://quickbooks.api.intuit.com/v3/company/"+realmId+"/customer") as HttpWebRequest;
        httpWebRequest.Method = "POST";
        httpWebRequest.ContentType = "application/json";
        httpWebRequest.Headers.Add("Authorization", GetDevDefinedOAuthHeader(consumerKey, consumerSecret, accessToken,accessTokenSecret,httpWebRequest, requestBody));
        request.Append(requestBody);
        UTF8Encoding encoding = new UTF8Encoding();
        byte[] content = encoding.GetBytes(request.ToString());
        using (var stream = httpWebRequest.GetRequestStream())
        {
            stream.Write(content, 0, content.Length);
        }
        HttpWebResponse httpWebResponse = httpWebRequest.GetResponse() as HttpWebResponse;
        using (Stream data = httpWebResponse.GetResponseStream())
        {


          string customerr = new StreamReader(data).ReadToEnd();

          return customerr;

        }
    }

Upvotes: 1

Related Questions