-
Notifications
You must be signed in to change notification settings - Fork 2
GetSalesReceiptPDFByTransactionID
Leandro Rowies edited this page Feb 22, 2023
·
3 revisions
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 = 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);
}