For Zoho Services only:


I'm actually part of a bigger team at Ascent Business Solutions where we have support technicians and project consultants. Support is for smaller technical fixes but this can include developments, reports or integrations; depending on the size of the task. Projects are for more time-consuming developments such as revamps of the Zoho Suite of apps or on-site training. The advantage of a team is that if I am out-of-office for a day or so, there is always someone at Ascent Business Solutions who can deal with any queries/issues you may have.

Our support rates can be found and purchased at http://ascentbusiness.co.uk/zoho-support-2. A support bundle doesn't have an expiry date. So whether we can do what you want within the bundle and a year later need further support, if there are minutes left on the bundle then there is no additional charge.

Our project rates for bigger developments can be found at http://ascentbusiness.co.uk/crm-solutions/zoho-crm-packages-prices and will involve a dedicated project consultant along with developers who will hold your hand through the development process.

If you want help building a solution for one of the Zoho Apps in the Zoho Suite, contact us on 0121 392 8140 (UK) or by email at info@ascentbusiness.co.uk. You can also visit our website at http://ascentbusiness.co.uk.

I regularly build and specialize in 2-way API integrations for Xero, Shopify and eBay.

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: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used 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 - Valid till 8 May 2022 bc1qjtp4l4ra452wzvuk9a45yfj82zkahsyy2z379y
© 2022 Joel Lipman .com. All Rights Reserved.