# 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.
