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.557.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab32247b0012b35f0e6c034394e1e5fa3ff5c786f67d664e91d8dc696b6aac4a |
|
MD5 | 7b3628e6ebcff7cdbf8d0bf900e51cc9 |
|
BLAKE2b-256 | dd746b7d3a6da87e32fb8e151ad9bb166eb9aba739af776642eb693bc06a80bf |
Close
Hashes for stigg_api_client_v2-0.557.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec35afdb5417ceb8a6f9508ca4b6a9253a4841bb05464a6462626b78c6cfc995 |
|
MD5 | f745e451ec425178280ade30aa24efb8 |
|
BLAKE2b-256 | 16cf9602e157a50842df11517ca7f251c567124b676e839451f7ebd053ddc999 |