Skip to content

Latest commit

 

History

History
162 lines (108 loc) · 3.32 KB

File metadata and controls

162 lines (108 loc) · 3.32 KB

list

List billing alerts

Lists billing active and inactive alerts

API Endpoint: GET /v1/billing/alerts

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.billing.alert.list()

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.billing.alert.list()

get

Retrieve a billing alert

Retrieves a billing alert given an ID

API Endpoint: GET /v1/billing/alerts/{id}

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.billing.alert.get(id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.billing.alert.get(id="string")

create

Create a billing alert

Creates a billing alert

API Endpoint: POST /v1/billing/alerts

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.billing.alert.create(alert_type="usage_threshold", title="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.billing.alert.create(alert_type="usage_threshold", title="string")

activate

Activate a billing alert

Reactivates this alert, allowing it to trigger again.

API Endpoint: POST /v1/billing/alerts/{id}/activate

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.billing.alert.activate(id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.billing.alert.activate(id="string")

archive

Archive a billing alert

Archives this alert, removing it from the list view and APIs. This is non-reversible.

API Endpoint: POST /v1/billing/alerts/{id}/archive

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.billing.alert.archive(id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.billing.alert.archive(id="string")

deactivate

Deactivate a billing alert

Deactivates this alert, preventing it from triggering.

API Endpoint: POST /v1/billing/alerts/{id}/deactivate

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.billing.alert.deactivate(id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.billing.alert.deactivate(id="string")