Error when using POS API for Web to trigger tap-to-pay: "Safari cannot open the page because the address is invalid"

The goal is to open the POS app installed on my iPhone to allow the customer to use tap-to-pay, but I’m getting an error:

Safari cannot open the page because the address is invalid

The URL looks fine to me, but I must be missing something.

Here is the encoded version which is what I’m using:

square-commerce-v1://payment/create?data=%7B%22amount_money%22%3A%7B%22amount%22%3A%22500%22%2C%22currency_code%22%3A%22USD%22%7D%2C%22callback_url%22%3A%22CALLBACK_URL%22%2C%22client_id----%22%2C%22version%22%3A%221.3%22%2C%22notes%22%3A%22Thank%20you%20for%20your%20purchase!%22%2C%22options%22%3A%7B%22supported_tender_types%22%3A%5B%22CREDIT_CARD%22%2C%22CASH%22%2C%22OTHER%22%2C%22SQUARE_GIFT_CARD%22%2C%22CARD_ON_FILE%22%5D%7D%7D

Decoded:

square-commerce-v1://payment/create?data={"amount_money":{"amount":"500","currency_code":"USD"},"callback_url":"CALLBACK_URL","client_id":"PROD-CLIENT-ID","version":"1.3","notes":"Thank you for your purchase!","options":{"supported_tender_types":["CREDIT_CARD","CASH","OTHER","SQUARE_GIFT_CARD","CARD_ON_FILE"]}}

I’ve also made sure the callback URL is set in my dev dashboard under POS API settings. Am I missing something else?

Before you call the URL are you properly encoding it? :slightly_smiling_face:

Yea the encoded URL I shared is what I’m trying to navigate too. Thats the exact URL (except for the client id) that is logged

I just tested with what you provided and my credentials and it worked:

square-commerce-v1://payment/create?data=%7B%22amount_money%22%3A%7B%22amount%22%3A%22500%22%2C%22currency_code%22%3A%22USD%22%7D%2C%22callback_url%22%3A%22momoney-x-callback%22%2C%22client_id%22%3A%22sq0idp-K-i6--d9HD4fha58YpSS6w%22%2C%22version%22%3A%221.3%22%2C%22notes%22%3A%22Thank%20you%20for%20your%20purchase%21%22%2C%22options%22%3A%7B%22supported_tender_types%22%3A%5B%22CREDIT_CARD%22%2C%22CASH%22%2C%22OTHER%22%2C%22SQUARE_GIFT_CARD%22%2C%22CARD_ON_FILE%22%5D%7D%7D

Is the app opening up at all? Also I tested on Chrome. Have you tried another browser? :slightly_smiling_face:

There must be something obvious I’m missing. When I use my credentials and put the below URL in the Safari browser on my phone, I get the error below. I also get that error when I copy/paste your’s in Safari.

When I try chrome for yours or mine, It must also not recognize the URL because it attempts a google search instead of opening up my POS app. I have the Square for Retail app installed on this device. The version is 6.5. I tried playing with the version number in the URL too with no luck.

My URL:

square-commerce-v1://payment/create?data=%7B%22amount_money%22%3A%7B%22amount%22%3A%22500%22%2C%22currency_code%22%3A%22USD%22%7D%2C%22callback_url%22%3A%22https%3A%2F%2Fdev-goghpay-production.up.railway.app%2Fapi%2Fsquare%2Fpos%2Fcallback%22%2C%22client_id%22%3A%22sq0idp-<PLACEHOLDER>%22%2C%22version%22%3A%221.3%22%2C%22notes%22%3A%22Thank%20you%20for%20your%20purchase!%22%2C%22options%22%3A%7B%22supported_tender_types%22%3A%5B%22CREDIT_CARD%22%2C%22CASH%22%2C%22OTHER%22%2C%22SQUARE_GIFT_CARD%22%2C%22CARD_ON_FILE%22%5D%7D%7D

Oh, Point of Sale API is for the Square app. Not the Retail app. Do you have the Square app on the device? :slightly_smiling_face:

I had no idea there were two apps to take sales. What is the difference? Is all seller data such as customer directory, inventory, sales, order, etc all shared between them? So if I have my client merchant download the Square POS app instead of Square Retail, they shouldnt have any issues?

Ah by the way I tried in Safari and it worked after downloading the right square app, but in Chrome it still tried the Google search

@Bryan-Square I restarted my phone and this is working now in Chrome

Glad to hear that it’s working as expected. :slightly_smiling_face: