GetSalesReceiptPDFByTransactionID - accountsIQ/API-Wiki GitHub Wiki

The GetSalesReceiptPDFByTransactionID function will return a byte array of a Sales Receipt, which can be saved as a PDF. Purchases Ledger won't work.

Description

When a PDF sales receipt is required, a transaction can be provided to this function and a PDF sales receipt in a byte array will be returned and then can be saved as a PDF.

Declaration

C#

public WSResult2<Byte[]> GetSalesReceiptPDFByTransactionID(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 receipt you want a PDF for.

Example

The following example will generate a receipt 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 salesReceiptTransactionID = 1487;
          WSResult2OfArrayOfByte response= ws.GetSalesReceiptPDFByTransactionID(authToken, salesReceiptTransactionID);

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

See Also

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