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.
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.
public WSResult2<Byte[]> GetSalesReceiptPDFByTransactionID(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 receipt you want a PDF for. |
The following example will generate a receipt in a byte array and save it as a Pdf.
Integration ws = new Integration();
string authToken = "";// See Authentication page for more
if (authToken != null)
{
int salesReceiptTransactionID = 1487;
WSResult2OfArrayOfByte response= ws.GetSalesReceiptPDFByTransactionID(authToken, salesReceiptTransactionID);
System.IO.File.WriteAllBytes($"SalesReceipt-{salesReceiptTransactionID}.pdf", response.Result);
}