Take Online Payments with Square APIs and SDKs

Use Square payment APIs with custom solutions to accept payments online in the United States, Canada, Australia, the United Kingdom, and Japan. Connect, Square’s API suite, and the SqPaymentForm javascript library provide secure payment solutions for online.

Build a custom payment experience

Square payment form + Transactions API: Add our PCI-compliant payment form to your own checkout page and customize the layout and appearance of the form by using stylesheet classes and HTML. You can add a digital wallet that includes Apple Pay, Masterpass, and Google Pay buttons.

The payment form encodes the buyer's payment card information in a secure token that you send to your own server-side resource for payment processing. The payment is processed by the Transaction API charge endpoint. The secure token from the payment form is added to the charge request so that the Square payments processing server charges the correct payment card.

Diagram sqpaymentform basic
The Square payment form

To start taking payments, get a Square access token and then add a few blocks of code to your checkout page and a backend module that makes a call on the Square Transaction API.

See the Payment Form Setup Guide to learn about building a custom online payment solution. The guide includes code templates that start you off with a production quality payment form. No need to design your form from scratch.

Use a pre-built Square solution

Take payments with the Checkout API: We host the pre-built payment flow in our servers securely and handle any required certificates. We provide the checkout and payment confirmation pages but you have the option to create your own payment confirmation page in place of ours.

Just create an order item with our Checkout API , and post it to our servers in a Checkout API request that returns a unique checkout URL.

Use the checkout URL to navigate to the checkout page. We present the buyer with our checkout flow pre-populated with your order details and then handle the payment for you.

Checkout screen 01

After the buyer clicks the Place Order button, Square directs them to an order confirmation page.

Checkout screen 02

See the Checkout API Setup guide to learn about integrating with a pre-build payment solution.

Add a payments plug-in

Choose an online payments plug-in from the Square App Marketplace: If you do not want to write a lot of code, take payments with a plug-in solution built for the eCommerce application you use.

Go to the Square App Marketplace to find our list of partners and leverage proven online payments plug-in solutions from partners like WooCommerce, Wix, BigCommerce, and many others.

Get started building a payment solution

Build a custom online payment solution

Take payments securely on your website with full control of the checkout process using the Transactions API and Square payment form.

Integrate with a pre-built payment solution

Take payments securely on your website with Square's prebuilt eCommerce solution using the Checkout API.

Contact Developer Support, join our Slack channel, or ask for help on Stack Overflow