Getting compact information from Square Connect API - php

I want to load Transactions with their Items and Customer from Square Connect API (using PHP client library), but Transactions don't contain any link to their Items unless there is order_id which often tends to be null.
As mentioned in Getting item names from Square Connect API I could go back to version 1 of the API and get list of Payments which includes Items, but there is no connection to Customer.
I know I could join Transactions to Payments by using Tenders which are included in both and get all information I need that way, but it doesn't seem to be good approach (combining two versions of API just seems wrong considering old versions of other APIs tend to deprecate and shut down after some time) and it would be very inefficient for both sides (more requests + downloading duplicate data just to try to match them).
So I would like to know if there's any better way to do this or why isn't.

Ditto on this (I can't comment yet - not enough rep). FreshKDS pull these details from the API (somehow) to display items on their Kitchen Screen. However as I'm already using a cloud service like Zapier (for Woo Orders to Trello Cards) and don't want to have the additional KDS cost as it doesn't pull square orders from WooCommerce (obviously).
So I need to be able to get the Square POS new order details to also create a Trello card - which I am using as a Kitchen Screen.
In regards to the OP's question: Does anyone have any info about webhooks perhaps, or a way to pull an entire order (even if I have to clone it to a database or cloud based spreadsheet) to allow viewing or iteration of individual food/ drink items?
Cheers.

Related

Magento 2 - Get Inventory and Prices in Real Time from Third Party API

I will build a website based on Magento 2... This site in particular has a mid size product catalog (no more than 12000 SKU's but it has many concurrent users)... and one of the things I need to do is to entirely obtain the SKU QTY and PRICES from a third party api gateway in real time... I mean, to be more specific... The product category pages, product detail pages, orders, has to check the qty amount, prices and group prices on this api gateway in REAL TIME because at the same time another store is connected to the same warehouse and we are at risk a product won't be available or it has different price. As a foot note the price is changing also due the business logic.
Is worth to mention that the api gateway that I'will use to get the inventory and prices information is very, very fast... Actually I'm not sure if this changes improves a little bit the Magento 2 performance because we will only use the native modules once the order is entered but no more.
The path I'm planning to follow is for example, in case of inventory, disable MSI (As I mentioned I have only one warehouse for ecommerce on this project) but in general I don't have a clue where to stard...
I'm not sure what classes should I overwrite to achieve this the better way... because I think the best way to achieve this is that each time the prices renders or the availability of the product is checked the api should be called. I understand that this will generate tons of api requests due the site concurrency but It doesn't really matter because as I mentioned that api is very fast and it actually has all the product information.. Actually if we achieve this I think is a tiny step to move the site to a micro services architecture. Unfortunately I can't start the project by the moment with React to make it headless for example...
I was thinking also to catch in some way the request magento 2 performs on each category or filter and retrieve the entire information from the api gateway... Do I make myself understand?. I mean... once the user select a category or perform a search... If I'll be able to get the info and make the request to print the data coming from the api and not reading the magento 2 tables will be awesome.
Well.. that's my issue... I appreciate if anyone could point me in the right direction.

How to implement cross selling on a website?

I have a website which is custom made. I haven't used any carts like Zencart etc. Again it is completely built custom.
I have to implemnt the following on the site.
People who viewed this also viewed
People who bought this also bought:
Popular Today: top 5 products
Recently viewed products by a customer:
Cross selling emails etc.
I have looked into Analytics softwares like Piwik, Google Analytics, clicky.
I know we can store this data as events in Piwik or GA.
The main question is how do I get this data and be able to formulate it and display products according to it on the site?
As for item 2) "People who bought this also bought", Google has released a related product feature that, in theory at least, should it make easy to implement this.
The feature needs to be enabled in the view settings and you need some days of e-commerce data. Then you execute e.g. the example query from the docs:
dimensions=ga:queryProductName,ga:relatedProductName,ga:queryProductId,ga:relatedProductId
metrics=ga:correlationScore,ga:queryProductQuantity,ga:relatedProductQuantity sort=-ga:queryProductQuantity
Presumably a higher correlation score metric indicates which products have a stronger relationship.
The problem I have so far is that this is a blackbox - I do not know how Google computes the correlation score and so far the results look somewhat arbitrary (it might be that my dataset is not yet large enough). You can query the correlation model, but that will return "default" (not really helpful).
However if you are prepared to take a leap of faith and trust Google that this all will make sense then you can use the related product feature to implement cross selling in your website.
Query the data via the API and don't forget to cache the results, else you will eventually exceed your GA quota. After that it's just a matter of matching product ids on your product pages to the related product id with the highest correlation scores in the cached results.

Filters iTunes App Customer Reviews - Web service

Objective:
To get customer reviews of app from iTunes and filters like Most Helpful, Most Recent on reviews.
Supported Method By Apple:
Apple provides an "App Reviews" web service to get customer reviews per app.
API: http://itunes.apple.com/rss/customerreviews/id=400274934/xml
Problem:
This web service provides all customer reviews on a particular AppID, but I want reviews which are Most Helpful or Most Recent, the way iTunes provides.
I web-searched to see if results for a particular app could be presented in a different order. I couldn't find that they could, so imagine you should download this programmatically:
http://itunes.apple.com/rss/customerreviews/id=400274934/sortby=mostrecent/page=1/xml
From there, download /feed/link[#rel="last"] using XPath in your XML reader. Parse out the page number, which appears to be one more than the last page. In this case, the last page is 13, so you should read pages 1 through to 12 and insert the data into a database. You can then apply your own sort as you see fit.
I noticed that 'xml' can be replaced with 'json' if that's easier for you to consume.
An easier solution may be available if you can find other valid values for 'sortby', but my guessing others (like 'rating') returned an empty document.
Hmm, a re-read of your question makes me think you just want votes for all applications. If so, you can generate a custom RSS feed here:
http://itunes.apple.com/rss/customerreviews/

Amazon MWS PHP-API Access and Print Out Packing List

How do I use Amazon MWS with PHP to access and print out packing lists? What is the process, and if possible what are the steps? Examples would be helpful.
Because you're talking about MWS and "packing lists", I assume the following to be true:
You are an Amazon Seller
You are sending out packages yourself (MFN / merchant fulfillment), and not using AFN / FBA (Fulfillment by Amazon)
To create packing lists, you will roughly have to do the following:
Fetch the "OrderReport" from the Amazon MWS Servers. The returned XML will contain details for your all outstanding orders including: shipping address, quantities, SKUs and product names.
Confirm the reception of those orders through the "OrderAcknowledgment" API call
Use above data to create pretty HTML files, images, PDF files or whatever else that can be printed as packing lists
While you're at it, you may want to look at the "OrderFulfillment" call. This lets Amazon know that you've actually shipped.
The sample PHP code you linked should help you with steps 1 and 2.
(for future reference: sample client code in PHP,C# and Java is available at https://developer.amazonservices.com/ . Follow the API documentation links to get current versions)
I am a little confused by your question because of the use of packing lists.
Amazon makes labels available, but the labels are used to differentiate between multiple sellers of the same SKU, and is not a packing list in and of itself. Amazon generates their own packing list when an order is placed for AFN orders, and MFN orders are send to you for processing via your own process.
However, assuming you are looking for the Amazon labels I took a quick look through all the API's and did not see any information on printing them. As far as I know this is only available through seller central, however if any API does that functionality it would be the feeds API.
I would suggest creating an account on https://sellercentral.amazon.com/forums/forum.jspa?forumID=35 and asking the folks there - several Amazon Employee's monitor that forum and Oneida Books is the resident guru and can pretty much answer anything API related.

Instant UPS tracking Number

I have a client that has a shopping cart. She wants to implement a module that allows the end user to receive a tracking number immediately after purchase.
I am not too sure if this is possible. My concept is that after the store owner ships the purchase, that's when the store owner receives a tracking number that he/she can give to the purchaser. And the purchaser then can start tracking their package.
I guess my question is... "Is it possible to generate a tracking number to give to the purchaser before the store owner even bothers to wrap up the order and send it out.This is so the purchaser can automatically start tracking their purchase and the store owner doesn't have to manually give them a tracking number." ?
I know this would have to require the api. I just need to know if this is possible before I start investing alot of time in trying to build it.
She is using Magento for her shopping cart service.
You can use what's called a tracking reference.
From UPS:
When you create a shipment, you can
assign a shipment reference that helps
you track quickly and with ease. This
reference can contain up to 35
characters in any combination of
letters and numbers
http://www.ups.com/content/us/en/resources/track/check/#Track+by+Reference
UPS will store this reference number in its system so that you can have customers track with that instead. They will need to click Track By Reference in the Track Packages & Freight tab.
It's "possible" in that way that everything in software is possible. There's nothing built-in or third party that I know of that would build this functionality into a system though. My experience with the UPS shipping API says that even if you created a UPS shipment at the time of ordering, there's a non-deterministic delay before the actual shipping code is created. See mention of tracking reference in this thread.
If you want to move forward with this, it means creating your own tracking system. Immediately after generating an order you also generate a unique tracking number, and a tracking URL. This URL points at your system, and returns a page that lists ou;t any UPS, FedEX, etc tracking numbers that are in the system for that order. If the order hasn't received its number yet, you list a message like "at source warehouse" instead.
Good luck, ERP and fulfillment integration is always a bear.
As far as i think Magento has built-in support for such tracking services.
Dont remember if it supports UPS but i guess it does.
Otherwise use the UPS Developer API and play around with their web services.
And for the advance tracking number as you require that feature is also implemented in Magento for shipping packages as well as order tracking etc...
PS: I observed these in Magento 1.4+
You can get bundles of shipping forms with fields such as your business name, address, account etc that are prefilled. These bundles also have sequenced tracking numbers.
You would have to get these bundles and upon receiving them enter the starting number and ending number of the stack into a database. From there the person packing the order must be careful to use the correct form with the order.
If you interface with ShipWorks and set it up with your UPS account, it both creates your UPS shipping label, gets the shipping charge and posts the UPS tracking number back to Magento. Very smooth integration.

Categories