Skip to main content

StableOps Python SDK

PyPI version PyPI downloads License Python

中文文档

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.

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:

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.1

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

Source distribution (sdist)

Source distribution for stableops 1.1.1
File Size Uploaded Provenance Actions
stableops-1.1.1.tar.gz 43.2 kB With provenance Details for stableops-1.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 78.2 kB

Release files / stableops-1.1.1.tar.gz

Download URL stableops-1.1.1.tar.gz
Size 43.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f2259bc28ba340880b0e023a8f2a016da4d1487b7fd7d54724ba91cafeff6eed
BLAKE2b-256 checksum
How to use checksums
86db6b430e0ed242093ea9ecada1705dc71d769d2a485718c312302cfbc62a76
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 Nov 2, 2026.

Transparency log

Release files / stableops-1.1.1-py3-none-any.whl

Download URL stableops-1.1.1-py3-none-any.whl
Size 35.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edaf6d6c1565ec951a5332329bdecfa3de6d7e53f28306ad772fabfc10395f41
BLAKE2b-256 checksum
How to use checksums
9d6d3f9152ae783cd31d87086cf850a46c0682bfbd5a8aec3f6193cdeeea4164
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 Nov 2, 2026.

Transparency log

Security for stableops 1.1.1

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.

Select from 2 files

Attestation for stableops-1.1.1.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 Nov 2, 2026.

Transparency log

A 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.

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