For Zoho Services only:


I'm actually part of something bigger at Ascent Business Solutions recognized as the top Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions offer support for smaller technical fixes and projects for larger developments, such as migrating to a ZohoCRM.  A team rather than a one-man-band is always available to ensure seamless progress and address any concerns. You'll find our competitive support rates with flexible, no-expiration bundles at http://ascentbusiness.co.uk/zoho-support-2.  For larger projects, check our bespoke pricing structure and receive dedicated support from our hands-on project consultants and developers at http://ascentbusiness.co.uk/crm-solutions/zoho-crm-packages-prices.

The team I manage specializes in coding API integrations between Zoho and third-party finance/commerce suites such as Xero, Shopify, WooCommerce, and eBay; to name but a few.  Our passion lies in creating innovative solutions where others have fallen short as well as working with new businesses, new sectors, and new ideas.  Our success is measured by the growth and ROI we deliver for clients, such as transforming a garden shed hobby into a 250k monthly turnover operation or generating a +60% return in just three days after launch through online payments and a streamlined e-commerce solution, replacing a paper-based system.

If you're looking for a partner who can help you drive growth and success, we'd love to work with you.  You can reach out to us on 0121 392 8140 (UK) or info@ascentbusiness.co.uk.  You can also visit our website at http://ascentbusiness.co.uk.

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.  } 
Category: Zoho :: Article: 798

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

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

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
© 2024 Joel Lipman .com. All Rights Reserved.