## List Organization Billing History

`client.Organizations.Billing.History(ctx, organizationID, query) (*BillingHistoryEntryList, error)`

**get** `/v1/organizations/{organization_id}/billing/history`

List the organization's billing history: prepaid credits, top-ups, and manual adjustments, newest first. Paginated with an opaque cursor.

### Parameters

- `organizationID string`

- `query BillingHistoryParams`

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type BillingHistoryEntryList struct{…}`

  - `Items []BillingHistoryEntry`

    - `ID string`

      Unique identifier for the entry.

    - `Amount string`

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

    - `CreatedAt Time`

      When the entry was recorded.

    - `Currency string`

      ISO 4217 currency code.

    - `Type BillingHistoryEntryType`

      Kind of entry.

      - `const BillingHistoryEntryTypeGrant BillingHistoryEntryType = "grant"`

      - `const BillingHistoryEntryTypeAdjustment BillingHistoryEntryType = "adjustment"`

    - `Description string`

      Human-readable note describing the entry, when available.

  - `Pagination Pagination`

    Pagination response details.

    - `NextCursor string`

    - `PreviousCursor string`

    - `TotalCount int64`

### Example

```go
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"),
  )
  billingHistoryEntryList, err := client.Organizations.Billing.History(
    context.TODO(),
    "organization_id",
    organizations.BillingHistoryParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", billingHistoryEntryList.Items)
}
```

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "amount": "-69125",
      "created_at": "2025-01-01T00:00:00Z",
      "currency": "USD",
      "type": "grant",
      "description": "Refund adjustment"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```
