cURL
curl --request GET \
--url https://api.tirdad.ai/v1/customers/{id}/grants/upcoming \
--header 'x-api-key: <api-key>'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.customers.get_customer_upcoming_grants(id="<id>")
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.customers.getCustomerUpcomingGrants("<id>");
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Customers.GetCustomerUpcomingGrants(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.ListCreditGrantApplicationsResponse != nil {
// handle response
}
}{
"items": [
{
"application_reason": "first_time_recurring_credit_grant",
"application_status": "applied",
"applied_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grant_id": "<string>",
"credits": "<string>",
"environment_id": "<string>",
"failure_reason": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"retry_count": 123,
"scheduled_for": "<string>",
"status": "published",
"subscription_id": "<string>",
"subscription_status_at_application": "active",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Customers
Get upcoming credit grant applications
Use when showing upcoming or pending credits for a customer (e.g. in a portal or for forecasting).
GET
/
customers
/
{id}
/
grants
/
upcoming
cURL
curl --request GET \
--url https://api.tirdad.ai/v1/customers/{id}/grants/upcoming \
--header 'x-api-key: <api-key>'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.customers.get_customer_upcoming_grants(id="<id>")
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.customers.getCustomerUpcomingGrants("<id>");
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Customers.GetCustomerUpcomingGrants(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.ListCreditGrantApplicationsResponse != nil {
// handle response
}
}{
"items": [
{
"application_reason": "first_time_recurring_credit_grant",
"application_status": "applied",
"applied_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credit_grant_id": "<string>",
"credits": "<string>",
"environment_id": "<string>",
"failure_reason": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"retry_count": 123,
"scheduled_for": "<string>",
"status": "published",
"subscription_id": "<string>",
"subscription_status_at_application": "active",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}