GetInvoicePDFByTransactionIDAndReportStyleName - accountsIQ/API-Wiki GitHub Wiki
The GetInvoicePDFByTransactionIDAndReportStyleName will function in the same way as GetInvoicePDFByTransactionID however you can now pass a report style instead of the default style selected in the system.
When a PDF sales invoice is required, a transaction can be provided to this function and a PDF sales invoice in a byte array will be returned and then can be saved as a PDF in the style passed in.
public WSResult2<Byte[]> GetInvoicePDFByTransactionIDAndReportStyleName(String token, Int32 transactionID)
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
transactionID | Int32 | The ID of the transaction for the sales invoice you want a PDF for. |
reportStyleName | string | The style of the report requested. |
The following example will generate a invoice in a byte array and save it as a Pdf in the style passed in the request.
Integration ws = new Integration();
string authToken = ws.Login(entityID, partnerKey, userKey);
if (authToken != null)
{
int salesInvoiceTransactionId = 1486;
string reportStyleName = "Test Style";
WSResult2OfArrayOfByte response= ws.GetInvoicePDFByTransactionIDAndReportStyleName(authToken, salesInvoiceTransactionId, reportStyleName);
System.IO.File.WriteAllBytes($"SalesInvoice-{salesInvoiceTransactionId}.pdf", response.Result);
}