Technical reference for the Point of Sale API Mobile Web.
To initiate a transaction from your website, you supply a specially crafted link or button similar to the following to direct the user to the Square Point of Sale application.
The following example starts a $1 USD transaction:
Notice that a list of key-value pairs is delimited with a semicolon and wrapped by special Android start and end tokens (
end) and is embedded in the target URL.
For step-by-step guidance opening the Point of Sale application from your mobile web application, see Build on Mobile Web.
If successful, the Android Point of Sale application returns to your callback URL with the same parameters set in your URL. The parameters contains information about the completed transaction.
Android results are returned as query parameter values with the form
If a Point of Sale API transaction fails for any reason, the Square Point of Sale application returns an error code as the value of the
com.squareup.pos.ERROR_CODE query parameter in the response.
Android error codes are returned as query parameter values with the form
To initiate a Square Point of Sale transaction from your website, you open a URL with a single query parameter called
data parameter is a percent-encoded JSON object that contains the information that Square Point of Sale needs to process the transaction request.
For step-by step-guidance opening the Point of Sale application from your mobile web application, see Build on Mobile Web.
You can specify additional payment options by adding the
option field to your
After the Square Point of Sale application finishes processing a transaction (or encounters an error), it switches back to your application using the
callback_url you provided in the original request.
Depending on the result of the transaction, the
data object includes some or all of the following fields:
If an error occurs during a Point of Sale API transaction, the
error_code field of the JSON object returned to your application has one of the following values: