使用适用于 QuickBooks v3.0 的 IPP .NET SDK 下载 PDF 发票
Download PDF invoice using IPP .NET SDK for QuickBooks v3.0
我在我的 .NET 应用程序中使用 IPP .NET SDK for QuickBooks v3.0 在我的应用程序和 QuickBooks Online 之间交换数据。如何使用此 SDK 从 QuickBooks 下载 PDF 发票?
.Net SDK 2.2.0 仅支持 v79 及以下版本的 QBO v3 服务。
如果您需要对此的支持,那么您需要使用开发人员定义的库进行直接的 http 调用。
下面添加了示例 GET 和 POST 请求。对 PDF 端点进行相同的修改-
https://developer.intuit.com/docs/api/accounting/Invoice
获取
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;
}
}
.Net SDK 2.3.0 已发布,应该也支持 PDF。
https://developer.intuit.com/docs/0100_accounting/0500_developer_kits/0150_ipp_.net_devkit_3.0/intuit_.net_sdk_release_notes
我在我的 .NET 应用程序中使用 IPP .NET SDK for QuickBooks v3.0 在我的应用程序和 QuickBooks Online 之间交换数据。如何使用此 SDK 从 QuickBooks 下载 PDF 发票?
.Net SDK 2.2.0 仅支持 v79 及以下版本的 QBO v3 服务。 如果您需要对此的支持,那么您需要使用开发人员定义的库进行直接的 http 调用。 下面添加了示例 GET 和 POST 请求。对 PDF 端点进行相同的修改- https://developer.intuit.com/docs/api/accounting/Invoice
获取 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;
}
}
.Net SDK 2.3.0 已发布,应该也支持 PDF。 https://developer.intuit.com/docs/0100_accounting/0500_developer_kits/0150_ipp_.net_devkit_3.0/intuit_.net_sdk_release_notes