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.217.0.tar.gz
(426.1 kB
view hashes)
Built Distribution
Close
Hashes for stigg_api_client_v2-1.217.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2eb2dccca28b9357c268e8f9715767e45dec754105e28052d0d773f9db34d0d |
|
MD5 | a664b0f8988992c6a1a2605ae67bc4bf |
|
BLAKE2b-256 | 8524447521391cab8c6ec3285d2f22f30c0777b4a947c8759edc23a61709f2ef |
Close
Hashes for stigg_api_client_v2-1.217.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94b71b795bb0f179bd1d823a220be7794f47c0f7124f42fc179e106c4db70aa1 |
|
MD5 | a9d14f5d9c95cd1636a7ec1bb5ae4d82 |
|
BLAKE2b-256 | e026b141bd39d86adf3b1ece151c8c0e335bb6be804ee7455e3933fdd5784fd2 |