Skip to main content

Installation

Install the Solifyn Python SDK directly from PyPI:
Terminal
pip install solifyn
Or install from the GitHub repository:
Terminal
pip install git+https://github.com/solifyn/solifyn-python.git

Quickstart

Initialize the API client by configuring solifyn.Configuration with your access token.
main.py
import solifyn
from solifyn.rest import ApiException
from pprint import pprint

# Set up API client configuration
configuration = solifyn.Configuration(
    host = "https://api.solifyn.com",  # Optional: Defaults to http://localhost:8000
    access_token = "YOUR_API_KEY"      # Replace with your actual Solifyn API key
)

# Use the API client within a context manager
with solifyn.ApiClient(configuration) as api_client:
    # Instantiate the Products API class
    api_instance = solifyn.ProductsApi(api_client)

    try:
        # Retrieve all products
        result = api_instance.products_list()
        print("Successfully retrieved products:")
        pprint(result)
    except ApiException as e:
        print("Exception when calling ProductsApi->products_list: %s\n" % e)

Main API Classes

The Python client partitions endpoints into specific API classes. Instantiate them with your ApiClient instance:
  • solifyn.ProductsApi - Manage products and addons
  • solifyn.LicenseApi & solifyn.LicenseKeysApi - Issue, retrieve, and update license keys
  • solifyn.LicenseKeysClientApi - Public/client-side license validation (licenses_verify) and activation (licenses_activate)
  • solifyn.CheckoutApi - Generate custom checkout sessions
  • solifyn.CheckoutLinksApi - Generate shareable payment links
  • solifyn.CustomersApi - Create and manage customer profiles
  • solifyn.CollectionsApi - Group products into collections
  • solifyn.SubscriptionsApi - Manage recurring customer subscriptions
  • solifyn.DiscountsApi - Create and validate discount codes
  • solifyn.MetersApi - Ingest usage events and manage metered billing
  • solifyn.DeveloperApi - Manage webhooks and API keys
  • solifyn.DigitalFileApi - Upload and manage digital download products
  • solifyn.DisputesApi - Review and upload evidence for transaction disputes
  • solifyn.OrdersApi & solifyn.RefundsChargebacksApi - Retrieve order details and create refunds