# Create Customer Account

#### Headers

`X-API-KEY` **must** be provided when making this request. This authorizes you to access the API.

#### Request

`POST https://book.imin.co/api/v2/customer-accounts`

{% hint style="warning" %}
This request must be made Server-side. Otherwise, it would be possible to view the secret API key with a browser.
{% endhint %}

Body:&#x20;

```javascript
{
  "@context": "https://openactive.io/",
  "@type": "CustomerAccount",
  "customer": {
    "@type": "Person",
    "email": "geoffcapes@example.com",
    "telephone": "020 811 8055",
    "givenName": "Geoff",
    "familyName": "Capes",
    "birthDate": "1970-01-01",
    "gender": "https://schema.org/Female",
    "imin:is13OrOver": true,
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Raynes Park High School, 46A West Barnes Lane",
      "addressLocality": "New Malden",
      "addressRegion": "London",
      "postalCode": "NW5 3DU",
      "addressCountry": "GB"
    },
    "emergencyContact": {
      "@type": "Person",
      "name": "Ralph Capes",
      "telephone": "020 811 8055"
    }
  }
}
```

Required fields:

* `@context`
* `@type`
* `customer.['@type']`
* `customer.email`
* `customer.givenName`
* `customer.familyName`

#### Response

An example 201 response looks like:&#x20;

```javascript
{
  "@context": "https://openactive.io/",
  "@type": "CustomerAccount",
  "@id": "https://book.imin.co/api/v2/customer-accounts/abc",
  "identifier": "abc"
  "customer": {
    "@type": "Person",
    "email": "geoffcapes@example.com",
    "telephone": "020 811 8055",
    "givenName": "Geoff",
    "familyName": "Capes",
    "birthDate": "1970-01-01",
    "gender": "https://schema.org/Female",
    "imin:is13OrOver": true,
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "Raynes Park High School, 46A West Barnes Lane",
      "addressLocality": "New Malden",
      "addressRegion": "London",
      "postalCode": "NW5 3DU",
      "addressCountry": "GB"
    },
    "emergencyContact": {
      "@type": "Person",
      "name": "Ralph Capes",
      "telephone": "020 811 8055"
    }
  }
}
```

This mirrors the request but adds `@id` and `identifier`.

`identifier` can be used for other Booking API operations such as GET OrderItems By Customer ID.
