# Get a customer

Returns a customer with the reference, the email address and the name.

`GET /v1/customers/{customer}`

## Use cases

- Read the email address of the customer who owns a license, to send the customer a message.
- Check that a customer ID that your backend stored still exists.
- Read the reference of a customer, to find the user in your own system.

## Authentication

Send an API key. This endpoint requires the scope `customers:read`. See [Authentication](../../authentication/) and [Scopes](../../integrations-and-scopes/#scopes).

Customers belong to your account, not to one product. An integration that is limited to one product can get every customer. See [Product](../../integrations-and-scopes/#product).

## Request

### Path parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `customer` | string | The ID of the customer. |

### Headers

| Header | Required | Description |
| --- | --- | --- |
| `Authorization` | Yes | The word `Bearer`, a space and the API key. |

## Response

The answer has the status 200.

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The ID of the customer. |
| `external_ref` | string | The ID of the customer in your own system. See [References](../../../concepts/customers/#references). |
| `email` | string or null | The email address of the customer. |
| `first_name` | string or null | The first name of the customer. |
| `last_name` | string or null | The last name of the customer. |
| `created_at` | string | The time when the customer was created. |
| `updated_at` | string | The time when the customer was last changed. |

## Errors

| Status | Reason | Description |
| --- | --- | --- |
| 401 | `An API key is required.` | The request has no `Authorization` header, the header is empty, or the header does not use the `Bearer` scheme. |
| 401 | `The API key is not valid.` | No integration has this key. |
| 401 | `The API key has expired.` | The expiry date of the key has passed. |
| 403 | `This integration does not have the customers:read scope.` | The integration has neither `customers:read` nor `customers:write`. |
| 404 | `The customer was not found.` | No customer in your account has this ID. |
| 429 | `There are too many requests. Try again later.` | See [Rate limits](../../#rate-limits). |

See [Errors](../../#errors).

## Example

{{< tabs >}}
{{< tab name="curl" >}}
```bash
curl https://api.seatify.dev/v1/customers/$CUSTOMER_ID \
  -H "Authorization: Bearer $SEATIFY_API_KEY"
```
{{< /tab >}}
{{< tab name="Swift" >}}
```swift
import Foundation

struct Customer: Decodable {
    let id: String
    let externalRef: String
    let email: String?

    enum CodingKeys: String, CodingKey {
        case id, email
        case externalRef = "external_ref"
    }
}

let url = URL(string: "https://api.seatify.dev/v1/customers/\(customerID)")!
var request = URLRequest(url: url)
request.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")

let (data, _) = try await URLSession.shared.data(for: request)
let customer = try JSONDecoder().decode(Customer.self, from: data)
```
{{< /tab >}}
{{< tab name="C#" >}}
```csharp
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json.Serialization;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);

var customer = await client.GetFromJsonAsync<Customer>($"https://api.seatify.dev/v1/customers/{customerId}");

record Customer(string Id, [property: JsonPropertyName("external_ref")] string ExternalRef, string? Email);
```
{{< /tab >}}
{{< tab name="Go" >}}
```go
req, err := http.NewRequest("GET", "https://api.seatify.dev/v1/customers/"+customerID, nil)
if err != nil {
	return err
}
req.Header.Set("Authorization", "Bearer "+apiKey)

res, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer res.Body.Close()

var customer struct {
	ID          string  `json:"id"`
	ExternalRef string  `json:"external_ref"`
	Email       *string `json:"email"`
}
err = json.NewDecoder(res.Body).Decode(&customer)
```
{{< /tab >}}
{{< tab name="JavaScript" >}}
```javascript
const response = await fetch(`https://api.seatify.dev/v1/customers/${customerId}`, {
  headers: { Authorization: `Bearer ${apiKey}` },
});
const customer = await response.json();
```
{{< /tab >}}
{{< /tabs >}}

The answer:

```json
{
  "id": "<customer id>",
  "external_ref": "usr_000001",
  "email": "anders.petrenko0@brightwater.example",
  "first_name": "Anders",
  "last_name": "Petrenko",
  "created_at": "2025-03-18T23:00:00Z",
  "updated_at": "2025-03-18T23:00:00Z"
}
```

