stigg-api-client
⚠️ This package has been deprecated and is no longer actively maintained. Please use stigg-api-client-v2 instead.
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.
It leverages the sgqlc library to generate Python classes for GraphQL types, and
utilizes the sgqlc.endpoint.requests.RequestsEndpoint class to send the API requests. The responses are being
automatically converted into native Python types.
Documentation
See https://docs.stigg.io/docs/python-sdk
Installation
pip install stigg-api-client
Usage
Initialize the client:
import os
from stigg import Stigg
api_key = os.environ.get("STIGG_SERVER_API_KEY")
stigg_client = Stigg.create_client(api_key)
Provision a customer
import os
from stigg import Stigg
api_key = os.environ.get("STIGG_SERVER_API_KEY")
client = Stigg.create_client(api_key)
data = client.request(Stigg.mutation.provision_customer, {
"input": {
"refId": "customer-id",
"name": "Acme",
"email": "hello@acme.com",
"couponRefId": "coupon-id",
"billingInformation": {
"language": "en",
"timezone": "America/New_York",
"billingAddress": {
"country": "US",
"city": "New York",
"state": "NY",
"addressLine1": "123 Main Street",
"addressLine2": "Apt. 1",
"phoneNumber": "+1 212-499-5321",
"postalCode": "10164"
},
"shippingAddress": {
"country": "US",
"city": "New York",
"state": "NY",
"addressLine1": "123 Main Street",
"addressLine2": "Apt. 1",
"phoneNumber": "+1 212-499-5321",
"postalCode": "10164"
}
},
"additionalMetaData": {
"key": "value"
},
"subscriptionParams": {
"planId": "plan-revvenu-basic"
}
}
})
print(data.provision_customer.customer.name)
Get a customer by ID
import os
from stigg import Stigg
api_key = os.environ.get("STIGG_SERVER_API_KEY")
client = Stigg.create_client(api_key)
data = client.request(Stigg.query.get_customer_by_id, {
"input": {"customerId": "customer-id"}
})
customer = data.get_customer_by_ref_id
print(customer.name)
Metadata
Release files for stigg-api-client 6.25.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stigg_api_client-6.25.0.tar.gz | 100.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stigg_api_client-6.25.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 203.0 kB
Release files / stigg_api_client-6.25.0.tar.gz
| Download URL | stigg_api_client-6.25.0.tar.gz |
|---|---|
| Size | 100.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fbe8bd33a1ce42f327717363f191281e21eafe99e061a8b1fd707761e9fbc07
|
|
BLAKE2b-256 checksum How to use checksums |
01ce8be3f580f270f1b3810f3b781417b8ad172355bb96bb6cef1ab93ef5d4ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.10.12 Linux/6.6.141
|
Release files / stigg_api_client-6.25.0-py3-none-any.whl
| Download URL | stigg_api_client-6.25.0-py3-none-any.whl |
|---|---|
| Size | 102.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
149a27bea6676e2efb80fc04a90c0005e1418fcaf78c835717d9257218a2690d
|
|
BLAKE2b-256 checksum How to use checksums |
72efe47b050d47b16107e71afeffa733f8da7c2bc595d1ec4bf096e14661e614
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.10.12 Linux/6.6.141
|