Skip to main content

Swish Python Client Library

This client library is designed to support the Swish API.

Installation

It’s easy! Just install it with pip:

$ pip install swish

Quick Start Example

import swish

swish_client = swish.SwishClient(
    environment=swish.Environment.MSS,
    merchant_swish_number='1231181189',
    cert=('/path/to/cert.pem', '/path/to/key.pem'),
    verify='/path/to/swish.pem'
)

payment = swish_client.create_payment(
    payee_payment_reference='0123456789',
    callback_url='https://example.com/api/swishcb/paymentrequests',
    payer_alias='46712345678',
    amount=100,
    currency='SEK',
    message='Kingston USB Flash Drive 8 GB'
)

# YOUR CODE: Save payment.id and other info in your database for later!

Metadata

Release files for swish 1.7.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 swish 1.7.1
File Size Uploaded Provenance
swish-1.7.1.tar.gz 8.1 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 14.2 kB

Release files / swish-1.7.1.tar.gz

Download URL swish-1.7.1.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0a775644d7a8e80f53b44c584f1739cf925cc3d806aaef4bc5fe7d05d3046737
BLAKE2b-256 checksum
How to use checksums
40fce2e440847802778fb1c01c1d69683a1704bea126df7abf6ea75cbe22b90b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / swish-1.7.1-py3-none-any.whl

Download URL swish-1.7.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0987829b28845f03afff9df776b2696b2361efc9bbc653ac06bf8e164e3595ff
BLAKE2b-256 checksum
How to use checksums
e9065e5050548c3fe7ea81fd730ea25d3fdb8d52834a22e693f9f45c48f022f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for swish 1.7.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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