Introduction
The Square Go SDK provides a comprehensive set of API clients for interacting with Square’s various services. The SDK is organized into domain-specific clients, each handling a particular aspect of the Square platform.Client Architecture
The SDK uses a modular architecture where the mainClient type provides access to all resource-specific clients. Each resource client is responsible for operations related to a specific Square API domain.
Main Client
The rootClient type serves as the entry point to all Square APIs:
Available API Clients
The SDK provides clients for the following Square APIs:Payments & Transactions
Payments
Process payments and manage payment methods
Refunds
Handle payment refunds and cancellations
Checkout
Create online checkout experiences
Terminal
Manage in-person terminal transactions
Customer Management
Customers
Manage customer profiles and data
Cards
Handle customer payment cards
Loyalty
Administer loyalty programs and rewards
Gift Cards
Manage gift card operations
Business Operations
Catalog
Manage products, items, and variations
Inventory
Track and manage inventory levels
Orders
Create and manage orders
Invoices
Generate and send invoices
Business Resources
Locations
Manage business locations
Merchants
Access merchant information
Team Members
Manage staff and permissions
Labor
Handle employee scheduling and timekeeping
Financial Operations
Bank Accounts
Manage linked bank accounts
Payouts
Track settlement payouts
Disputes
Handle payment disputes and chargebacks
Cash Drawers
Manage cash drawer operations
Additional Services
Bookings
Manage appointments and bookings
Subscriptions
Handle recurring subscription billing
Sites
Manage Square Online sites
Webhooks
Configure webhook subscriptions
Integration & Tools
OAuth
Handle OAuth authentication flows
Events
Subscribe to Square events
Devices
Manage device codes and hardware
Snippets
Embed Square functionality in websites
Client Organization
All clients follow a consistent pattern:- Initialization: Each client is automatically initialized when you create the main
Client - Methods: Clients expose methods corresponding to Square API endpoints
- Context Support: All methods accept a
context.Contextfor cancellation and timeouts - Options: Methods accept optional
RequestOptionparameters for customization - Raw Response: Each client includes a
WithRawResponsevariant for accessing full HTTP responses
Example Usage
Error Handling
All client methods return standard Go errors. The SDK includes error types for common failure scenarios:Pagination
Many list operations return paginated results using thecore.Page type:
Next Steps
Client Configuration
Learn how to initialize and configure the main client
Authentication
Set up authentication for your application
Request Options
Customize individual requests
Error Handling
Handle errors and edge cases
