Skip to main content

PyPi Package Version Supported Python versions PyPi downloads

pyXRocketAPI

pyXRocketAPI is a Python client for the xRocket Pay API. It supports application information, balances, invoices, cheques, payouts, withdrawals, currency rates, and health checks.

Installation

pip install pyXRocketAPI

Quick start

from pyXRocketAPI import xRocketPayAPI

client = xRocketPayAPI(token="your-pay-api-token")
invoice = client.create_invoice(price_currency="USDT", price_amount="10.00")
print(invoice.id, invoice.links.web_link)

For integration testing, use the xRocket testnet instead of production:

client = xRocketPayAPI(token="testnet-token", testnet=True)

Nested request models

Known nested API objects are passed as model instances, not dictionaries. The same models deserialize API responses and implement to_dict() for request bodies.

from pyXRocketAPI import InvoiceCallback, InvoiceCustomer, InvoiceUrl, xRocketPayAPI

client = xRocketPayAPI(token="your-pay-api-token")
invoice = client.create_invoice(
    price_currency="USDT",
    price_amount="10.00",
    callback=InvoiceCallback(
        callbackUrl="https://example.com/webhooks/invoice",
        payload={"order_id": "123"},
    ),
    url=InvoiceUrl(
        successUrl="https://example.com/success",
        cancelUrl="https://example.com/cancel",
    ),
    customer=InvoiceCustomer(
        id="customer-123",
        email="customer@example.com",
        telegramId="123456789",
    ),
    data={"internal_order_id": "123"},
)

payload and data remain ordinary dictionaries because xRocket defines them as arbitrary JSON objects without a fixed schema. Use MassPayout instances for every item passed to create_mass_payouts().

Safety

The token grants access to the application and must not be committed to source control. Financial POST operations are not retried automatically. Supply and retain the relevant client identifier (client_invoice_id, client_payout_id, client_cheque_id, or client_withdrawal_id) so that a timed-out operation can be reconciled safely.

Errors from the API raise xRocketAPIException; its problem_type, kind, status, and instance attributes expose the RFC 9457 error response.

AI-supported creation.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxrocketapi-0.3.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxrocketapi-0.3.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file pyxrocketapi-0.3.0.tar.gz.

File metadata

  • Download URL: pyxrocketapi-0.3.0.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.0

File hashes

Hashes for pyxrocketapi-0.3.0.tar.gz
Algorithm Hash digest
SHA256 250c7ccac074dcc10d5ee49cf63e51a367f40a1d999975ded599c0628cc6e4cc
MD5 e1d03cea4d3178b8c8402d6a0ba10a91
BLAKE2b-256 a6b55dad14ece945a6aaca372c85372730acc76b9285247c6d49cb9411f62cc7

See more details on using hashes here.

File details

Details for the file pyxrocketapi-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyxrocketapi-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.0

File hashes

Hashes for pyxrocketapi-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e08964519fd267248ae81f15cc97719986256110823ea6ad7c63e8e625f39f7
MD5 3cbef831c4e976408b45ab9b125c9e29
BLAKE2b-256 f412a2b2f47eb304822180cab00808b6bd7784896f84377b8096317fd1571029

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.0

2 files

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