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

# Add customer

POST https://openapi.admoji.com/api/v2/open/customers
Content-Type: application/json

Create a new customer record. A customer must exist before a transaction can be run. Pass the `SessionID` from an `Add Click` call to track funnel attribution.


Reference: https://dev.admoji.com/api-reference/admoji-crm-api/customers/add-customer

## Authentication

- `Authorization` header (required) — Format: `ApiKey <your_key>`

## Servers

- `https://openapi.admoji.com` (Live, default)
- `https://openapi.staging.admoji.com` (Test)

## Request

### Headers

- `Idempotency-Key` (string, required) — UUID to prevent duplicate POST operations

### Body (application/json)

This endpoint expects an object.

- `SiteID` (integer, required)
- `FirstName` (string, optional)
- `LastName` (string, optional)
- `Email` (string, optional)
- `ExternalID` (string, optional)
- `Phone` (string, optional)
- `Address1` (string, optional)
- `Address2` (string, optional)
- `City` (string, optional)
- `State` (string, optional)
- `CountryISO` (string, optional)
- `ZipCode` (string, optional)
- `IpAddress` (string, optional)
- `AffiliateID` (string, optional)
- `SubAffiliateID` (string, optional)
- `SubAffiliateID2` (string, optional)
- `SubAffiliateID3` (string, optional)
- `SubAffiliateID4` (string, optional, nullable)
- `SubAffiliateID5` (string, optional, nullable)
- `MDFs` (list of ApiV2OpenCustomersPostRequestBodyContentApplicationJsonSchemaMdFsItems, optional)
- `CustomValue1` (string, optional, nullable)
- `CustomValue2` (string, optional, nullable)
- `CustomValue3` (string, optional, nullable)
- `CustomValue4` (string, optional, nullable)
- `CustomValue5` (string, optional, nullable)
- `SessionID` (string, optional, nullable) — Session ID from Add Click call for funnel tracking

## Response

### 200

Customer created

- `Status` (integer, optional)
- `CustomerID` (integer, optional)

## Types

### ApiV2OpenCustomersPostRequestBodyContentApplicationJsonSchemaMdFsItems

- `Name` (string, optional)
- `Value` (string, optional)

## Examples

**Request**

```json
{
  "SiteID": 1003998,
  "FirstName": "Winnie",
  "LastName": "Pooh",
  "Email": "email@gmail.com",
  "Phone": "1234567890",
  "IpAddress": "127.0.0.1",
  "SessionID": null
}
```

**Response**

```json
{
  "Status": 0,
  "CustomerID": 8982438
}
```

**SDK Code**

```python Customers_addCustomer_example
import requests

url = "https://openapi.admoji.com/api/v2/open/customers"

payload = {
    "SiteID": 1003998,
    "FirstName": "Winnie",
    "LastName": "Pooh",
    "Email": "email@gmail.com",
    "Phone": "1234567890",
    "IpAddress": "127.0.0.1",
    "SessionID": None
}
headers = {
    "Idempotency-Key": "Idempotency-Key",
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Customers_addCustomer_example
const url = 'https://openapi.admoji.com/api/v2/open/customers';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': 'Idempotency-Key',
    Authorization: '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"SiteID":1003998,"FirstName":"Winnie","LastName":"Pooh","Email":"email@gmail.com","Phone":"1234567890","IpAddress":"127.0.0.1","SessionID":null}'
};

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

```go Customers_addCustomer_example
package main

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

func main() {

	url := "https://openapi.admoji.com/api/v2/open/customers"

	payload := strings.NewReader("{\n  \"SiteID\": 1003998,\n  \"FirstName\": \"Winnie\",\n  \"LastName\": \"Pooh\",\n  \"Email\": \"email@gmail.com\",\n  \"Phone\": \"1234567890\",\n  \"IpAddress\": \"127.0.0.1\",\n  \"SessionID\": null\n}")

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

	req.Header.Add("Idempotency-Key", "Idempotency-Key")
	req.Header.Add("Authorization", "<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 Customers_addCustomer_example
require 'uri'
require 'net/http'

url = URI("https://openapi.admoji.com/api/v2/open/customers")

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

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'Idempotency-Key'
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"SiteID\": 1003998,\n  \"FirstName\": \"Winnie\",\n  \"LastName\": \"Pooh\",\n  \"Email\": \"email@gmail.com\",\n  \"Phone\": \"1234567890\",\n  \"IpAddress\": \"127.0.0.1\",\n  \"SessionID\": null\n}"

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

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

HttpResponse<String> response = Unirest.post("https://openapi.admoji.com/api/v2/open/customers")
  .header("Idempotency-Key", "Idempotency-Key")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"SiteID\": 1003998,\n  \"FirstName\": \"Winnie\",\n  \"LastName\": \"Pooh\",\n  \"Email\": \"email@gmail.com\",\n  \"Phone\": \"1234567890\",\n  \"IpAddress\": \"127.0.0.1\",\n  \"SessionID\": null\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://openapi.admoji.com/api/v2/open/customers', [
  'body' => '{
  "SiteID": 1003998,
  "FirstName": "Winnie",
  "LastName": "Pooh",
  "Email": "email@gmail.com",
  "Phone": "1234567890",
  "IpAddress": "127.0.0.1",
  "SessionID": null
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'Idempotency-Key',
  ],
]);

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

```csharp Customers_addCustomer_example
using RestSharp;

var client = new RestClient("https://openapi.admoji.com/api/v2/open/customers");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "Idempotency-Key");
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"SiteID\": 1003998,\n  \"FirstName\": \"Winnie\",\n  \"LastName\": \"Pooh\",\n  \"Email\": \"email@gmail.com\",\n  \"Phone\": \"1234567890\",\n  \"IpAddress\": \"127.0.0.1\",\n  \"SessionID\": null\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Customers_addCustomer_example
import Foundation

let headers = [
  "Idempotency-Key": "Idempotency-Key",
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "SiteID": 1003998,
  "FirstName": "Winnie",
  "LastName": "Pooh",
  "Email": "email@gmail.com",
  "Phone": "1234567890",
  "IpAddress": "127.0.0.1",
  "SessionID": 
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://openapi.admoji.com/api/v2/open/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()
```