Skip to main content
Published: November 13 2008, 7:15:00 PMUpdated: November 28 2020, 4:08:55 PM

GetOrderTransactions sample using .NET SDK

Detailed Description

.NET SDK sample to make a call to GetOrderTransactions:

 

//create the context
ApiContext context = new ApiContext();

// Credentials for the call
context.ApiCredential.ApiAccount.Developer = "devID";
context.ApiCredential.ApiAccount.Application =
"appID";
context.ApiCredential.ApiAccount.Certificate =
"certID";
context.ApiCredential.eBayToken =
"token";

// Set the URL for Sandbox
context.SoapApiServerUrl = "https://api.sandbox.ebay.com/wsapi";

// Set logging
context.ApiLogManager = newApiLogManager();
context.ApiLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger("Messages.log", true, true, true));
context.ApiLogManager.EnableLogging = true;

// Set the version
context.Version = "581";

GetOrderTransactionsCall call = new GetOrderTransactionsCall(context);
call.ItemTransactionIDArrayList = new ItemTransactionIDTypeCollection();

//add as many ItemID TransactionID objects as required
ItemTransactionIDType itemTrans1 = new ItemTransactionIDType();
itemTrans1.ItemID = "110035634576";
itemTrans1.TransactionID = "0";
call.ItemTransactionIDArrayList.Add(itemTrans1);
ItemTransactionIDType itemTrans2 = new ItemTransactionIDType();

itemTrans2.ItemID = "110035634592";
itemTrans2.TransactionID = "1234567890";
call.ItemTransactionIDArrayList.Add(itemTrans2);

//set DetailLevel to ReturnAll to get the ExternalTransactionID call.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);

call.Execute();

//Process the response
foreach (OrderType order in call.OrderList)
{
 
//some sample information retrieved
 
string buyerUserID = order.BuyerUserID;
 
if (order.ShippingDetails.SalesTax != null)
 
{
   
string salesTaxState = order.ShippingDetails.SalesTax.SalesTaxState;
   
float salesTaxPercent = order.ShippingDetails.SalesTax.SalesTaxPercent;
   
double salesTaxAmt = order.ShippingDetails.SalesTax.SalesTaxAmount.Value;
  
}

  TransactionType transaction = order.TransactionArray[0];
 
string buyerEmail = transaction.Buyer.Email;
 
double amtPaid = transaction.AmountPaid.Value;

}


 Additional Information

Documentation:  GetOrderTransactions

How well did this answer your question?
Answers others found helpful