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.642.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 142f0f553235a3351e33f0534e5e78cc4ba22fb1a6b7580d0a458eff52cf0925 |
|
MD5 | 4418714cc0c2923b55d7b51437014083 |
|
BLAKE2b-256 | d5b8c3bd3de4b6a93571981a9590127cf4e734b6dca94b17058d556ec870c923 |
Close
Hashes for stigg_api_client_v2-0.642.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 038593b01783900f3e273ac9b8c8db8fe96132c821b0df1d895220bd6c88366a |
|
MD5 | b2f7040bd3cad734dc0f9ffedba00dab |
|
BLAKE2b-256 | ea5eb830a9c2dbb44701998349c7717f038f68ef9beea37da274ae06375bde38 |