You can retrieve the sale Id from Related Resources for each transactions.
Pass the ID of the sale transaction from your payment resource.
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
Get Sale sample
Sale transactions are nothing but completed payments. This sample code demonstrates how you can retrieve details of completed Sale Transaction. API used: /v1/payments/sale/{sale-id}