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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72ead4e838b08c72091c4cd10e6773a7dce973111266c2bfe4f40594ec8b5141 |
|
MD5 | af20b5c98b7846df6549fe12cc3d0c18 |
|
BLAKE2b-256 | 4b361d6644617570354ebf19d898190223a04b05ee93801b700b64f8c8e2e72e |
Close
Hashes for stigg_api_client_v2-0.698.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00d1f7ba8766dc6995e5f2d7bb8b316b1c8af0555dcb2bc67b2d3867e4db55cc |
|
MD5 | 3e69ac72219a9a01e7c747a60e753f64 |
|
BLAKE2b-256 | 6e8a3af7eca450cff90cd8358ea20ac76216024fd18cfffc1bb04dcefe4112e8 |