# Organizations

## Create Organization

`client.Organizations.New(ctx, body) (*Organization, error)`

**post** `/v1/organizations`

Create a new organization

### Parameters

- `body OrganizationNewParams`

  - `Name param.Field[string]`

    Organization name.

  - `BillingEmail param.Field[string]`

    Optional billing email. When omitted, the oldest owner's email is used.

### Returns

- `type Organization struct{…}`

  Organization response.

  - `ID string`

    Organization ID.

  - `BillingEmail string`

    Billing email. Null when no custom billing email is set (reverts to the oldest owner's email).

  - `CreatedAt Time`

    When the Organization was created.

  - `Domains []OrganizationDomain`

    Domains associated with the organization.

    - `ID string`

      Domain ID.

    - `Domain string`

      Domain name.

    - `Verified bool`

      Whether the domain has been verified.

  - `MetronomeCustomerID string`

    Metronome customer ID.

  - `Name string`

    Organization name.

  - `Personal bool`

    Whether the organization is a personal Organization.

  - `Services OrganizationServices`

    Services that the Organization has access to.

    - `Cloud bool`

      Whether cloud services are enabled for the organization.

    - `JitProvisioning bool`

      Whether just-in-time provisioning is enabled for the organization.

    - `SCIM bool`

      Whether SCIM provisioning is enabled for the organization.

    - `SIEM bool`

      Whether SIEM integration is enabled for the organization.

    - `SSO bool`

      Whether single sign-on is enabled for the organization.

  - `StripeCustomerID string`

    Stripe customer ID.

  - `Type OrganizationType`

    Organization type.

    - `const OrganizationTypePersonal OrganizationType = "personal"`

    - `const OrganizationTypeCompany OrganizationType = "company"`

  - `UpdatedAt Time`

    When the Organization was updated.

  - `AuthID string`

    Authentication provider organization ID.

### 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"),
  )
  organization, err := client.Organizations.New(context.TODO(), organizations.OrganizationNewParams{
    Name: "My Organization",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", organization.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "billing_email": "billing@example.com",
  "created_at": "2025-01-01T00:00:00Z",
  "domains": [
    {
      "id": "456e7890-e89b-12d3-a456-426614174000",
      "domain": "example.com",
      "verified": true
    }
  ],
  "metronome_customer_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "My Organization",
  "personal": false,
  "services": {
    "cloud": true,
    "jit_provisioning": true,
    "scim": false,
    "siem": false,
    "sso": false
  },
  "stripe_customer_id": "cus_1234567890",
  "type": "company",
  "updated_at": "2025-01-01T00:00:00Z",
  "auth_id": "org_01H8GQBX3Z"
}
```

## Get Organization Details

`client.Organizations.Get(ctx, organizationID) (*Organization, error)`

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

Get details about an Organization

### Parameters

- `organizationID string`

### Returns

- `type Organization struct{…}`

  Organization response.

  - `ID string`

    Organization ID.

  - `BillingEmail string`

    Billing email. Null when no custom billing email is set (reverts to the oldest owner's email).

  - `CreatedAt Time`

    When the Organization was created.

  - `Domains []OrganizationDomain`

    Domains associated with the organization.

    - `ID string`

      Domain ID.

    - `Domain string`

      Domain name.

    - `Verified bool`

      Whether the domain has been verified.

  - `MetronomeCustomerID string`

    Metronome customer ID.

  - `Name string`

    Organization name.

  - `Personal bool`

    Whether the organization is a personal Organization.

  - `Services OrganizationServices`

    Services that the Organization has access to.

    - `Cloud bool`

      Whether cloud services are enabled for the organization.

    - `JitProvisioning bool`

      Whether just-in-time provisioning is enabled for the organization.

    - `SCIM bool`

      Whether SCIM provisioning is enabled for the organization.

    - `SIEM bool`

      Whether SIEM integration is enabled for the organization.

    - `SSO bool`

      Whether single sign-on is enabled for the organization.

  - `StripeCustomerID string`

    Stripe customer ID.

  - `Type OrganizationType`

    Organization type.

    - `const OrganizationTypePersonal OrganizationType = "personal"`

    - `const OrganizationTypeCompany OrganizationType = "company"`

  - `UpdatedAt Time`

    When the Organization was updated.

  - `AuthID string`

    Authentication provider organization ID.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/option"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  organization, err := client.Organizations.Get(context.TODO(), "organization_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", organization.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "billing_email": "billing@example.com",
  "created_at": "2025-01-01T00:00:00Z",
  "domains": [
    {
      "id": "456e7890-e89b-12d3-a456-426614174000",
      "domain": "example.com",
      "verified": true
    }
  ],
  "metronome_customer_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "My Organization",
  "personal": false,
  "services": {
    "cloud": true,
    "jit_provisioning": true,
    "scim": false,
    "siem": false,
    "sso": false
  },
  "stripe_customer_id": "cus_1234567890",
  "type": "company",
  "updated_at": "2025-01-01T00:00:00Z",
  "auth_id": "org_01H8GQBX3Z"
}
```

## Update Organization

`client.Organizations.Update(ctx, organizationID, body) (*Organization, error)`

**patch** `/v1/organizations/{organization_id}`

Update an existing organization

### Parameters

- `organizationID string`

- `body OrganizationUpdateParams`

  - `BillingEmail param.Field[string]`

    Billing email. Omit to leave unchanged, send null to clear (reverts to the
    oldest owner's email), or send a value to set it.

  - `Name param.Field[string]`

    Organization name.

### Returns

- `type Organization struct{…}`

  Organization response.

  - `ID string`

    Organization ID.

  - `BillingEmail string`

    Billing email. Null when no custom billing email is set (reverts to the oldest owner's email).

  - `CreatedAt Time`

    When the Organization was created.

  - `Domains []OrganizationDomain`

    Domains associated with the organization.

    - `ID string`

      Domain ID.

    - `Domain string`

      Domain name.

    - `Verified bool`

      Whether the domain has been verified.

  - `MetronomeCustomerID string`

    Metronome customer ID.

  - `Name string`

    Organization name.

  - `Personal bool`

    Whether the organization is a personal Organization.

  - `Services OrganizationServices`

    Services that the Organization has access to.

    - `Cloud bool`

      Whether cloud services are enabled for the organization.

    - `JitProvisioning bool`

      Whether just-in-time provisioning is enabled for the organization.

    - `SCIM bool`

      Whether SCIM provisioning is enabled for the organization.

    - `SIEM bool`

      Whether SIEM integration is enabled for the organization.

    - `SSO bool`

      Whether single sign-on is enabled for the organization.

  - `StripeCustomerID string`

    Stripe customer ID.

  - `Type OrganizationType`

    Organization type.

    - `const OrganizationTypePersonal OrganizationType = "personal"`

    - `const OrganizationTypeCompany OrganizationType = "company"`

  - `UpdatedAt Time`

    When the Organization was updated.

  - `AuthID string`

    Authentication provider organization ID.

### 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"),
  )
  organization, err := client.Organizations.Update(
    context.TODO(),
    "organization_id",
    organizations.OrganizationUpdateParams{

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

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "billing_email": "billing@example.com",
  "created_at": "2025-01-01T00:00:00Z",
  "domains": [
    {
      "id": "456e7890-e89b-12d3-a456-426614174000",
      "domain": "example.com",
      "verified": true
    }
  ],
  "metronome_customer_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "My Organization",
  "personal": false,
  "services": {
    "cloud": true,
    "jit_provisioning": true,
    "scim": false,
    "siem": false,
    "sso": false
  },
  "stripe_customer_id": "cus_1234567890",
  "type": "company",
  "updated_at": "2025-01-01T00:00:00Z",
  "auth_id": "org_01H8GQBX3Z"
}
```

## List Organizations

`client.Organizations.List(ctx, query) (*Cursor[Organization], error)`

**get** `/v1/organizations`

List organizations

### Parameters

- `query OrganizationListParams`

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type Organization struct{…}`

  Organization response.

  - `ID string`

    Organization ID.

  - `BillingEmail string`

    Billing email. Null when no custom billing email is set (reverts to the oldest owner's email).

  - `CreatedAt Time`

    When the Organization was created.

  - `Domains []OrganizationDomain`

    Domains associated with the organization.

    - `ID string`

      Domain ID.

    - `Domain string`

      Domain name.

    - `Verified bool`

      Whether the domain has been verified.

  - `MetronomeCustomerID string`

    Metronome customer ID.

  - `Name string`

    Organization name.

  - `Personal bool`

    Whether the organization is a personal Organization.

  - `Services OrganizationServices`

    Services that the Organization has access to.

    - `Cloud bool`

      Whether cloud services are enabled for the organization.

    - `JitProvisioning bool`

      Whether just-in-time provisioning is enabled for the organization.

    - `SCIM bool`

      Whether SCIM provisioning is enabled for the organization.

    - `SIEM bool`

      Whether SIEM integration is enabled for the organization.

    - `SSO bool`

      Whether single sign-on is enabled for the organization.

  - `StripeCustomerID string`

    Stripe customer ID.

  - `Type OrganizationType`

    Organization type.

    - `const OrganizationTypePersonal OrganizationType = "personal"`

    - `const OrganizationTypeCompany OrganizationType = "company"`

  - `UpdatedAt Time`

    When the Organization was updated.

  - `AuthID string`

    Authentication provider organization ID.

### 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"),
  )
  page, err := client.Organizations.List(context.TODO(), organizations.OrganizationListParams{

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

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "billing_email": "billing@example.com",
      "created_at": "2025-01-01T00:00:00Z",
      "domains": [
        {
          "id": "456e7890-e89b-12d3-a456-426614174000",
          "domain": "example.com",
          "verified": true
        }
      ],
      "metronome_customer_id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "My Organization",
      "personal": false,
      "services": {
        "cloud": true,
        "jit_provisioning": true,
        "scim": false,
        "siem": false,
        "sso": false
      },
      "stripe_customer_id": "cus_1234567890",
      "type": "company",
      "updated_at": "2025-01-01T00:00:00Z",
      "auth_id": "org_01H8GQBX3Z"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```

## Leave Organization

`client.Organizations.Leave(ctx, organizationID) error`

**post** `/v1/organizations/{organization_id}/leave`

Leave an Organization

### Parameters

- `organizationID string`

### Example

```go
package main

import (
  "context"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/option"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  err := client.Organizations.Leave(context.TODO(), "organization_id")
  if err != nil {
    panic(err.Error())
  }
}
```

## Domain Types

### Organization

- `type Organization struct{…}`

  Organization response.

  - `ID string`

    Organization ID.

  - `BillingEmail string`

    Billing email. Null when no custom billing email is set (reverts to the oldest owner's email).

  - `CreatedAt Time`

    When the Organization was created.

  - `Domains []OrganizationDomain`

    Domains associated with the organization.

    - `ID string`

      Domain ID.

    - `Domain string`

      Domain name.

    - `Verified bool`

      Whether the domain has been verified.

  - `MetronomeCustomerID string`

    Metronome customer ID.

  - `Name string`

    Organization name.

  - `Personal bool`

    Whether the organization is a personal Organization.

  - `Services OrganizationServices`

    Services that the Organization has access to.

    - `Cloud bool`

      Whether cloud services are enabled for the organization.

    - `JitProvisioning bool`

      Whether just-in-time provisioning is enabled for the organization.

    - `SCIM bool`

      Whether SCIM provisioning is enabled for the organization.

    - `SIEM bool`

      Whether SIEM integration is enabled for the organization.

    - `SSO bool`

      Whether single sign-on is enabled for the organization.

  - `StripeCustomerID string`

    Stripe customer ID.

  - `Type OrganizationType`

    Organization type.

    - `const OrganizationTypePersonal OrganizationType = "personal"`

    - `const OrganizationTypeCompany OrganizationType = "company"`

  - `UpdatedAt Time`

    When the Organization was updated.

  - `AuthID string`

    Authentication provider organization ID.

### Organization Domain

- `type OrganizationDomain struct{…}`

  Organization domain details.

  - `ID string`

    Domain ID.

  - `Domain string`

    Domain name.

  - `Verified bool`

    Whether the domain has been verified.

### Organization List

- `type OrganizationList struct{…}`

  - `Items []Organization`

    - `ID string`

      Organization ID.

    - `BillingEmail string`

      Billing email. Null when no custom billing email is set (reverts to the oldest owner's email).

    - `CreatedAt Time`

      When the Organization was created.

    - `Domains []OrganizationDomain`

      Domains associated with the organization.

      - `ID string`

        Domain ID.

      - `Domain string`

        Domain name.

      - `Verified bool`

        Whether the domain has been verified.

    - `MetronomeCustomerID string`

      Metronome customer ID.

    - `Name string`

      Organization name.

    - `Personal bool`

      Whether the organization is a personal Organization.

    - `Services OrganizationServices`

      Services that the Organization has access to.

      - `Cloud bool`

        Whether cloud services are enabled for the organization.

      - `JitProvisioning bool`

        Whether just-in-time provisioning is enabled for the organization.

      - `SCIM bool`

        Whether SCIM provisioning is enabled for the organization.

      - `SIEM bool`

        Whether SIEM integration is enabled for the organization.

      - `SSO bool`

        Whether single sign-on is enabled for the organization.

    - `StripeCustomerID string`

      Stripe customer ID.

    - `Type OrganizationType`

      Organization type.

      - `const OrganizationTypePersonal OrganizationType = "personal"`

      - `const OrganizationTypeCompany OrganizationType = "company"`

    - `UpdatedAt Time`

      When the Organization was updated.

    - `AuthID string`

      Authentication provider organization ID.

  - `Pagination Pagination`

    Pagination response details.

    - `NextCursor string`

    - `PreviousCursor string`

    - `TotalCount int64`

### Organization Services

- `type OrganizationServices struct{…}`

  Services that the Organization has access to.

  - `Cloud bool`

    Whether cloud services are enabled for the organization.

  - `JitProvisioning bool`

    Whether just-in-time provisioning is enabled for the organization.

  - `SCIM bool`

    Whether SCIM provisioning is enabled for the organization.

  - `SIEM bool`

    Whether SIEM integration is enabled for the organization.

  - `SSO bool`

    Whether single sign-on is enabled for the organization.

### Organization Type

- `type OrganizationType string`

  Organization type.

  - `const OrganizationTypePersonal OrganizationType = "personal"`

  - `const OrganizationTypeCompany OrganizationType = "company"`

# Memberships

## Get Organization Membership

`client.Organizations.Memberships.Get(ctx, organizationID, membershipID) (*OrganizationMembership, error)`

**get** `/v1/organizations/{organization_id}/memberships/{membership_id}`

Get details about an organization membership

### Parameters

- `organizationID string`

- `membershipID string`

### Returns

- `type OrganizationMembership struct{…}`

  Organization membership details.

  - `ID string`

    Membership ID.

  - `CreatedAt Time`

    When the membership was created.

  - `OrganizationID string`

    Organization ID.

  - `Role OrganizationMembershipRole`

    Role of the user in the organization.

    - `const OrganizationMembershipRoleOwner OrganizationMembershipRole = "owner"`

    - `const OrganizationMembershipRoleMember OrganizationMembershipRole = "member"`

  - `UpdatedAt Time`

    When the membership was updated.

  - `UserID string`

    User ID.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/option"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  organizationMembership, err := client.Organizations.Memberships.Get(
    context.TODO(),
    "organization_id",
    "membership_id",
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", organizationMembership.ID)
}
```

#### Response

```json
{
  "id": "987e6543-e89b-12d3-a456-426614174000",
  "created_at": "2025-01-01T00:00:00Z",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "role": "owner",
  "updated_at": "2025-01-01T00:00:00Z",
  "user_id": "user_01H8GQBX3Z"
}
```

## List Organization Memberships

`client.Organizations.Memberships.List(ctx, organizationID, query) (*Cursor[OrganizationMembership], error)`

**get** `/v1/organizations/{organization_id}/memberships`

List all memberships for an organization

### Parameters

- `organizationID string`

- `query MembershipListParams`

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request

  - `Limit param.Field[int64]`

    Maximum number of items to return

### Returns

- `type OrganizationMembership struct{…}`

  Organization membership details.

  - `ID string`

    Membership ID.

  - `CreatedAt Time`

    When the membership was created.

  - `OrganizationID string`

    Organization ID.

  - `Role OrganizationMembershipRole`

    Role of the user in the organization.

    - `const OrganizationMembershipRoleOwner OrganizationMembershipRole = "owner"`

    - `const OrganizationMembershipRoleMember OrganizationMembershipRole = "member"`

  - `UpdatedAt Time`

    When the membership was updated.

  - `UserID string`

    User ID.

### 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"),
  )
  page, err := client.Organizations.Memberships.List(
    context.TODO(),
    "organization_id",
    organizations.MembershipListParams{

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

#### Response

```json
{
  "items": [
    {
      "id": "987e6543-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "organization_id": "123e4567-e89b-12d3-a456-426614174000",
      "role": "owner",
      "updated_at": "2025-01-01T00:00:00Z",
      "user_id": "user_01H8GQBX3Z"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```

## Domain Types

### Organization Membership

- `type OrganizationMembership struct{…}`

  Organization membership details.

  - `ID string`

    Membership ID.

  - `CreatedAt Time`

    When the membership was created.

  - `OrganizationID string`

    Organization ID.

  - `Role OrganizationMembershipRole`

    Role of the user in the organization.

    - `const OrganizationMembershipRoleOwner OrganizationMembershipRole = "owner"`

    - `const OrganizationMembershipRoleMember OrganizationMembershipRole = "member"`

  - `UpdatedAt Time`

    When the membership was updated.

  - `UserID string`

    User ID.

### Organization Membership List

- `type OrganizationMembershipList struct{…}`

  - `Items []OrganizationMembership`

    - `ID string`

      Membership ID.

    - `CreatedAt Time`

      When the membership was created.

    - `OrganizationID string`

      Organization ID.

    - `Role OrganizationMembershipRole`

      Role of the user in the organization.

      - `const OrganizationMembershipRoleOwner OrganizationMembershipRole = "owner"`

      - `const OrganizationMembershipRoleMember OrganizationMembershipRole = "member"`

    - `UpdatedAt Time`

      When the membership was updated.

    - `UserID string`

      User ID.

  - `Pagination Pagination`

    Pagination response details.

    - `NextCursor string`

    - `PreviousCursor string`

    - `TotalCount int64`

# Address

## Create Organization Address

`client.Organizations.Address.New(ctx, organizationID, body) (*OrganizationAddress, error)`

**post** `/v1/organizations/{organization_id}/address`

Create the address for an organization

### Parameters

- `organizationID string`

- `body AddressNewParams`

  - `City param.Field[string]`

    City or locality.

  - `Country param.Field[string]`

    Two-letter ISO 3166-1 alpha-2 country code.

  - `Line1 param.Field[string]`

    First line of the street address.

  - `PostalCode param.Field[string]`

    Postal or ZIP code.

  - `Line2 param.Field[string]`

    Second line of the street address (suite, unit, building).

  - `State param.Field[string]`

    State, province, or region. Required by some tax jurisdictions (e.g. US, CA).

  - `TaxID param.Field[string]`

    Tax identification number (e.g. VAT, EIN, ABN). Optional.

  - `TaxIDType param.Field[string]`

    Type of the tax identification number (e.g. eu_vat, us_ein, gb_vat, au_abn). Optional.

### Returns

- `type OrganizationAddress struct{…}`

  Organization address details.

  - `ID string`

    Address ID.

  - `City string`

    City or locality.

  - `Country string`

    Two-letter ISO 3166-1 alpha-2 country code.

  - `CreatedAt Time`

    When the address was created.

  - `Line1 string`

    First line of the street address.

  - `Line2 string`

    Second line of the street address. Null when not provided.

  - `OrganizationID string`

    Organization ID the address belongs to.

  - `PostalCode string`

    Postal or ZIP code.

  - `State string`

    State, province, or region. Null when not provided.

  - `TaxID string`

    Tax identification number. Null when not provided.

  - `TaxIDType string`

    Type of the tax identification number. Null when not provided.

  - `UpdatedAt Time`

    When the address was updated.

### 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"),
  )
  organizationAddress, err := client.Organizations.Address.New(
    context.TODO(),
    "organization_id",
    organizations.AddressNewParams{
      City: "San Francisco",
      Country: "US",
      Line1: "123 Main St",
      PostalCode: "94105",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", organizationAddress.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "city": "San Francisco",
  "country": "US",
  "created_at": "2025-01-01T00:00:00Z",
  "line1": "123 Main St",
  "line2": "Suite 400",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "postal_code": "94105",
  "state": "CA",
  "tax_id": "EU372000000",
  "tax_id_type": "eu_vat",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Get Organization Address

`client.Organizations.Address.Get(ctx, organizationID) (*OrganizationAddress, error)`

**get** `/v1/organizations/{organization_id}/address`

Get the address for an organization

### Parameters

- `organizationID string`

### Returns

- `type OrganizationAddress struct{…}`

  Organization address details.

  - `ID string`

    Address ID.

  - `City string`

    City or locality.

  - `Country string`

    Two-letter ISO 3166-1 alpha-2 country code.

  - `CreatedAt Time`

    When the address was created.

  - `Line1 string`

    First line of the street address.

  - `Line2 string`

    Second line of the street address. Null when not provided.

  - `OrganizationID string`

    Organization ID the address belongs to.

  - `PostalCode string`

    Postal or ZIP code.

  - `State string`

    State, province, or region. Null when not provided.

  - `TaxID string`

    Tax identification number. Null when not provided.

  - `TaxIDType string`

    Type of the tax identification number. Null when not provided.

  - `UpdatedAt Time`

    When the address was updated.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/option"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  organizationAddress, err := client.Organizations.Address.Get(context.TODO(), "organization_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", organizationAddress.ID)
}
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "city": "San Francisco",
  "country": "US",
  "created_at": "2025-01-01T00:00:00Z",
  "line1": "123 Main St",
  "line2": "Suite 400",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "postal_code": "94105",
  "state": "CA",
  "tax_id": "EU372000000",
  "tax_id_type": "eu_vat",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Update Organization Address

`client.Organizations.Address.Update(ctx, organizationID, body) (*OrganizationAddress, error)`

**patch** `/v1/organizations/{organization_id}/address`

Update the address for an organization

### Parameters

- `organizationID string`

- `body AddressUpdateParams`

  - `City param.Field[string]`

    City or locality.

  - `Country param.Field[string]`

    Two-letter ISO 3166-1 alpha-2 country code.

  - `Line1 param.Field[string]`

    First line of the street address.

  - `Line2 param.Field[string]`

    Second line of the street address (suite, unit, building). Omit to leave
    unchanged, send null to clear, or send a value to set it.

  - `PostalCode param.Field[string]`

    Postal or ZIP code.

  - `State param.Field[string]`

    State, province, or region. Omit to leave unchanged, send null to clear,
    or send a value to set it.

  - `TaxID param.Field[string]`

    Tax identification number (e.g. VAT, EIN, ABN). Omit to leave unchanged,
    send null to clear, or send a value to set it.

  - `TaxIDType param.Field[string]`

    Type of the tax identification number (e.g. eu_vat, us_ein, gb_vat, au_abn).
    Omit to leave unchanged, send null to clear, or send a value to set it.

### Returns

- `type OrganizationAddress struct{…}`

  Organization address details.

  - `ID string`

    Address ID.

  - `City string`

    City or locality.

  - `Country string`

    Two-letter ISO 3166-1 alpha-2 country code.

  - `CreatedAt Time`

    When the address was created.

  - `Line1 string`

    First line of the street address.

  - `Line2 string`

    Second line of the street address. Null when not provided.

  - `OrganizationID string`

    Organization ID the address belongs to.

  - `PostalCode string`

    Postal or ZIP code.

  - `State string`

    State, province, or region. Null when not provided.

  - `TaxID string`

    Tax identification number. Null when not provided.

  - `TaxIDType string`

    Type of the tax identification number. Null when not provided.

  - `UpdatedAt Time`

    When the address was updated.

### 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"),
  )
  organizationAddress, err := client.Organizations.Address.Update(
    context.TODO(),
    "organization_id",
    organizations.AddressUpdateParams{

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

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "city": "San Francisco",
  "country": "US",
  "created_at": "2025-01-01T00:00:00Z",
  "line1": "123 Main St",
  "line2": "Suite 400",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "postal_code": "94105",
  "state": "CA",
  "tax_id": "EU372000000",
  "tax_id_type": "eu_vat",
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Domain Types

### Organization Address

- `type OrganizationAddress struct{…}`

  Organization address details.

  - `ID string`

    Address ID.

  - `City string`

    City or locality.

  - `Country string`

    Two-letter ISO 3166-1 alpha-2 country code.

  - `CreatedAt Time`

    When the address was created.

  - `Line1 string`

    First line of the street address.

  - `Line2 string`

    Second line of the street address. Null when not provided.

  - `OrganizationID string`

    Organization ID the address belongs to.

  - `PostalCode string`

    Postal or ZIP code.

  - `State string`

    State, province, or region. Null when not provided.

  - `TaxID string`

    Tax identification number. Null when not provided.

  - `TaxIDType string`

    Type of the tax identification number. Null when not provided.

  - `UpdatedAt Time`

    When the address was updated.
