How can I get a receipt from Square in json format? - square

Whenever I buy something from a square vendor, I get an email with a receipt link to https://squareup.com/r/. This returns an html page. Does anyone know of a way to get this in JSON or some other machine-readable format? I looked through their api but it seems only for business integration

Related

How to determine if a Shopify order was placed via the Amazon channel?

I am querying the Shopify API for a specific order and I would like to know how to determine if the order was placed in our Amazon Seller channel and sent to Shopify as it is described in Shopify's documentation: https://help.shopify.com/en/manual/sell-online/amazon-sales-channel/processing-orders. On the section "Fulfilling Orders" of that page it reads:
All new orders placed through Amazon appear in your orders list and
are marked as Amazon.
A real JSON response from the Order API looks like this: https://help.shopify.com/en/api/reference/orders/order#show
I could not find any indication that the order might come via Amazon. I did find the fulfillment service (just a simple Ctrl F "amazon") but that is a different thing.
Being a Shopify Plus customer we asked their Guru Support team how they implement the "marked as Amazon" part and the response was:
Guru: Looking at all your orders you won't be able to
differentiate. When you click through to a singular order though,
you'll be able to see in its timeline that it came from Amazon instead
of your Online store.
My team: mmm so if I connect though the API
"orders.json?id=xxxx" the only way I can check it came from amazon is
though the timeline?
Guru: As far as I'm aware that's the case. I can check with our
development team to see if there's another indicator. Would I be able
to email you back with any additional findings?
Of course my team is still waiting on an answer from them but I bet someone at SO has already been in this situation before.
Some might want to know why I need to know the order source. We are sending these orders from Shopify into Netsuite via a Celigo connector. Amazon orders need to hit a different GL account than the normal Shopify orders and my task is to code the correct mapping based on some differentiating element or name/value pair from the JSON response.
When an order comes down the JSON has a field called source_name and the value should be something like this: sell-on-amazon
"source_name":"sell-on-amazon"

Get cryptocurrency twitter, website, and markets from coinmarketcap.com api

I am trying to get the twitter name, website, and markets for any cryptocurrency listed on coinmarketcap.
For example:
https://coinmarketcap.com/currencies/bitcoin shows all of the data that I need but how would I parse the data listed on that page to get the twitter name and website associated with bitcoin?
Don't try to parse the data on that page if you are trying to use it in an application. If you are doing it for a one time data collection then maybe that is OK. There is absolutely no guarantee that the format will remain consistent or that the information will even be there tomorrow.
You should try to find an API that gives you the information that you are looking for. An API is a contract that is expected to be honored and therefore is reliable. A quick look at CoinMarketCap's API doesn't appear to have the info you are looking for but maybe another one exists that does.
If you were to parse the HTML you could write a regex for the specific thing you are looking for. For example if you want to get the website you could write a regex that would pick up the pattern:
Website
the capture group ([^"]+) is the website in this example. You could do something like that for every element you want to get.

Get referral (parthnership) link for a product on Aliexpress?

The question is about API and independent from programming language.
I want to get a commission from products on Aliexpress.
API documentation (press "API Documents")
But I can't understand how to generate a link and then how to check if it is correct.
As I understand I need to use 1.1 listPromotionProduct request, get all the links from the result and apply 1.3 getPromotionLinks to them. Is it correct?
Yes you're right this is the way to do it, so you need to do two API calls, one to api.listPromotionProduct, collect up the URLs and then make a call to api.getPromotionLinks.
This URL works:
http://gw.api.alibaba.com/openapi/param2/2/portals.open/api.getPromotionLinks/YOURAPIKEY?fields=totalResults,trackingId,publisherId,url,promotionUrl&trackingId=YOURTRACKINGIDHERE&urls=https://www.aliexpress.com/item/Rotary-Cheese-Tools-Cheese-Grater-Stainless-Steel-Slicer-Shreds-Drum-Hand-Held-Ginger-Graters-Cutter-Kitchen/32706493641.html
Append more URLs to this URL using a comma (up to 50 URL's).
Likely Issue
The thing I was doing wrong was using the wrong trackingID, it's not your digital signature but the affiliate ID you specified in https://portals.aliexpress.com/publisher_manage.htm (I think you can have multiple affiliate ID's).

Google Shopping API - multiple store information

We are developing an app for mobile, Mainly using Google Shopping API.
In the response we are getting one store info for one particular product.
Is there any other way to get multiple store info for one product in the response for Google Shopping API
Regards,
Bhat
if you figure out the GTIN for a product, then search by that GTIN as the query, then each result should come back as a different store
it just means usually you have to do a search on the query, grab the top most relevant GTIN, then make another request to get the store info. Thats how I have done it anyways, would be interested to know if you solved it any other way :)

Accessing Mutual fund quotes

I have been looking for a while at how to retrieve financial quotes in c#, in this case, Canadian mutual funds.
It seems there are 2 main sources of information for this, Yahoo and Google! Also there seems to be 2 preferred methods, API and HTML scrapping. My preference would be for an API method, but I am open to any suggestion.
I have found the Yahoo api to be very nice to use, however although it works for stocks like "MSFT" it fails to retrieve the data for mutual funds like "RBCCANADIANI.TO". For some reason this symbol only works on the web site itself.
Google's API seems to requires to have a portfolio set up and login in order to retrieve quotes, I would prefer to avoid logins and use a completly opened api if possible.
HTML scraping introduce a totally new set of complications, asking the user to locate on an html page where the price is and such. Note that Google's html (http://www.google.com/finance?q=MUTF_CA:RBF556) returns the right page, but a look at the html source shows that the price is not in an easily identifiable tag (id not set!).
Has anybody tried similar things, I have the feeling I am missing something here :)
Many thanks
I am having success with the following YQL query:
select LastTradePriceOnly from yahoo.finance.quotes where symbol in ("F0CAN05NGC.TO")
This is for Royal Global Precious Metals fund.
Mutual funds have a LastTradePriceOnly field but no Bid field like stocks have. I got the symbol from the Symbol Lookup on the Yahoo finance page.
If you are looking for pricing data I would suggest a service like IQFeed. I have used them as a client for some time and they do have mutual fund data (although I don't use it). If you don't want to pay for it you will probably have to scrape it.