Skip to main content

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_billing_square


Swarmauri Billing Square

The Swarmauri Billing Square package delivers a Square-backed billing provider that speaks the Swarmauri billing interfaces. It uses the official Square Python SDK to manage catalog items, hosted checkout links, card-not-present payments, subscriptions, and invoices.

Features

  • ✅ Turns Square catalog items and variations into Swarmauri product and price references.
  • ✅ Generates hosted checkout links through the Payments API Link service.
  • ✅ Supports payment intents, captures, and cancellations using Square's server APIs.
  • ✅ Manages subscriptions and invoices, including publishing and cancellation flows.
  • ✅ Surfaces marketplace fee splits and dispute listings for downstream automation.

Installation

pip install swarmauri_billing_square
uv add swarmauri_billing_square

Usage

from swarmauri_billing_square import SquareBillingProvider
from swarmauri_base.billing import CheckoutRequest, PriceSpec, ProductSpec

provider = SquareBillingProvider(
    access_token="sq0atp-...",
    location_id="L8899XYZ",
)

product = provider.create_product(
    ProductSpec(name="Digital Membership", description="Premium access"),
    idempotency_key="prod-square-001",
)

price = provider.create_price(
    product,
    PriceSpec(currency="USD", unit_amount_minor=2500, nickname="Monthly"),
    idempotency_key="price-square-001",
)

checkout = provider.create_checkout(
    price,
    CheckoutRequest(
        quantity=1,
        success_url="https://merchant.example/success",
        cancel_url="https://merchant.example/cancel",
        idempotency_key="checkout-square-001",
    ),
)

print(product.id, price.id, checkout.url)

Capability Mapping

Square capabilities advertised by this provider map to swarmauri_core.billing.Capability. Use capabilities_to_tigrbl to translate capabilities to the tigrbl billing vocabulary when required.

Contributing

Community improvements are welcome! Enhancements that broaden Square API coverage or harden error handling are greatly appreciated.

Metadata

Release files for swarmauri_billing_square 0.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swarmauri_billing_square 0.9.2
File Size Uploaded
swarmauri_billing_square-0.9.2.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_billing_square 0.9.2
File Interpreter ABI Platform
swarmauri_billing_square-0.9.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / swarmauri_billing_square-0.9.2.tar.gz

Download URL swarmauri_billing_square-0.9.2.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0c1cb58e428aef38ca8a1a538d2adef429c9a692b93230f03bd896901f6dc8d4
BLAKE2b-256 checksum
How to use checksums
ef838f305e7047e4fa5c8a501eb8af71bb8fbf512f433e36d9e95c688598851d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / swarmauri_billing_square-0.9.2-py3-none-any.whl

Download URL swarmauri_billing_square-0.9.2-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb4686679773553b57c5c3a935c2b34a78a7cbf4ce76a345592433b95ef6ac34
BLAKE2b-256 checksum
How to use checksums
6121677f1f072f0c4a78b2d91bbfd5fc9bb43a53e434d81f97fc010f2e667451
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page