GetInvoicePDFByTransactionID - accountsIQ/API-Wiki GitHub Wiki

The GetInvoicePDFByTransactionID function will return a byte array of a Sales Invoice, that can be saved as a PDF. Purchases Invoices won't work.

Description

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.

Declaration

C#

public WSResult2<Byte[]> GetInvoicePDFByTransactionID(String token, Int32 transactionID)

Parameter List

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.

Example

The following example will generate a invoice in a byte array and save it as a Pdf.

C#

      Integration ws = new Integration();

      string authToken = ws.Login(entityID, partnerKey, userKey);
      if (authToken != null)
      {
          int salesInvoiceTransactionId = 1486;
          WSResult2OfArrayOfByte response= ws.GetInvoicePDFByTransactionID(authToken, salesInvoiceTransactionId);

          System.IO.File.WriteAllBytes($"SalesInvoice-{salesInvoiceTransactionId}.pdf", response.Result);
      }

See Also

⚠️ **GitHub.com Fallback** ⚠️