Skip to main content

plaxswap

The official Python client for the Plaxswap API.

  • Accept crypto payments on your site: create a payment, send the customer to the hosted checkout, and check the signed webhook. Docs: Crypto payment gateway API.
  • Payment links: ask for an exact amount of one coin; the payer can use any supported coin. See crypto payment links.
  • Swaps: quote routes from KyberSwap, 0x, LI.FI, Relay and NEAR Intents, best return first, with every fee shown. See the swap API guide.

Standard library only. Python 3.8+.

Install

pip install plaxswap

Accept a payment

import os
from plaxswap import Plaxswap

px = Plaxswap(api_key=os.environ["PLAXSWAP_KEY"])  # pxs_test_... or pxs_live_...

payment = px.payments.create(
    amount="100", currency="USD", receive="usdt-tron",
    orderId="1042", description="2 x T-shirt", returnUrl="https://shop.example/orders/1042",
    idempotency_key="order-1042",  # retries return the same payment
)
print(payment["checkoutUrl"])  # send the customer here

With a test key nothing real moves. Act out an outcome and get the same webhook a live payment sends:

px.payments.simulate(payment["id"], "paid")

Check the webhook (Flask)

from flask import Flask, request
from plaxswap import construct_event, WebhookSignatureError

app = Flask(__name__)

@app.post("/plaxswap-webhook")
def webhook():
    try:
        event = construct_event(request.get_data(), request.headers.get("x-px-signature"), os.environ["PLAXSWAP_WEBHOOK_SECRET"])
    except WebhookSignatureError:
        return "", 400
    # Skip events you have seen (event["id"]), then read the payment back before you ship:
    payment = px.payments.retrieve(event["data"]["id"])
    if payment["status"] == "paid":
        pass  # fulfil order payment["orderId"]
    return "", 200

Quote a swap

px = Plaxswap()  # no key needed for quotes
routes = px.swap.routes("usdt-tron", "btc", "250")["routes"]

Errors

Every failed call raises PlaxswapError with status, a stable code (for example invalid_api_key) and a plain-English message that is safe to show.

Fees

Gateway: the customer pays the 1.5% platform fee at checkout; you pay 0.3% plus the network fee when you withdraw. Swaps: Plaxswap's fee is at most 0.3%, plus the route's own fee. Current figures: plaxswap.com/fees.

MIT licence.

Metadata

Release files for plaxswap 0.1.0

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

Source distribution (sdist)

Source distribution for plaxswap 0.1.0
File Size Uploaded Provenance Actions
plaxswap-0.1.0.tar.gz 7.4 kB With provenance Details for plaxswap-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 14.0 kB

Release files / plaxswap-0.1.0.tar.gz

Download URL plaxswap-0.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
26720be3f3bfb5050f9aed89b31fb6a9dbd87311acc7f7e67582ec72cc576b9e
BLAKE2b-256 checksum
How to use checksums
93994ef26640f27dae83d7688ec225c346a4179c57ff373a7293b20d7c5c659d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 10, 2026.

Transparency log

Release files / plaxswap-0.1.0-py3-none-any.whl

Download URL plaxswap-0.1.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b55ed8388d638f4ce90dfdbb7b8d7619517f3e4097d38552e23e6b7ece5912e6
BLAKE2b-256 checksum
How to use checksums
d419e2deaeb7bfcfd8f0b5f0a03ca39a5363b7ddb14da089b28227cc61b6050e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 10, 2026.

Transparency log

Security for plaxswap 0.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for plaxswap-0.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 Nov 10, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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