Frontend and Backend Development

Learn how Square APIs and SDKs are used in frontend and backend development.

Link to section

Overview

A typical application has a frontend client and a backend server:

  • Frontend - Provides a UI that displays information, receives user input (using buttons, menus, and other UI elements), and interacts with the application backend. A frontend is typically built using technologies such as HTML, CSS, and JavaScript for web applications and Objective-C, Swift, Java, or Kotlin for iOS and Android applications. Modern web applications often use frameworks like React, Angular, or Vue.js that improve efficiency.
  • Backend - Receives and processes user input sent from the frontend, pulls the necessary data from internal and external sources, and sends the data back to the frontend. The backend is typically built using server-side languages and frameworks such as PHP, Java, Node.js, or Python.

Square provides payment APIs and SDKs that support payment processing activities from the frontend and backend.

Link to section

Frontend

A payment-processing flow usually starts with a buyer providing payment information in the application frontend (for example, entering card information in text boxes).

Application frontends can use client-side payment APIs and SDKs for payment processing activities. These libraries provide UI elements used to collect payment information for online payments or payments on Square hardware.

For online payments, the following client-side libraries are used with backend calls to the Payments API:

The application frontend uses the SDK to generate a secure payment token (and buyer verification token) from information provided by the buyer. The application backend calls CreatePayment using the payment token as the source_id.

To learn about all options for processing online payments, see Online Payment Solutions.

Link to section

Backend

Square APIs integrate with backend development. Typically, the application backend sends API requests to Square and processes the responses. Application backends can call Square APIs directly using any programming language or use a Square SDK in a supported programming language.

Many Square APIs integrate with other Square APIs for basic or extended functionality. For example, many operations require a location ID that can be retrieved using the Merchants API or Locations API.

The following are some commonly used Square APIs:

  • Payments API - Process payments using payment tokens (generated by the client-side Web Payments SDK and In-App Payments SDK) or credit card, debit card, and gift card IDs (retrieved using the Customers API, Cards API, and Gift Cards API).

  • Orders API - Create and manage orders. Specify the order ID on a payment to link itemization details to the payment. The Orders API provides close integration with the Catalog API, Inventory API, and other Square APIs.

  • Customers API - Create, retrieve, and manage customer data. Specify the customer ID on orders and payments for improved auditing and reporting integration.

  • Subscriptions API - Provide subscription services to buyers. Subscription plans are designed using the Catalog API. Subscriptions are created using a customer ID and location ID.

Link to section

See also