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

# Create

POST https://restapi.ordergroove.com/customers/create/
Content-Type: application/json

Creates a customer and returns it with `201`.

This endpoint accepts the Application API Scope only. Storefront API Scope signatures are rejected. `merchant` must be your merchant public ID, or the request returns `403`.

Only `merchant` is always required. Your merchant account's required-field settings can also require `merchant_user_id`, `first_name`, `last_name`, `email`, or other fields, and a missing one returns `400`.

If a customer with this `merchant_user_id` already exists, nothing is created or changed. A request with the same `merchant_user_id`, `email`, and `user_token_id` as that customer returns `400`; any other request returns `201` with the existing customer as it was.

Reference: https://docs.ordergroove.com/reference/rest-rpc-api/customers/create

## Authentication

- `x-api-key` header (required) — Application API Scope — server-to-server, sent in the `x-api-key` header. See [Authentication](/api-reference/authentication).

## Request

### Body (application/json)

This endpoint expects an object.

- `merchant` (string, required) — Your merchant public ID. It must match the merchant you authenticate as, or the request returns `403`.
- `merchant_user_id` (string, optional) — Your customer's ID in your ecommerce platform. The other customer endpoints look customers up by this ID.
- `session_id` (string, optional) — Session ID, from the `og_session_id` cookie. Ordergroove generates one if you leave it out.
- `user_token_id` (string, optional) — User Token ID
- `first_name` (string, optional) — Customer first name
- `last_name` (string, optional) — Customer last name
- `email` (string, optional) — Customer email
- `phone_number` (string, optional) — Customer phone number
- `phone_type` (integer, optional) — Customer phone type: `0` (invalid), `1` (landline), `2` (mobile), or `3` (VoIP)
- `live` (boolean, optional) — Whether the customer account is active. Defaults to `true`.
- `extra_data` (string, optional) — Extra information to store on the customer, as a JSON-encoded string of key/value pairs, up to 1,024 characters.
- `locale` (CustomersCreatePostRequestBodyContentApplicationJsonSchemaLocale, optional, nullable) — The customer's locale, as a locale code such as `en-us` or a numeric locale ID. Codes are case-insensitive, and hyphens and underscores are interchangeable. Responses always return the numeric ID.
- `experiences` (map from string to boolean, optional) — Experiences to check the customer against, keyed by experience name, for example `{"reorder": true}`. For each key, Ordergroove checks that the request includes every field your merchant account's settings require for that experience, and returns `400` if any is missing. The values are ignored, and experiences aren't saved on the customer.
- `price_code` (string, optional) — Customer price code

## Response

### 201

201

- `merchant` (string, optional) — Your merchant public ID.
- `merchant_user_id` (string, optional) — Your customer's ID in your ecommerce platform.
- `session_id` (string, optional) — Session ID, from the request or generated by Ordergroove.
- `user_token_id` (string, optional) — User Token ID. Empty if none was sent.
- `first_name` (string, optional) — Customer first name
- `last_name` (string, optional) — Customer last name
- `email` (string, optional) — Customer email
- `phone_number` (string, optional, nullable) — Customer phone number
- `phone_type` (integer, optional, nullable) — Customer phone type: `0` (invalid), `1` (landline), `2` (mobile), or `3` (VoIP)
- `live` (boolean, optional) — Whether the customer account is active.
- `created` (string, optional) — When the customer was created.
- `last_updated` (string, optional) — When the customer was last updated.
- `last_login` (string, optional, nullable) — When the customer last logged in. `null` until they do.
- `extra_data` (string, optional, nullable) — Extra information stored on the customer, as a JSON-encoded string.
- `locale` (integer, optional, nullable) — The customer's locale as a numeric ID, for example `1` for `en-us`, even if the request sent a locale code.
- `price_code` (string, optional, nullable) — Customer price code

## Errors

### 400 Bad Request Error

400

- `map from string to any`

### 403 Forbidden Error

403

- `detail` (string, optional)

## Types

### CustomersCreatePostRequestBodyContentApplicationJsonSchemaLocale

The customer's locale, as a locale code such as `en-us` or a numeric locale ID. Codes are case-insensitive, and hyphens and underscores are interchangeable. Responses always return the numeric ID.

- string
- integer

## Examples

### Result

**Response**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "merchant_user_id": "00026001",
  "session_id": "ac4f7938383a11e89ecbbc764e1107f2.48213.1791561600",
  "user_token_id": "",
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "jane.doe@example.com",
  "phone_number": "+12125550123",
  "phone_type": 2,
  "live": true,
  "created": "2026-10-09 10:20:00",
  "last_updated": "2026-10-09 10:20:00",
  "last_login": null,
  "extra_data": null,
  "locale": 1,
  "price_code": null
}
```

**SDK Code**

```python Result
import requests

