No project description provided
Project description
stigg-api-client-v2 (BETA)
This library provides a Python wrapper to Stigg's GraphQL API based on the operations that are in use by the Stigg's Node.js SDK.
The ariadne-codegen code generator is used to generate a typesafe Python API client.
Documentation
TBD
Installation
pip install stigg-api-client-v2
Usage
Initialize the client:
import os
from stigg import Stigg
api_key = os.environ.get("STIGG_SERVER_API_KEY")
client = Stigg.create_async_client(api_key)
Provision a customer
import os
from stigg import Stigg
from stigg.generated import ProvisionCustomerInput
api_key = os.environ.get("STIGG_SERVER_API_KEY")
client = Stigg.create_async_client(api_key)
customer_input = ProvisionCustomerInput(
**{
"customer_id": "1661115567186116608", # mandatory, everything else is optional
"name": "Acme",
"email": "billing@acme.com",
"additional_meta_data": {"key": "value"},
"subscription_params": {"plan_id": "plan-acme-free"},
}
)
result = await client.provision_customer(customer_input)
print(result.provision_customer.customer)
Get a customer by ID
import os
from stigg import Stigg
from stigg.generated import GetCustomerByRefIdInput
api_key = os.environ.get("STIGG_SERVER_API_KEY")
client = Stigg.create_async_client(api_key)
result = await client.get_customer_by_id(GetCustomerByRefIdInput(**{"customer_id": "1661115567186116608"}))
print(result.get_customer_by_ref_id.name)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stigg_api_client_v2-1.95.0.tar.gz
(67.4 kB
view hashes)
Built Distribution
Close
Hashes for stigg_api_client_v2-1.95.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cc0b184998b9ad23a608347ea62042f1be16101bfc357a394c8c317e33ad7b5 |
|
MD5 | 7365c54f4a9c9c834f8dcba03c13d766 |
|
BLAKE2b-256 | 47f808d82d9e45272910e75236e41fd286974789ab96591978eab855d8a57bd7 |
Close
Hashes for stigg_api_client_v2-1.95.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60217e19f7256dad87359b1d71310eb6f22df57b8c2551396bae566cf2fcf571 |
|
MD5 | 7d7aed0c4a6663b4ea867145323ca95d |
|
BLAKE2b-256 | 07a16b6ff851c20e06b6c6495f6afc21bc2e7aaff30565989c20b18cdf48f366 |