Get Billing State
client.CustomerAccess.GetBillingState(ctx, subjectID) (*CustomerAccessGetBillingStateResponse, error)
/customer-access/{subject_id}/billing-state
Get Billing State
Parameters
subjectID string
The ID or external ID of the subject to get billing state for.
Returns
Get Billing State
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/-go"
"github.com/stainless-sdks/-go/option"
)
func main() {
client := lark.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.CustomerAccess.GetBillingState(context.TODO(), "user_1234567890")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ActiveSubscriptions)
}
{
"active_subscriptions": [
{
"rate_card_id": "rc_jQK2n0wutCj6bBcAIrL6o07g",
"subscription_id": "sub_PuLvkNSP3IBCvjayBD3TXNQ6"
}
],
"has_active_subscription": true,
"has_overage_for_usage": false,
"usage_data": [
{
"included_units": 300,
"pricing_metric_id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
"rate_name": "Compute Hours",
"used_units": "100"
}
]
}Returns Examples
{
"active_subscriptions": [
{
"rate_card_id": "rc_jQK2n0wutCj6bBcAIrL6o07g",
"subscription_id": "sub_PuLvkNSP3IBCvjayBD3TXNQ6"
}
],
"has_active_subscription": true,
"has_overage_for_usage": false,
"usage_data": [
{
"included_units": 300,
"pricing_metric_id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
"rate_name": "Compute Hours",
"used_units": "100"
}
]
}