Skip to content

square-payments

Use when working with Square Payments, Orders, Checkout, Invoices, Subscriptions, or Refunds. Also use when implementing payment flows, creating checkout links, managing recurring billing, or handling refunds with the Square API.

ModelSource
sonnetpack: payments

Square API (version 2026-01-22) for accepting payments, managing orders, and building checkout experiences. Uses source tokens from Square Web Payments SDK client-side; processes payments server-side via Payments API.

Full Reference

┏━ 🔧 square-payments ━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when working with Square Payments, Orders,… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Square API (version 2026-01-22) for accepting payments, managing orders, and building checkout experiences. Uses source tokens from Square Web Payments SDK client-side; processes payments server-side via Payments API.

ItemValue
Current API Version2026-01-22
Base URLhttps://connect.squareup.com/v2
AuthBearer access token (EAAAl... for sandbox, EAAA... for prod)
Node.jsnpm install square (v40+)
Pythonpip install squareup (v42+)
Sandboxhttps://connect.squareupsandbox.com/v2

Load the specific file for the task at hand:

I want to…File
reference/auth-and-setup.mdToken types, scopes, client init, idempotency
reference/payments.mdPayment lifecycle, create, delayed capture, card-on-file, external
reference/orders.mdOrder lifecycle, create with line items/taxes/discounts, pay, search
reference/checkout.mdPayment links, quick pay, checkout options
reference/invoices.mdInvoice workflow, create + publish, payment request types, delivery methods
reference/subscriptions.mdSubscription model, cadences, create, free trials, pause/cancel
reference/refunds.mdRefund rules, partial and full refunds
reference/error-handling.mdError structure, common codes, handling patterns
reference/testing.mdSandbox setup, test nonces, test card numbers

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.