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
Built Distribution
Close
Hashes for stigg_api_client_v2-0.475.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ac389ff2aada822ed202657d23c68546bda553d98036a2e5424aef9e194647f |
|
MD5 | 9ed4ef4f730930ab59d3dfd66ebae266 |
|
BLAKE2b-256 | 50357fc2987a799d26b7a225f5e5f2d757caf1a3ac60bd33e92fd17452f87a6f |
Close
Hashes for stigg_api_client_v2-0.475.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3d2b7b8eff126a29e57ac5a4edd79a6050acb9748791126f6be5fe154a72247 |
|
MD5 | ba7f558fe0608df5dd4890936942b5dc |
|
BLAKE2b-256 | 5a5d30aaf9b7e0e0419985af8b705609d539af8a184fe839dbbca7bbe56f48da |