url = "https://restapi.ordergroove.com/customers/create/"

headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript Result
const url = 'https://restapi.ordergroove.com/customers/create/';
const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

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

```go Result
package main

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

func main() {

	url := "https://restapi.ordergroove.com/customers/create/"

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Result
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/customers/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'

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

```java Result
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/customers/create/")
  .header("x-api-key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/customers/create/', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Result
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/customers/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Result
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/customers/create/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

### Request Example

**Request**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "merchant_user_id": "00026001",
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "jane.doe@example.com",
  "phone_number": "+12125550123",
  "phone_type": 2,
  "locale": "en-us",
  "experiences": {
    "reorder": true
  }
}
```

**Response**

```json
{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "merchant_user_id": "00026001",
  "session_id": "ac4f7938383a11e89ecbbc764e1107f2.48213.1791561600",
  "user_token_id": "",
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "jane.doe@example.com",
  "phone_number": "+12125550123",
  "phone_type": 2,
  "live": true,
  "created": "2026-10-09 10:20:00",
  "last_updated": "2026-10-09 10:20:00",
  "last_login": null,
  "extra_data": null,
  "locale": 1,
  "price_code": null
}
```

**SDK Code**

```python Request Example
import requests

url = "https://restapi.ordergroove.com/customers/create/"

payload = {
    "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
    "merchant_user_id": "00026001",
    "first_name": "Jane",
    "last_name": "Doe",
    "email": "jane.doe@example.com",
    "phone_number": "+12125550123",
    "phone_type": 2,
    "locale": "en-us",
    "experiences": { "reorder": True }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Request Example
const url = 'https://restapi.ordergroove.com/customers/create/';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"merchant":"ac4f7938383a11e89ecbbc764e1107f2","merchant_user_id":"00026001","first_name":"Jane","last_name":"Doe","email":"jane.doe@example.com","phone_number":"+12125550123","phone_type":2,"locale":"en-us","experiences":{"reorder":true}}'
};

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

```go Request Example
package main

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

func main() {

	url := "https://restapi.ordergroove.com/customers/create/"

	payload := strings.NewReader("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"merchant_user_id\": \"00026001\",\n  \"first_name\": \"Jane\",\n  \"last_name\": \"Doe\",\n  \"email\": \"jane.doe@example.com\",\n  \"phone_number\": \"+12125550123\",\n  \"phone_type\": 2,\n  \"locale\": \"en-us\",\n  \"experiences\": {\n    \"reorder\": true\n  }\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	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 Request Example
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/customers/create/")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"merchant_user_id\": \"00026001\",\n  \"first_name\": \"Jane\",\n  \"last_name\": \"Doe\",\n  \"email\": \"jane.doe@example.com\",\n  \"phone_number\": \"+12125550123\",\n  \"phone_type\": 2,\n  \"locale\": \"en-us\",\n  \"experiences\": {\n    \"reorder\": true\n  }\n}"

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

```java Request Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://restapi.ordergroove.com/customers/create/")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"merchant_user_id\": \"00026001\",\n  \"first_name\": \"Jane\",\n  \"last_name\": \"Doe\",\n  \"email\": \"jane.doe@example.com\",\n  \"phone_number\": \"+12125550123\",\n  \"phone_type\": 2,\n  \"locale\": \"en-us\",\n  \"experiences\": {\n    \"reorder\": true\n  }\n}")
  .asString();
```

```php Request Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://restapi.ordergroove.com/customers/create/', [
  'body' => '{
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "merchant_user_id": "00026001",
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "jane.doe@example.com",
  "phone_number": "+12125550123",
  "phone_type": 2,
  "locale": "en-us",
  "experiences": {
    "reorder": true
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Request Example
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/customers/create/");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchant\": \"ac4f7938383a11e89ecbbc764e1107f2\",\n  \"merchant_user_id\": \"00026001\",\n  \"first_name\": \"Jane\",\n  \"last_name\": \"Doe\",\n  \"email\": \"jane.doe@example.com\",\n  \"phone_number\": \"+12125550123\",\n  \"phone_type\": 2,\n  \"locale\": \"en-us\",\n  \"experiences\": {\n    \"reorder\": true\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Request Example
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "merchant": "ac4f7938383a11e89ecbbc764e1107f2",
  "merchant_user_id": "00026001",
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "jane.doe@example.com",
  "phone_number": "+12125550123",
  "phone_type": 2,
  "locale": "en-us",
  "experiences": ["reorder": true]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/customers/create/")! 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()
```