Unable to create payment via Mobile Web

Hello! Writing in regards to some unhelpful errors that are being received when attempting to create an integration between Salesforce and Square.

I am attempting to deeplink to Square via the iOS app, and am getting an unspecified JSON error from the Square app upon attempt to open.

Here is the un-encoded JSON that I am attempting to pass through:

{amount_money: {amount: "500", currency_code: "USD" }, callback_url: "CALLBACK_URL", client_id: "CLIENT_ID", location_id: "LOCATION_ID", version: "1.3", notes: "New Work Order", options: { supported_tender_types: ["CREDIT_CARD"]}}'

While attempting to debug, I have appended the encoded JSON string to the end of the www.connect.squareupsandbox.com URL to see if the JSON string is formatted correctly. Unfortunately, I am getting a similarly unhelpful error, as the UI shows an “Oops! We’re sorry, but something went wrong” screen and the console shows the failing line of code with a comment of “// this fails for some browsers. :(”

I have verified that everything is encoded properly, and no miscellaneous characters are being cut off.

Any assistance is appreciated.

I have continued investigating this issue and am receiving the following error in the browser console:

Any assistance is appreciated.

Further updates, I have verified by comparing my stringified and encoded JSON structure to the structure listed on this blog, and I am still getting the following API error in iOS: “The JSON passed in the request is invalid. Check that your JSON string is URL-encoded and the JSON is correctly formatted.”

:wave: Currently with Square mobile web and all in person payment solutions need to be tested in production. They aren’t currently supported in sandbox. Also that un-encoded JSON does look correct. Could you provide the encoded string so we can take a look? Also what’s you application ID? :slightly_smiling_face:

Sure, thank you!

This is the deeplink we are attempting to use:


with our test org Id being: sq0idp-RsbpdgUuHgArthzh6i8dmw

There is currently conflicting information in the documentation as to whether the money object should have a value for currency or currency_code, so any assistance there would be appreciated as well.

Sorry for the barrage of comments, one other piece of information that might be helpful: this account is not activated, but I have tried substituting an active account (sq0idp-jBftfDD2RvuvyPS7H0hMQg) to no avail.

That’s probably the issue. Card processing needs to be enabled. What issues are you running into?

I have attempted this with an org that has card processing enabled to no avail. The issue is that I am getting an error on the JSON:

API ERROR - The JSON passed in the request is invalid. Check that your JSON string is URL-encoded and the JSON is correctly formatted.

It doesn’t tell me how the JSON is incorrectly formatted.

Good morning, just an update on this:

While attempting to test this functionality this morning, our deep-link is no longer working. Currently getting an error that Square is not installed. To resolve this, we attempted to update the Square application on iOS to no avail.

So the Square app didn’t update on the device?

The square app did update on the device, but now the deeplink is not working at all - we were previously getting an invalid JSON error, but now are getting an error saying that the app is not installed.

It looks like the data that you’re passing in is in a single quote. If you try the following does it work?


Hello, I am using the tics per the documentation linked above, it does not work with or without the tics.

I am now receiving an error that the Square app will not open due to not being installed - has the deeplink changed?

Hi @evelyn.grizzle, I just sent you an email but in looking at the account is this the location_id your passing in: LBJ24DS5JMDK6. If so that’s a sandbox location_id and won’t work with Point of Sale API. Also is your testing taking place in the US with the account that has card processing enabled?

Yes, our testing is taking place in the US with the account that has card processing enabled. We have tried it with and without the sandbox Location_Id. Rather than guessing, I need to know the proper JSON fields to include, as there is conflicting information in the documentation, and I need to know the updated deeplink, as the given deeplink of square-commerce-v1://payment/create?data= is no longer working after the most recent Square update.

I just tested multiple times with the Point of Sale API using this link and it’s working as expected:


Is the application_id you’re using still this one? sq0idp-RsbpdgUuHgArthzh6i8dmw If so card processing still isn’t enabled with that account. If you’re using a different application could you provide the link that you’re currently getting the error with so the team can take a look? :slightly_smiling_face:

An update on this,

After working with Bryan in the Slack channel to determine the proper JSON structure for the string, it was determined that the appropriate structure is:


The issue with Salesforce is that when using an App Extension from Salesforce Field Service Lightning into the Square app, Salesforce automatically URL encodes any input, so we were URL encoding twice, which is what was causing the JSON error.

Hopefully this helps anyone trying to figure out the same issue.