Is there any way to get the product name from UPC/EAN barcode scanned from Google API?
There is no general registry of UPC product codes. You can find a list of the country codes at the beginning of the number easily, and with some legwork possibly get the national organization for a few countries that you're particularly interested in to give you a list of their secondary allocations.
But in order to get all the way down to "Banana chips, bag of 200 g, reduced trans fat formulation, Danish/Swedish/Finnish text on packaging" there's only the particular manufacturer to ask. That, or own a supermarket and register the UPC numbers of new items when you start stocking them.
Allegedly the gtin field holds the UPC/EAN code, if you restrict the search to values in that field you should only get responses where the gtin matches your barcode.
For example if you scanned your barcode and got an EAN-8 code of 05001234 then in the query string of your API call you could set
https://www.google.com/search&q=05001234&restrictBy=gtin=05001234
I have often seen multiple products returned for a single code so I guess the UPC/EAN are not globally unique or some providers have not been uploading their products under the right code.
In the response from Google are fields which hold the product title and description, you just need to parse the JSON or ATOM response.
I found another API https://market.mashape.com/mignify/gtin2product. It's pretty good. You can get products information from UPC/EAN/GTIN. It can return products description in different language.
You can use Rapid API https://rapidapi.com/search/ean. Here you get lot of API like Amazon API, Google Shopping, Barcode Lookup
Related
I've just spent a long time reading documentation about the Google API Places, and there's some information I don't quite understand.
I need to build an application that can record a travel plan for a user, so a sequence of places.
For this, I need a very simple form, with a "destination" input, which will use "Autocomplete Places".
This endpoint return a place_id for the selected location, which is the only thing I'm allowed to store in a database, according to Google's terms and conditions.
So in my idea, I'll store this id, and a itinerary would be made of a sequence of place_id, without the need to store the place name or anything else. To display the user's itinerary, I'd just have to make Place Details queries, with the identifier.
But the documentation specifies that these ids can change over time, so they advise to redo queries "periodically" to refresh the place_id.
But how can I redo queries if I haven't stored any information about the place, other than the place_id ? Do I need to store the name of the place (and do I have the right to do that?) to be able to retrieve its ID, or am I missing something?
Another thing: I didn't find, or didn't understand, in the terms of use, if I was allowed to store data generated by my site beside Google IDs, for example, to store comments about places.
Sorry if I make language mistakes, im not fluent in english.
Thanks !
I'm utilising google autocomplete to allow visitors to enter towns, suburbs or postcodes, so that they can select the right one from the autocomplete list. I then need to store the postcode for that location so that I can compare that postcode to entries in a database to find service providers in that postcode.
The problem I'm now having is that the Google API doesn't return postcodes for all locations. This especially seems to be the case for larger cities. For example, it doesn't return postcodes for Melbourne Australia, Sydney Australia or Perth Australia.
Has anyone developed a solution or workaround to this issue? Any suggestions?
I've been googling for ages now and can't find a solution. Google itself doesn't seem to mention this situation in their Google Places docs.
Since many cities span multiple postal codes, you probably need your users to provide the exact street address where they need service. Fearing the tedium of entering a full street address? Fear not; Place Autocomplete can save them many keystrokes especially if you constrain results to a specific country or location bounds.
You might want to create an address form and use Places Autocomplete to auto-fill the components including postal code once the user selects the address from autocomplete predictions. This section of the documentation demonstrates how it works and this page provides sample Javascript code for implementing an auto-completing address form.
I'm trying to create a report to pull my Square POS transaction data into Excel through Power Query. Basically, I want the information available in the standard "Items Detail CSV" report found in the Square Dashboard, but connected to Excel so I can build custom reporting and update it any time with a refresh.
I can connect to the Square data in Excel no problem. What I'm having trouble with is finding the right data, specifically the notes the merchant can enter in during the time of sale about the item. We have several items that will come up as "Custom Amount" where we enter additional notes about the item, and I can't find the notes field through the API.
After looking through the documentation, I've tried two main queries:
The Transactions List from v2:
https://connect.squareup.com/v2/locations/{location_id}/transactions
The Payments List from v1:
https://connect.squareup.com/v1/{location_id}/payments
The Payments List includes the v1PaymentItemization data type, which should include the notes field defined as "Notes entered by the merchant about the item at the time of payment, if any." I assume that's what I'm looking for.
(Link to documentation: https://docs.connect.squareup.com/api/connect/v1#type-v1paymentitemization)
However, I cannot find the notes field anywhere in my pulled results. There are no error messages, and I see every data field listed in the v1PaymentItemization documentation except "notes" in my query results.
Edit: The notes we're using are on individual items, not the payment as a whole. This fits the description of V1 List Payments -> PaymentItemization -> notes. I did check the tender notes as mentioned in the comments, but this was not what I'm looking for. Until now, I wasn't aware we could make a comment on the transaction as a whole, as opposed to individual items. The individual items notes would be more helpful anyway.
Either way, I didn't find the tender notes in the pulled data either. Most of the fields are there in the data pull, but not notes, v1TenderEntryMethod, and a couple of others. There's actually more data available in the standard dashboard reports than is actually pulling from the API.
I do realize a workaround is to export the Item Detail CSV report from the Square Dashboard, and then manipulate the data in Excel from there. I could even have a connection to the folder or file where I save my exports. It's just not as smooth as the desired result of opening Excel, setting my parameters there, and clicking refresh to get the data and formatted report all in one place.
Thanks
Second Edit: In the POS, I'm entering an amount which shows up as Custom Amount in the itemized list for the sale. I then click on the Custom Amount to add a note to it and specify what the item is (e.g., "Lamp"). That note is applied to a single item, and there may be several items per transaction that have these notes added to them which would otherwise only show as "Custom Amount" on a report or receipt. We do this because we sell several items that are not standard inventory items, but we do want to keep track of what we've sold.
I can see these notes for each item in the standard reporting, so I know the data is entered and saved correctly. However, I can't find the note field when I pull from the API. I see all of the other itemization fields (i.e., name, quantity, item_detail, itemization_type, etc.), but not the note field.
I'm getting these results with a simple /v1/payments pull with no parameters or filters.
I have customers from many countries, and for each one I need to generate a page with data on it.
In my report I have a similar query: SELECT Name, Address, CodLanguage ... FROM Customers
For each record of this query, I want to generate a page in Jasper Reports with customer data in their respective language (I know its language through this flag CodLanguage).
I want change report language for each customer page (each record). Can i do this using report parameter locale? Or changing some variable for each record? Has anyone had a similar situation? Have any idea what can be done?
Example
I need translate the labels: Name, Address, City, Phone Number and Country in 10 different languages, according to the customer's country language.
This example is only a simplification. I will generate between 3 and 6 report pages for each customer, with many other data.
Thanks!
As far as I can tell, this is not possible using any of the standard resource references:
$R{resource.bundle.property}
msg() function
str() function
For each record, supply the corresponding locale (or determine it based on other data, like the country and city -- chances are Quebec, Canada would be French [fr_CA] while Toronto, Canada would be English [en_CA]).
Once there's a map of locales to locations, use a ResourceBundle (or MessageFormat?) to translate the key for a particular label.
Create a number of resource bundle files with translations for the various labels. The file names must have a suffix that corresponds to the predetermined locale (e.g., Bundle_fr_CA.properties).
Change the label from static text to an expression. The expression instantiates a new resource bundle to look up the key (e.g., "city.name") for its translated value, such as:
ResourceBundle.getBundle("Bundle", new Locale("en", $F{country})).getString("city.name")
How the "en" is determined will be a bit of a chore, unless you can alter the database to get the user's language preferences. This means you'll also have to create a resource bundle for every language/country combination, which can be automated.
I am working on an install of AspDotNetStoreFront (version 9.3.1.0). Currently, the company stores their own SKU's from their business system in the provided SKU field. They often use Manufacturer Part Number to store their vendors part number.
Example:
The above example is a variant of a product where we would like to store UPC information.
I searched the AspDotNetStoreFront manuals and could not find a recommended strategy for storing UPC codes. Its easy enough to add a field to the database and bulk import the data, however, an admin needs to be able to maintain them from within the stores user interface.
Is there a way to add a UPC field without modifying core ASPDNSF code and still allow users to maintain it from within the UI? Or do I have to use the SKU or MPN fields?
Update
I do see that there are 5 fields for "ExtensionData" that I could possibly use, but I don't see those fields as editable for Variants in the UI the way ExtensionData is for the Products themselves.
I don't think we have had customers who didn't use sku for their UPC code. In the event that you need to modify the table by adding another column, you can modify the admin to show this.
You should be ab able to edit entityEditProducts.aspx and entityEditProducts.aspx.cs to edit this in the admin area. You will just need to modify the sql scripts and the view.
I'm not sure if it's important enough for you to upgrade over, but version 9.4 added fields for UPC. From the 9.4 release notes (http://partners.vortx.com/t-summer2013releasenotes.aspx):
"Added new GTIN field to the product variant information for unique product identification. This new field holds up to 14 characters and can be used for EAN, UPC, ISBN, etc. This new field is included in WSI, Excel & XML Imports, and supported by DotFeed."
The GTIN field works for both variant and size/color.
you can use one of the 5 extension field given by default in the product table to store UPC code. By default it has also UI in edit product under Extension Data tab.