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.698.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08a9dbf50ad5b798e609c90d6197c21b42a4a30c067d2f6d195276f1cb0e9cf8 |
|
MD5 | 264d21821a461816fd495f0ab9f1d1a1 |
|
BLAKE2b-256 | 515b6f6aecaffdfafed72be91f5e1b068167703ccbf0e971c0a889c6b8e43c2f |
Close
Hashes for stigg_api_client_v2-0.698.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 150546482da6e7b8f6d8622d2eb4e86b85798f18193b4fd84d6dff3b3d769254 |
|
MD5 | 326198ca9fc10a3b86d7d4a18e5a4e75 |
|
BLAKE2b-256 | 0768e15416f5267e8b2f2a15e9a821097cdb6bd6cf0ef3d9f41418a3d044e5bc |