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

**URL:** <https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412>\
**Category:** Questions\
**Tags:** point-of-sale-api\
**Created:** [August 22, 2024, 5:40am UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412 "2024-08-22T05:40:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmaccou](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mmaccou](https://developer.squareup.com/forums/u/mmaccou)\
**Post date:** [August 22, 2024, 5:40am UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/1 "2024-08-22T05:40:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 22, 2024, 4:02pm UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/2 "2024-08-22T16:02:01Z")

</div>

Before you call the URL are you properly encoding it? 🙂

---

<div class="post-metadata">

**Author:** ![mmaccou](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mmaccou](https://developer.squareup.com/forums/u/mmaccou)\
**Post date:** [August 22, 2024, 4:15pm UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/3 "2024-08-22T16:15:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 22, 2024, 4:43pm UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/4 "2024-08-22T16:43:02Z")

</div>

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

```auto
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? 🙂

---

<div class="post-metadata">

**Author:** ![mmaccou](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mmaccou](https://developer.squareup.com/forums/u/mmaccou)\
**Post date:** [August 22, 2024, 5:17pm UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/5 "2024-08-22T17:17:02Z")

</div>

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.

 ![IMG_5200](https://global.discourse-cdn.com/square/original/2X/3/30e889a2978b76257d5ddb7392b8879760a2f2d0.jpeg)

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`

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 22, 2024, 5:20pm UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/6 "2024-08-22T17:20:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mmaccou](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mmaccou](https://developer.squareup.com/forums/u/mmaccou)\
**Post date:** [August 22, 2024, 5:29pm UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/7 "2024-08-22T17:29:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mmaccou](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mmaccou](https://developer.squareup.com/forums/u/mmaccou)\
**Post date:** [August 22, 2024, 5:30pm UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/8 "2024-08-22T17:30:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mmaccou](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mmaccou](https://developer.squareup.com/forums/u/mmaccou)\
**Post date:** [August 22, 2024, 5:37pm UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/9 "2024-08-22T17:37:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 22, 2024, 8:16pm UTC](https://developer.squareup.com/forums/t/error-when-using-pos-api-for-web-to-trigger-tap-to-pay-safari-cannot-open-the-page-because-the-address-is-invalid/18412/10 "2024-08-22T20:16:32Z")

</div>

Glad to hear that it’s working as expected. 🙂
