Skip to main content

No project description provided

Project description

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)

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-6.10.0.tar.gz (94.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stigg_api_client-6.10.0-py3-none-any.whl (95.4 kB view details)

Uploaded Python 3

File details

Details for the file stigg_api_client-6.10.0.tar.gz.

File metadata

  • Download URL: stigg_api_client-6.10.0.tar.gz
  • Upload date:
  • Size: 94.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.12 Linux/6.8.0-1044-azure

File hashes

Hashes for stigg_api_client-6.10.0.tar.gz
Algorithm Hash digest
SHA256 ef76e18a0ad97613095495242aa9ade0f1fa2449e70d83296628ff5f12b66f48
MD5 84cffcc005e58f8c56795a3012f3f9e4
BLAKE2b-256 47e3bdbabe481db5e067fb61e9deab6d496575834ee163041516f8c2b08ffdd6

See more details on using hashes here.

File details

Details for the file stigg_api_client-6.10.0-py3-none-any.whl.

File metadata

  • Download URL: stigg_api_client-6.10.0-py3-none-any.whl
  • Upload date:
  • Size: 95.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.12 Linux/6.8.0-1044-azure

File hashes

Hashes for stigg_api_client-6.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d6ddd3457e03fda914190b21f08a35de805579abf11623e3704a8d93db03a50
MD5 84e57f2ec878a4cf4b1de7b02b197623
BLAKE2b-256 91fc4595e59f3849777b32241e09778acce7df7aed693d03da97343667b5e4c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page