---
title: Customer Model
description: A customer is a user who is being billed for a subscription. This model includes information about the customer, such as their name, email, address, etc.
---

## Properties

:field-schema{schema="/types/customer/customer.type"}

## Code Example

::code-group
```typescript [Typescript (SDK)]
import { Integrator } from '@churnkey/sdk'
export class Customer extends Integrator.Customer {
    constructor(customer: YourCustomer) {
        super({
            id: customer.id,
            ... // map other properties
        })
    }
}
```
```typescript [Typescript]
import { Coupon } from './Coupon'

interface Customer {
    id: string
    name?: string
    lastName?: string
    email?: string
    phone?: string
    addresses?: Address[]
    discounts?: Discount[]
    currency?: string
    metadata?: Record<string, string>
}

interface Address {
    country?: string
    state?: string
    city?: string
    postalCode?: string
    line1?: string
    line2?: string
}

interface Discount {
    coupon: Coupon
    start?: Date
    end?: Date
}

export function Customer(customer: YourCustomer): Customer {
    return {
        id: customer.id,
        ... // map other properties
    }
}
```

```go [Go]
package models

import (
    "time"
)

type Customer struct {
    ID        string            `json:"id"`
    Name      *string           `json:"name"`
    LastName  *string           `json:"lastName"`
    Email     *string           `json:"email"`
    Phone     *string           `json:"phone"`
    Addresses []Address         `json:"addresses"`
    Discounts []Discount        `json:"discounts"`
    Currency  *string           `json:"currency"`
    Metadata  map[string]string `json:"metadata"`
}

type Address struct {
    Country    *string `json:"country"`
    State      *string `json:"state"`
    City       *string `json:"city"`
    PostalCode *string `json:"postalCode"`
    Line1      *string `json:"line1"`
    Line2      *string `json:"line2"`
}

type Discount struct {
    Coupon Coupon     `json:"coupon"`
    Start  *time.Time `json:"start"`
    End    *time.Time `json:"end"`
}

func Customer(customer YourCustomer) Customer {
    return Customer{
        ID:        customer.ID,
        // map other properties
    }
}
```
::