> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Create Customer

POST https://your_store.example.com/api/storefront/customers
Content-Type: application/json

Create a *Customer*.

> #### Note
> * Substitute your storefront domain for `yourstore.example.com`. 
> * The Send a Test Request feature is not currently supported for this endpoint.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/storefront/customers/create-customer

## Request

### Body (application/json)

This endpoint expects a CustomerCreateData.

- `firstName` (string, optional) — First name of customer.
- `lastName` (string, optional) — Last name of customer.
- `email` (string, optional) — Email of customer.
- `password` (string, optional) — Password of customer.
- `acceptsMarketingEmails` (boolean, optional) — Indicates whether customer provided consent to receive marketing emails.
- `token` (string, optional) — A valid [reCAPTCHA](/developer/docs/storefront/guides/graphql-storefront-api#recaptcha) token from a successful verification response.
- `customFields` (list of CustomFields, optional)

## Response

### 204

Customer successfully created.

## Errors

### 400 Bad Request Error

Could not create customer.

- `any`

### 409 Conflict Error

Thereʼs already an account for the provided email. Please enter a different email address or sign in.

- `any`

### 422 Unprocessable Entity Error

Missing Required Fields.

- `any`

### 429 Too Many Requests Error

Spam Protection Failed.

- `any`

## Types

### CustomFields

- `fieldId` (string, optional)
- `fieldValue` (CustomFieldsFieldValue, optional)

### CustomFieldsFieldValue

## Examples

**Request**

```json
{
  "firstName": "Jane",
  "lastName": "Doe",
  "email": "janedoe@example.com",
  "password": "string",
  "acceptsMarketingEmails": true,
  "customFields": [
    {
      "fieldId": "25",
      "fieldValue": "Leave in backyard"
    }
  ]
}
```

**SDK Code**

```python application/json
import requests

url = "https://your_store.example.com/api/storefront/customers"

payload = {
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "janedoe@example.com",
    "password": "string",
    "acceptsMarketingEmails": True,
    "customFields": [
        {
            "fieldId": "25",
            "fieldValue": "Leave in backyard"
        }
    ]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript application/json
const url = 'https://your_store.example.com/api/storefront/customers';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"firstName":"Jane","lastName":"Doe","email":"janedoe@example.com","password":"string","acceptsMarketingEmails":true,"customFields":[{"fieldId":"25","fieldValue":"Leave in backyard"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go application/json
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://your_store.example.com/api/storefront/customers"

	payload := strings.NewReader("{\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"email\": \"janedoe@example.com\",\n  \"password\": \"string\",\n  \"acceptsMarketingEmails\": true,\n  \"customFields\": [\n    {\n      \"fieldId\": \"25\",\n      \"fieldValue\": \"Leave in backyard\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby application/json
require 'uri'
require 'net/http'

url = URI("https://your_store.example.com/api/storefront/customers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"email\": \"janedoe@example.com\",\n  \"password\": \"string\",\n  \"acceptsMarketingEmails\": true,\n  \"customFields\": [\n    {\n      \"fieldId\": \"25\",\n      \"fieldValue\": \"Leave in backyard\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java application/json
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://your_store.example.com/api/storefront/customers")
  .header("Content-Type", "application/json")
  .body("{\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"email\": \"janedoe@example.com\",\n  \"password\": \"string\",\n  \"acceptsMarketingEmails\": true,\n  \"customFields\": [\n    {\n      \"fieldId\": \"25\",\n      \"fieldValue\": \"Leave in backyard\"\n    }\n  ]\n}")
  .asString();
```

```php application/json
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://your_store.example.com/api/storefront/customers', [
  'body' => '{
  "firstName": "Jane",
  "lastName": "Doe",
  "email": "janedoe@example.com",
  "password": "string",
  "acceptsMarketingEmails": true,
  "customFields": [
    {
      "fieldId": "25",
      "fieldValue": "Leave in backyard"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp application/json
using RestSharp;

var client = new RestClient("https://your_store.example.com/api/storefront/customers");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"email\": \"janedoe@example.com\",\n  \"password\": \"string\",\n  \"acceptsMarketingEmails\": true,\n  \"customFields\": [\n    {\n      \"fieldId\": \"25\",\n      \"fieldValue\": \"Leave in backyard\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift application/json
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "firstName": "Jane",
  "lastName": "Doe",
  "email": "janedoe@example.com",
  "password": "string",
  "acceptsMarketingEmails": true,
  "customFields": [
    [
      "fieldId": "25",
      "fieldValue": "Leave in backyard"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://your_store.example.com/api/storefront/customers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```