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.77.3.tar.gz
(67.0 kB
view hashes)
Built Distribution
Close
Hashes for stigg_api_client_v2-1.77.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 612cf23a27a6d8c18469329bcf7fd0779b8fc75e2ae960dd496280ecabbd4481 |
|
MD5 | 79b398cdbe363b2c2c8a925fde9a90c3 |
|
BLAKE2b-256 | aa4604cd6f55e38d0a92137049d3a0074165aef39f33a380e4ee60f46ceedb40 |
Close
Hashes for stigg_api_client_v2-1.77.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d377ceb92f82bd229ce7f8294596d3af8106b86a086c4c66c69ce35d11686916 |
|
MD5 | 54abff1c6e61953009a06f4a1d242092 |
|
BLAKE2b-256 | ae8b3e2567ac2c8a6dc2ee00313d6c6afaae6d94b8517ca26284651bd671f029 |