StableOps Python SDK
StableOps turns on-chain stablecoin transfers into familiar payment primitives: payment orders, deterministic status transitions, signed webhooks, retries, and confirmation tracking. StableOps watches supported chains, matches transfers, tracks confirmations, checks reorgs, and delivers webhook events to your app.
This SDK is for server-side Python applications that create payment orders and checkout sessions, manage merchant subscriptions, refunds, payment links, webhooks and agent audit resources, and verify webhook signatures.
Features
- Type-safe client (Pydantic v2 models) for payment orders, checkout sessions, merchant subscriptions, refunds, payment links, and webhooks.
- Sync (
StableOps) and async (AsyncStableOps) clients with an identical API. - Conservative retries for reads plus explicitly idempotent payment-order and checkout-session creation; other writes are never retried automatically.
- Constant-time webhook signature verification.
Requirements
- Python 3.8 or newer.
- A StableOps API key.
- A server-side environment. Do not expose your API key in browser code.
Installation
pip install stableops
Quick Start
import os
from datetime import datetime, timedelta, timezone
from stableops import StableOps
client = StableOps(api_key=os.environ["STABLEOPS_API_KEY"])
order = client.payment_orders.create(
merchant_order_id="order_123",
amount="49.00",
accepted_assets=[
{"chain": "base-sepolia", "asset": "USDC"},
{"chain": "tron-nile", "asset": "USDT"},
],
expires_at=(datetime.now(timezone.utc) + timedelta(minutes=25)).isoformat(),
)
print(order.payment_instructions)
The environment (sandbox / live) is determined by the API key prefix
(sk_sandbox_… / sk_live_…). Return only the order id, amount, and
payment_instructions to your frontend; the API key stays on your server.
Refunds and payment links
Both sync and async clients expose refunds and payment_links. Refunds support
creation, retrieval, pagination, transaction submission, and cancellation.
Payment links support creation, pagination, updates, and associated-order queries.
from stableops import AcceptedAssetInput, CreatePaymentLinkInput, UpdatePaymentLinkInput
refund = client.refunds.create(
payment_order_id="po_123", amount="5.00",
destination_address="0x0000000000000000000000000000000000000001",
)
# Sign and broadcast with your own wallet, then register the transaction hash.
client.refunds.submit(refund.id, tx_hash=merchant_signed_transaction_hash)
link = client.payment_links.create(CreatePaymentLinkInput(
title="Pro plan", amount="49.00",
accepted_assets=[AcceptedAssetInput(chain="base-sepolia", asset="USDC")],
payer_fields=["email", "reference"],
))
client.payment_links.update(link.id, UpdatePaymentLinkInput(description=None))
page = client.payment_links.orders(link.id, limit=20)
list_page() returns items, has_more, and total. Updates send only explicitly
provided fields. None clears nullable fields. Refund requests do not move funds,
and writes to these new resources are not retried automatically.
Webhooks support payment, refund, subscription, invoice, agent audit, and Agent
Payments events. The package includes py.typed for installed-package type checking.
Documentation
For complete guides, configuration, checkout sessions, webhook verification, and the full API reference, see the official documentation:
- English docs: https://stableops.dev/en/docs/sdk/python-api-sdk
- Chinese docs: https://stableops.dev/zh/docs/sdk/python-api-sdk
Supported Chains and Assets
- Chains: Ethereum, Base, Arbitrum, Polygon, Optimism, BSC, TRON, Solana, and supported testnets.
- Assets: USDC and USDT.
License
This SDK is licensed under Apache-2.0. See LICENSE.
Metadata
Release files for stableops 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stableops-1.1.0.tar.gz | 43.1 kB | With provenance | Details for stableops-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stableops-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for stableops-1.1.0-py3-none-any.whl |
Total release size: 78.0 kB
Release files / stableops-1.1.0.tar.gz
| Download URL | stableops-1.1.0.tar.gz |
|---|---|
| Size | 43.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a243bb68126e10c36fdb25b8fd3318672709ab6e7369d4128f34dc04029f018
|
|
BLAKE2b-256 checksum How to use checksums |
63f2831590887bad6f00fcb388edb896cef663cb3dddb5eea4814d088c13fc69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.
Transparency logRelease files / stableops-1.1.0-py3-none-any.whl
| Download URL | stableops-1.1.0-py3-none-any.whl |
|---|---|
| Size | 34.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
646f7764eda9e34e244f38796d169d2368148d43a489b119b09b44b939d91d76
|
|
BLAKE2b-256 checksum How to use checksums |
43130a80678f2911b9d3576caab2be4d66bb7ad5b5dfae6514a7232ff9222195
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.
Transparency logSecurity for stableops 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for stableops-1.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.