For Zoho services only


I'm currently part of a wider delivery team at Ascent Business Solutions, recognised as a leading Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions support organisations with everything from targeted technical fixes through to full Zoho CRM implementations and long-term platform adoption. Working as a team rather than a one-person consultancy allows projects to move forward consistently, with access to the right skills at each stage.

The team I manage specialises in API integrations between Zoho and third-party finance and commerce platforms such as Xero, Shopify, WooCommerce, and eBay. Much of our work involves solving integration challenges that fall outside standard documentation, supporting new ideas, new sectors, and evolving business models.

Success is measured through practical outcomes and return on investment, ranging from scaling small operations into high-turnover businesses to delivering rapid gains through online payments, automation, and streamlined digital workflows.

If you are looking for structured Zoho expertise backed by an established consultancy, you can contact Ascent Business Solutions on 0121 392 8140 (UK), email info@ascentbusiness.co.uk, or visit https://www.ascentbusiness.co.uk.
Zoho Creator: eBay: Get Item Transaction

Zoho Creator: eBay: Get Item Transaction

What?
This is the function to get the line item order/transaction from eBay if you give it the eBay Item ID as a parameter.

Why?
Mostly for debugging but here's the code that will quickly get the XML of a GetItemTransactions request to eBay.

How?
You'll need an access token for eBay which I documented on how you can generate one in my article: Zoho Creator: Push to eBay Listings. Then you can use the following code, note that the parameter is the eBay Item ID:
copyraw
void API.fn_eBayQuery_GetItemTransaction(int p_ItemID)
{
	/*
    Function: fn_eBayQuery_GetItemTransaction()
    Input: int p_ItemID (eBay Item ID)
    Purpose: Fetches a line item transaction per item ID
    Date Created:   2022-01-22 (Joellipman - Joel Lipman)
                    - Initial release

    More Info:
    - API Explorer Test Tool: https://developer.ebay.com/DevZone/build-test/test-tool/default.aspx?index=0&env=production&api=trading
    - GetItemTransactions Documentation: https://developer.ebay.com/devzone/xml/docs/Reference/eBay/GetItemTransactions.html
    */
	v_Found = 0;
	v_Updated = 0;
	v_Page = 1;
	v_PerPage = 10;
	m_Output = Map();
	r_Api = API_Integration[Connection_Name == "eBay API (Production)"];
	if(r_Api.count() > 0)
	{
		v_AccessToken = thisapp.API.fn_eBayConnect_AccessToken();
		v_TradingAPIVersion = r_Api.API_Version;
		v_Endpoint = "https://api.ebay.com/ws/api.dll";
		//
		// build header
		m_Headers = Map();
		m_Headers.put("X-EBAY-API-SITEID",3);
		m_Headers.put("X-EBAY-API-COMPATIBILITY-LEVEL",v_TradingAPIVersion);
		v_ApiCall = "GetItemTransactions";
		m_Headers.put("X-EBAY-API-CALL-NAME",v_ApiCall);
		m_Headers.put("X-EBAY-API-IAF-TOKEN",v_AccessToken);
		//
		// build params
		m_Params = Map();
		m_Params.put("WarningLevel","High");
		m_Params.put("ErrorLanguage","en_GB");
		m_Params.put("DetailLevel","ItemReturnCategories");
		//
		// include fixed price items
		m_Pagination = Map();
		m_Pagination.put("PageNumber",v_Page);
		m_Pagination.put("EntriesPerPage",v_PerPage);
		m_Params.put("Pagination",m_Pagination);
		//m_ActiveList.put("Sort","ItemID");
		m_Params.put("ItemID",p_ItemID);
		//
		// convert to xml and replace root nodes
		x_Params = m_Params.toXML();
		x_Params = x_Params.toString().replaceFirst("<root>","<?xml version=\"1.0\" encoding=\"utf-8\"?><" + v_ApiCall + "Request xmlns=\"urn:ebay:apis:eBLBaseComponents\">");
		x_Params = x_Params.toString().replaceFirst("</root>","</" + v_ApiCall + "Request>");
		//
		// send the request XML as a string
		r_ResponseXML = invokeurl
		[
			url :v_Endpoint
			type :POST
			parameters:x_Params
			headers:m_Headers
		];
		//
		// output response
		info r_ResponseXML;
		/*
		//
		// if successful then read the response
		if(r_ResponseXML.contains("<Ack>Success</Ack>"))
		{
			//
			// parse the data
			v_MainNode = "Item";
			x_MainNode = r_ResponseXML.subString(r_ResponseXML.indexOf("<" + v_MainNode),r_ResponseXML.lastIndexOf("</" + v_MainNode) + v_MainNode.length() + 3);

		}
		*/
	}	
}
  1.  void API.fn_eBayQuery_GetItemTransaction(int p_ItemID) 
  2.  { 
  3.      /* 
  4.      Function: fn_eBayQuery_GetItemTransaction() 
  5.      Input: int p_ItemID (eBay Item ID) 
  6.      Purpose: Fetches a line item transaction per item ID 
  7.      Date Created:   2022-01-22 (Joellipman - Joel Lipman) 
  8.                      - Initial release 
  9.   
  10.      More Info: 
  11.      - API Explorer Test Tool: https://developer.ebay.com/DevZone/build-test/test-tool/default.aspx?index=0&env=production&api=trading 
  12.      - GetItemTransactions Documentation: https://developer.ebay.com/devzone/xml/docs/Reference/eBay/GetItemTransactions.html 
  13.      */ 
  14.      v_Found = 0
  15.      v_Updated = 0
  16.      v_Page = 1
  17.      v_PerPage = 10
  18.      m_Output = Map()
  19.      r_Api = API_Integration[Connection_Name == "eBay API (Production)"]
  20.      if(r_Api.count() > 0) 
  21.      { 
  22.          v_AccessToken = thisapp.API.fn_eBayConnect_AccessToken()
  23.          v_TradingAPIVersion = r_Api.API_Version; 
  24.          v_Endpoint = "https://api.ebay.com/ws/api.dll"
  25.          // 
  26.          // build header 
  27.          m_Headers = Map()
  28.          m_Headers.put("X-EBAY-API-SITEID",3)
  29.          m_Headers.put("X-EBAY-API-COMPATIBILITY-LEVEL",v_TradingAPIVersion)
  30.          v_ApiCall = "GetItemTransactions"
  31.          m_Headers.put("X-EBAY-API-CALL-NAME",v_ApiCall)
  32.          m_Headers.put("X-EBAY-API-IAF-TOKEN",v_AccessToken)
  33.          // 
  34.          // build params 
  35.          m_Params = Map()
  36.          m_Params.put("WarningLevel","High")
  37.          m_Params.put("ErrorLanguage","en_GB")
  38.          m_Params.put("DetailLevel","ItemReturnCategories")
  39.          // 
  40.          // include fixed price items 
  41.          m_Pagination = Map()
  42.          m_Pagination.put("PageNumber",v_Page)
  43.          m_Pagination.put("EntriesPerPage",v_PerPage)
  44.          m_Params.put("Pagination",m_Pagination)
  45.          //m_ActiveList.put("Sort","ItemID")
  46.          m_Params.put("ItemID",p_ItemID)
  47.          // 
  48.          // convert to xml and replace root nodes 
  49.          x_Params = m_Params.toXML()
  50.          x_Params = x_Params.toString().replaceFirst("<root>","<?xml version=\"1.0\" encoding=\"utf-8\"?><" + v_ApiCall + "Request xmlns=\"urn:ebay:apis:eBLBaseComponents\">")
  51.          x_Params = x_Params.toString().replaceFirst("</root>","</" + v_ApiCall + "Request>")
  52.          // 
  53.          // send the request XML as a string 
  54.          r_ResponseXML = invokeurl 
  55.          [ 
  56.              url :v_Endpoint 
  57.              type :POST 
  58.              parameters:x_Params 
  59.              headers:m_Headers 
  60.          ]
  61.          // 
  62.          // output response 
  63.          info r_ResponseXML; 
  64.          /* 
  65.          // 
  66.          // if successful then read the response 
  67.          if(r_ResponseXML.contains("<Ack>Success</Ack>")) 
  68.          { 
  69.              // 
  70.              // parse the data 
  71.              v_MainNode = "Item"; 
  72.              x_MainNode = r_ResponseXML.subString(r_ResponseXML.indexOf("<+ v_MainNode),r_ResponseXML.lastIndexOf("</" + v_MainNode) + v_MainNode.length() + 3)
  73.   
  74.          } 
  75.          */ 
  76.      } 
  77.  } 

Note to parse a multiple transaction item
This is an update 2025 that if you want to use the Zoho Deluge .toXmlList() function:
copyraw
xl_TransactionArray = x_MainNode.executeXPath("/TransactionArray/Transaction").toXmlList();
for each x_Transaction in xl_TransactionArray
{
     v_TransactionID = x_Transaction.executeXPath("/Transaction/TransactionID/text()");
}
  1.  xl_TransactionArray = x_MainNode.executeXPath("/TransactionArray/Transaction").toXmlList()
  2.  for each x_Transaction in xl_TransactionArray 
  3.  { 
  4.       v_TransactionID = x_Transaction.executeXPath("/Transaction/TransactionID/text()")
  5.  } 
Note how the child node to convert to an xml list needs to be included along with its parent.

Category: Zoho Creator :: Article: 333

Accreditation

Badge - Zoho Creator Certified Developer Associate
Badge - Zoho Deluge Certified Developer
Badge - Certified Zoho CRM Developer

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com