Skip to content
Docs

    Re-trigger Organization Prepaid Recharge

    client.Organizations.Billing.Recharge(ctx, organizationID, body) (*OrganizationBillingSummary, error)
    POST/v1/organizations/{organization_id}/billing/recharge

    Charge the card on file up to the recharge target now instead of waiting for the scheduled retry. Automatic-policy prepaid organizations only. Idempotency-Key header required.

    ParametersExpand Collapse
    organizationID string
    body BillingRechargeParams
    IdempotencyKey param.Field[string]

    Idempotency key scoping one charge attempt; reuse to retry it, but use a fresh key for a new attempt (e.g. after updating a declined card)

    ReturnsExpand Collapse
    type OrganizationBillingSummary struct{…}

    Forward-looking billing summary for an organization. All costs are run-rate projections from the organization’s current active usage (”≈ $X/mo at current usage”).

    DailyCost string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    EffectiveBalance string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    MonthlyCost string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    RechargeThresholdDays string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    EstimatedNextChargeAt TimeOptional

    Projected date the balance reaches the recharge threshold at the current run-rate. Null when there is no active usage (never charges).

    formatdate-time
    RunwayMonths stringOptional

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal

    Re-trigger Organization Prepaid Recharge

    package main
    
    import (
      "context"
      "fmt"
    
      "github.com/nirvana-labs/nirvana-go"
      "github.com/nirvana-labs/nirvana-go/option"
      "github.com/nirvana-labs/nirvana-go/organizations"
    )
    
    func main() {
      client := nirvana.NewClient(
        option.WithAPIKey("My API Key"),
      )
      organizationBillingSummary, err := client.Organizations.Billing.Recharge(
        context.TODO(),
        "organization_id",
        organizations.BillingRechargeParams{
          IdempotencyKey: "Idempotency-Key",
        },
      )
      if err != nil {
        panic(err.Error())
      }
      fmt.Printf("%+v\n", organizationBillingSummary.DailyCost)
    }
    
    {
      "daily_cost": "-69125",
      "effective_balance": "-69125",
      "monthly_cost": "-69125",
      "recharge_threshold_days": "-69125",
      "estimated_next_charge_at": "2025-01-01T00:00:00Z",
      "runway_months": "-69125"
    }
    Returns Examples
    {
      "daily_cost": "-69125",
      "effective_balance": "-69125",
      "monthly_cost": "-69125",
      "recharge_threshold_days": "-69125",
      "estimated_next_charge_at": "2025-01-01T00:00:00Z",
      "runway_months": "-69125"
    }