FROM CACHE - en_header

How to call API in shopify pos

62 0 7

We become indebted to.

I'm developing a shopify POS app (tile) and have a question about how to call the API.

Development language: react
App proxy settings: Subpath prefix = apps, subpath = testapi, proxy URL = domain of the app you are developing

I am trying to fetch the API using the App proxy and call the Discount API at the communication destination.
I fetched it, but an error occurred.

The iMac console error is:
XXXXXXXXXX Shopify POS Type: Error Timestamp: Fri, 05 Feb 2021 03:10:45 GMT Message: Error: Optional Params: [{}]

The source is here.

	testDiscount() {
		// app proxy API test
		const url = '';
		.then(res => res.json())
		.then((data) => {
		.catch(e => {
			console.error('Error: ', e);

There was no log left on the app's server, so I suspect there's a problem with the url, but the iMac console doesn't show the details of the error.
In addition, the API to be called above could be called by fetch with javascript on the storefront cart screen.

Is there any other way to call the API from shopify POS?
I would appreciate it if you could teach me.

Replies 0 (0)