# `MishkaPay.Address`
[🔗](https://github.com/mishka-group/mishka_pay/blob/v0.0.1/lib/mishka_pay/address.ex#L5)

A postal address: where a buyer lives for the tax (`MishkaPay.TaxCalculation`), or where a
checkout ships to (`MishkaPay.Checkout`'s `:shipping_address`). A guarded_struct.

  * `:country`: the two-letter ISO 3166-1 code, such as `"NL"`; the only field a tax
    calculation needs outside the US.
  * `:postal_code`: needed for a US address.
  * `:line1`, `:line2`, `:city`, `:state` (ISO 3166-2 when there is one, such as `"CA"`).
  * `:name`: the person it goes to, on a shipping address.

# `t`

```elixir
@type t() :: %MishkaPay.Address{
  city: String.t() | nil,
  country: String.t() | nil,
  line1: String.t() | nil,
  line2: String.t() | nil,
  name: String.t() | nil,
  postal_code: String.t() | nil,
  state: String.t() | nil
}
```

The struct that `builder/1` returns.

| Field | Type | Required | Default | Description | Derives |
| --- | --- | --- | --- | --- | --- |
| `:country` | `String.t()` \| `nil` | no |  |  | `sanitize(trim, upcase) validate(string, regex=^[A-Z]{2}$)` |
| `:postal_code` | `String.t()` \| `nil` | no |  |  | `sanitize(trim) validate(string, max_len=20)` |
| `:line1` | `String.t()` \| `nil` | no |  |  | `sanitize(trim) validate(string, max_len=200)` |
| `:line2` | `String.t()` \| `nil` | no |  |  | `sanitize(trim) validate(string, max_len=200)` |
| `:city` | `String.t()` \| `nil` | no |  |  | `sanitize(trim) validate(string, max_len=200)` |
| `:state` | `String.t()` \| `nil` | no |  |  | `sanitize(trim) validate(string, max_len=200)` |
| `:name` | `String.t()` \| `nil` | no |  |  | `sanitize(trim) validate(string, max_len=250)` |

# `builder`

# `enforce_keys`

# `enforce_keys`

# `example`

A sample %MishkaPay.Address{} populated from defaults + type-based fallbacks.

# `keys`

# `keys`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
