Registry / payments / squareup

squareup

JSON →
library45.1.0.20260819pypypi✓ verified 25d ago

Official Square payments Python SDK. Current version: 44.0.1 (Mar 2026). VERSIONING QUIRK: squareup uses date-based versions (44.0.1.20260122) — major version tracks Square API version. Releases every ~4-6 weeks. Install is 'squareup', import is 'square'. Square uses idempotency_key for all payment creation — required, not optional. Amount in smallest currency unit (cents for USD). Test environment uses sandbox credentials with 'sandbox-' prefix.

pip install squareup
INSTALL
IMPORT
SIG · SQUAREUP
S
squareup
paymentspythonv45.1.0.20260819
Install
5.9s avg
Import
753ms
Disk
60MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v45.1.0.20260819 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.782s · 61.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.9s · import 0.724s · 61MB
60MB installed
● package 60MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AsyncSquare
from square import AsyncSquare
from square import Client
Square
from square import Square
from square import Client

Square Python SDK — create payment with test nonce.

# pip install squareup import square import uuid client = square.Client( access_token='EAAAl...', # sandbox token from developer.squareup.com environment='sandbox' ) # Create payment result = client.payments.create_payment({ 'source_id': 'cnon:card-nonce-ok', # test nonce 'idempotency_key': str(uuid.uuid4()), 'amount_money': { 'amount': 100, # cents 'currency': 'USD' }, 'note': 'Test payment' }) if result.is_success(): payment = result.body['payment'] print(f'Payment {payment["id"]}: {payment["status"]}') elif result.is_error(): for error in result.errors: print(f'Error {error["code"]}: {error["detail"]}')
Debug
Known issues
breakingInstall is 'squareup' but import is 'import square'. Common confusion — installing 'square' installs a different package.
fix
pip install squareup; then import square
affects: all
breakingidempotency_key is required for payments.create_payment(). Omitting it raises a validation error. Must be unique per payment attempt.
fix
'idempotency_key': str(uuid.uuid4())
affects: all
breakingAmount is in smallest currency unit — cents for USD. 100 = $1.00. Passing 1.00 as float or passing dollars will result in undercharging.
fix
amount_in_cents = int(amount_in_dollars * 100)
affects: all
gotcharesult.is_success() and result.is_error() are METHODS not properties. Calling result.is_success without () always returns truthy.
fix
if result.is_success(): — not if result.is_success:
affects: all
gotchaVersion numbering is date-based (44.0.1.20260122). Major version tracks Square API version. Pin carefully — minor releases can add breaking API changes.
fix
Check Square changelog before upgrading: developer.squareup.com/docs/changelog
affects: all
gotchaSandbox uses test card nonces from Square docs. Production uses nonces from Square Web Payments SDK on frontend. Never pass real card numbers as source_id.
fix
Sandbox test nonce: 'cnon:card-nonce-ok'. Production: collect via Square Web Payments JS SDK.
affects: all
Upgrade
Version history
45.1.0.20260819latest on PyPI · released Aug 18, 2026
Audit
Dependencies
requestsrequiredRequired. Installed automatically.
Agent activity
36 hits · last 30 days
node
32
OpenAI (training)
1
Resources
squareup — pip install squareup · libregistry