This release is a pre-release and may not be stable for production use.
Salable Python SDK
The official Python SDK for the Salable API. It wraps the REST API for products, plans, subscriptions, and the rest of the Salable resources.
Package name: salable-sdk.
Requires Python 3.10+. Resource methods are generated by Kiota and are async. await each call.
Releases before 1.0.0 are 0.x. Those versions can still change as the OpenAPI description settles. 1.0.0 is the compatibility promise.
Table of Contents
Getting Started
Installation
pip install salable-sdk
Releases from the beta branch are prereleases. pip skips those unless you opt in:
pip install --pre salable-sdk
Initialisation
Create one Salable client with your secret API key and reuse it. The default client calls https://salable.app, times out after 30 seconds, retries 429, 503, and 504, and sends a salable-python/<version> User-Agent.
import asyncio
from salable import Salable
async def main() -> None:
async with Salable("your-api-key") as salable:
products = await salable.api.products.get()
print(products)
asyncio.run(main())
Your API key is sent as a Bearer token on every request. Keep it out of source control.
Pass base_url for another origin. Pass http_client for your own httpx.AsyncClient. A client passed as http_client replaces the default timeout, retries, and User-Agent, so set those on that client if you still want them. aclose() closes that client too.
import httpx
from salable import Salable
salable = Salable(
"your-api-key",
base_url="https://salable.app",
http_client=httpx.AsyncClient(timeout=10),
)
Close the client with await salable.aclose(), or use async with.
CRUD Pattern
Every resource uses the same request-builder pattern. await the method each call returns.
| Operation | Method | Example |
|---|---|---|
| List all | .get() |
await salable.api.products.get() |
| Get one | .by_id(id).get() |
await salable.api.products.by_id(id).get() |
| Create | .post(body) |
await salable.api.products.post(body) |
| Update | .by_id(id).put(body) |
await salable.api.products.by_id(id).put(body) |
| Delete | .by_id(id).delete() |
await salable.api.products.by_id(id).delete() |
Product import is salable.api.products.import_(). import is a Python keyword, so the navigator keeps the trailing underscore. The HTTP path remains /api/products/import.
Create example:
from salable.sdk.models.create_product_request_schema import CreateProductRequestSchema
product = await salable.api.products.post(
CreateProductRequestSchema(name="My Product", is_active=True)
)
Error Handling
Non-2xx responses raise ErrorResponseBody, which extends Kiota's APIError. response_status_code is the HTTP status.
from salable import ErrorResponseBody
try:
product = await salable.api.products.by_id("product-id").get()
except ErrorResponseBody as error:
print(error.response_status_code, error.title)
| Status | Meaning |
|---|---|
400 |
Bad request — check your request body |
401 |
Unauthorised — check your API key |
403 |
Forbidden — insufficient permissions |
404 |
Resource not found |
429 |
Rate limit exceeded. The default client retries this status. |
500 |
Internal server error |
Query Parameters
Query parameters use Kiota's RequestConfiguration. limit is an int. include_archived is a bool.
from kiota_abstractions.base_request_configuration import RequestConfiguration
from salable.sdk.api.products.products_request_builder import ProductsRequestBuilder
query = ProductsRequestBuilder.ProductsRequestBuilderGetQueryParameters(
limit=20,
after="cursor-from-previous-page",
)
products = await salable.api.products.get(
request_configuration=RequestConfiguration(query_parameters=query)
)
Pagination
List responses include next_cursor and previous_cursor. Pass the previous page's next_cursor as after to read the next page. Pass previous_cursor as before to read the previous page.
from kiota_abstractions.base_request_configuration import RequestConfiguration
from salable.sdk.api.products.products_request_builder import ProductsRequestBuilder
page = await salable.api.products.get()
if page is not None and page.next_cursor:
query = ProductsRequestBuilder.ProductsRequestBuilderGetQueryParameters(
after=page.next_cursor,
)
next_page = await salable.api.products.get(
request_configuration=RequestConfiguration(query_parameters=query)
)
Metadata
Release files for salable-sdk 0.0.1b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| salable_sdk-0.0.1b2.tar.gz | 181.7 kB | With provenance | Details for salable_sdk-0.0.1b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| salable_sdk-0.0.1b2-py3-none-any.whl | Python 3 | none | any | Details for salable_sdk-0.0.1b2-py3-none-any.whl |
Total release size: 974.1 kB
Release files / salable_sdk-0.0.1b2.tar.gz
| Download URL | salable_sdk-0.0.1b2.tar.gz |
|---|---|
| Size | 181.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8955c81efeb3233aa9ac30c328a48b6bc73147d44fff8e6b578ad927220cdec
|
|
BLAKE2b-256 checksum How to use checksums |
32c54c59ca2e87583ae997ba920f031bd81841b4e2ebfd22e5c1b1e7f0d3a21c
|
| 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 23, 2026.
Transparency logRelease files / salable_sdk-0.0.1b2-py3-none-any.whl
| Download URL | salable_sdk-0.0.1b2-py3-none-any.whl |
|---|---|
| Size | 792.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f5233ddaf3adcb6160644d42344aade00c760f518b8d5c4d8d754959e2bfaa5b
|
|
BLAKE2b-256 checksum How to use checksums |
d3199d486c84d3e0208f530bff59c33a95a1f5b347d41b77c77be2b9296fe322
|
| 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 23, 2026.
Transparency logSecurity for salable-sdk 0.0.1b2
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.
Attestation for salable_sdk-0.0.1b2.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 23, 2026.
Transparency logA 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.