Is it possible to send Magento Event Observer result to Custom API? - magento

I wonder, is it possible to send Magento Event Observer result to custom API?
I'm trying to create an API to get new order via XML-RPC. Are there any examples around?
Thanks!

I haven't used any Magento Web Services, via XML-RPC. However, I have used normal SOAP Core API & SOAP V2 Web Services of Magento, and if you are using either of these two processes, then there is a solution for you.
For Magento Core API, the required method name is "sales_order.list", and for the SOAP V2, the required method name is "salesOrderList". The return type will be array of orders. The main useful thing in this Web Service method, is that there is an option to use filters. Now this filter will help you a lot in getting the new orders from a specified date & time, so you can pretty much use it to your own requirement.
For the V2 Web Services method "salesOrderList", you can use the filter as:-
<salesOrderList>
<sessionId>51ba5b3ff707f874fd76369d65bb1b7f</sessionId>
<complex_filter>
<key>created_at</key>
<value>
<key>gt</key>
<value>2011-07-14 13:38:56</value>
</value>
</complex_filter>
</salesOrderList>
What the above sample code will do is that it will fetch / retrieve those orders in array format, which have been created after 01:38:56 PM of 14th July, 2011.
Hope it helps.

Related

How to implement Amazon MWS api in MVC Web API?

I am new to Amazon marketplace web service (MWS). I have read documentation of web service but I am unable to understand which api suit for update quantity and price of single or multiple product at one time.
Here is link that I am reading so far and don't know where to start.(http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html)
Can you guys suggest me where to start?
Check out the feed types. You're going to want to submit a pricing or inventory feed to update your inventory. Once you have a feed created, you submit that using the SubmitFeed operation.
For an overview on how feeds works, check out this What you should know about the Amazon MWS Feeds API section.
Specifically for ASP.NET, there is an SDK built that will help you greatly. If you want to know how to implement that as a web api, that's another topic, but you can wrap code from the SDK inside a web api endpoint. But start with understanding MWS.

Is there a possibility to get data from google analitycs to CRM via API or else?

We have an web site and CRM. User fills form on a web page then we send this data into CRM as contact. Also Google analitycs gets more info about this user directly from web site. Is there any possible way to get data from Analitycs to combine it with CRM data?
If this is important: Bitrix24.com is used as CRM (installed on our server).
Thanks in advance.
You need this web-site: https://developers.google.com/apis-explorer/?hl=en#p/analytics/v3/analytics.data.mcf.get to construct API-request.
Set your CustomerID in filters field like this: mcf:adwordsCustomerIDPath=={customerID1}

Spring MVC - How to manage Reference Data on Web Clients

I have a Typical SOA web application which has the following components as expected.
The Web Client - Sprinv MVC
SOAP Services - Spring
The Reference Data is centralized which is exposed thru its own SOAP Services.
The SOAP webservice responses have codes for elements(like CountryCode, CityCode etc).
I need the suggestions as to what should be the best approach to for ex display the Country Description instead of the country code (which needs another SOAP call to reference data and same with other codes) on the web page ?
Few options are like:
Write a custom tag library which would do the necessary calls and get the data.
Fetch all the ReferenceData descriptions and put it into some kind of HashMap, add it to the model to be consumed by the web page.
Any other better ways please advice.
Since it's reference data, no one expect it to change very often, right? Retrieve them once and serve them up using #ModelAttribute. See here.
Spring MVC is still server side, so it can handle very large data e.g. all the street addresses in US. You simply need to make sure you add some sort of filter if you don't want to serve the entire collection. And simply partial update these reference data with the latest on regular basis.

Downloading existing paypal payments with rest api

I need to download all existing payment information from a paypal account to do some analysis on it, so I set up paypal's ruby rest sdk, which involved creating a new application with its own API keys and whatnot. I can make a successful request with the following:
payment_history = Payment.all( :count => 10 )
However,
payment_history.payments
Is empty.
I'm not sure if this application can only access payments created with it? Can I not get pre-existing payments with the rest api? I would prefer to use ruby, if that's possible, as I would like to keep this all within the simple script I have to analyze similar stripe payments.
Some guidance would be extremely appreciated, as paypal's labrinth of documentation and overlapping APIs have me pretty confused.
You will be able to query only those payments that are made or created with Rest API not the Classic APIs. You can use the Classic Ruby SDKs for the appropriate product to get the Transaction details of the classic APIs

How to void a payment in netsuite using netsuite webservice

I need to void a payment made in netsuite by using NetSuite webservice. Is it possible? I have tried by adding Journal entry for the payment which i need to void. But it doesn't work for me. Any help on this is appreciated.
If you're using suite scripts you can use
nlapiVoidTransaction(transactionType, recordId);
This API is supported in the following script types:
Client
User Event
Scheduled
Suitelet
RESTlet
Workflow Action
The Governance on this API is 10.
The general rule in Netsuite webservice is, if it can be done in the user-interface then it can be done via webservices.
By voiding you mean, deleting the payment? If you can confirm that it is possible do to it (no other child records attach on it, etc.) then it can be done via webservices.
Voiding is not supported via web services or SuiteScript.

Resources