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

# Create Customer

POST {{baseUrl}}/customers
Content-Type: application/json

Create a new customer record.

Reference: https://docs.a1.uk.astutepayroll.in/api-reference/customer/create-customer

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Headers

- `vnd.a1.tenant-id` (string, optional) — Tenant identifier for multi-tenant environments

### Body (application/json)

This endpoint expects a CustomerCreate.

- `entityName` (string, required) — Company legal name
- `tradingName` (string, required) — Trading name
- `companyUuid` (string, required)
- `regionCode` (string, optional) — Region code
- `address` (CustomerCreateAddress, optional) — Company address
- `email` (string, optional)
- `contactName` (string, optional)
- `remoteId` (integer, optional) — ID from an external system
- `phone` (Phone, optional)
- `registrationNumber` (string, optional)
- `invoiceTermLength` (integer, optional) — Payment terms in days
- `salesInvoiceDescriptionText` (string, optional)
- `parentUuid` (string, optional) — UUID of a parent customer
- `invoiceTaxUuid` (string, optional)
- `billingGroupName` (string, optional)
- `billingGroupInvoiceName` (string, optional)
- `billingGroupPrimaryEmail` (string, optional)
- `billingGroupAdditionalEmailRecipients` (string, optional)
- `billingGroupUuid` (string, optional)

## Response

### 201

Customer created successfully

- `uuid` (string, optional)
- `entityName` (string, optional)
- `tradingName` (string, optional)
- `regionCode` (string, optional)
- `address` (CustomerResponseAddress, optional)
- `email` (string, optional)
- `contactName` (string, optional)
- `remoteId` (integer, optional)
- `phone` (Phone, optional)
- `registrationNumber` (string, optional)
- `invoiceTermLength` (integer, optional)
- `salesInvoiceDescriptionText` (string, optional)
- `parentUuid` (string, optional)
- `invoiceTaxUuid` (string, optional)
- `companyUuid` (string, optional)
- `billingGroupName` (string, optional)
- `billingGroupInvoiceName` (string, optional)
- `billingGroupPrimaryEmail` (string, optional)
- `billingGroupAdditionalEmailRecipients` (string, optional)
- `billingGroupUuid` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request — validation error

- `any`

## Types

### CustomerCreateAddress

Company address

- `line1` (string, optional)
- `line2` (string, optional)
- `townCity` (string, optional)
- `country` (string, optional)
- `foreignCountry` (string, optional) — Required when country is OutsideUK
- `postcode` (string, optional)

### Phone

- `countryCode` (string, optional)
- `number` (string, optional)

### CustomerResponseAddress

- `line1` (string, optional)
- `line2` (string, optional)
- `townCity` (string, optional)
- `country` (string, optional)
- `foreignCountry` (string, optional)
- `postcode` (string, optional)

## Examples

**Request**

```json
{
  "entityName": "Acme Corp",
  "tradingName": "Acme",
  "companyUuid": "a169f209-b362-4a01-add2-c7bd7f0be6cb",
  "regionCode": "GBR",
  "address": {
    "line1": "10 High Street",
    "line2": "",
    "townCity": "London",
    "country": "England",
    "postcode": "SW1A 1AA"
  },
  "email": "billing@acme.com",
  "contactName": "Jane Smith",
  "phone": {
    "countryCode": "44",
    "number": "1234567890"
  }
}
```

**Response**

```json
{
  "uuid": "45b0d09b-bc25-4b45-af21-dc15cba56ce2",
  "entityName": "Acme Corp",
  "tradingName": "Acme",
  "regionCode": "GBR",
  "address": {
    "line1": "10 High Street",
    "line2": "string",
    "townCity": "London",
    "country": "England",
    "foreignCountry": "string",
    "postcode": "SW1A 1AA"
  },
  "email": "billing@acme.com",
  "contactName": "Jane Smith",
  "remoteId": 1,
  "phone": {
    "countryCode": "44",
    "number": "1234567890"
  },
  "registrationNumber": "AA123234",
  "invoiceTermLength": 30,
  "salesInvoiceDescriptionText": "string",
  "parentUuid": "string",
  "invoiceTaxUuid": "string",
  "companyUuid": "string",
  "billingGroupName": "string",
  "billingGroupInvoiceName": "string",
  "billingGroupPrimaryEmail": "string",
  "billingGroupAdditionalEmailRecipients": "string",
  "billingGroupUuid": "string"
}
```

**SDK Code**

```python
import requests

url = "https://{{baseurl}}/customers"

payload = {
    "entityName": "Acme Corp",
    "tradingName": "Acme",
    "companyUuid": "a169f209-b362-4a01-add2-c7bd7f0be6cb",
    "regionCode": "GBR",
    "address": {
        "line1": "10 High Street",
        "line2": "",
        "townCity": "London",
        "country": "England",
        "postcode": "SW1A 1AA"
    },
    "email": "billing@acme.com",
    "contactName": "Jane Smith",
    "phone": {
        "countryCode": "44",
        "number": "1234567890"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://{{baseurl}}/customers';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"entityName":"Acme Corp","tradingName":"Acme","companyUuid":"a169f209-b362-4a01-add2-c7bd7f0be6cb","regionCode":"GBR","address":{"line1":"10 High Street","line2":"","townCity":"London","country":"England","postcode":"SW1A 1AA"},"email":"billing@acme.com","contactName":"Jane Smith","phone":{"countryCode":"44","number":"1234567890"}}'
};

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

```go
package main

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

func main() {

	url := "https://{{baseurl}}/customers"

	payload := strings.NewReader("{\n  \"entityName\": \"Acme Corp\",\n  \"tradingName\": \"Acme\",\n  \"companyUuid\": \"a169f209-b362-4a01-add2-c7bd7f0be6cb\",\n  \"regionCode\": \"GBR\",\n  \"address\": {\n    \"line1\": \"10 High Street\",\n    \"line2\": \"\",\n    \"townCity\": \"London\",\n    \"country\": \"England\",\n    \"postcode\": \"SW1A 1AA\"\n  },\n  \"email\": \"billing@acme.com\",\n  \"contactName\": \"Jane Smith\",\n  \"phone\": {\n    \"countryCode\": \"44\",\n    \"number\": \"1234567890\"\n  }\n}")

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

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

url = URI("https://{{baseurl}}/customers")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"entityName\": \"Acme Corp\",\n  \"tradingName\": \"Acme\",\n  \"companyUuid\": \"a169f209-b362-4a01-add2-c7bd7f0be6cb\",\n  \"regionCode\": \"GBR\",\n  \"address\": {\n    \"line1\": \"10 High Street\",\n    \"line2\": \"\",\n    \"townCity\": \"London\",\n    \"country\": \"England\",\n    \"postcode\": \"SW1A 1AA\"\n  },\n  \"email\": \"billing@acme.com\",\n  \"contactName\": \"Jane Smith\",\n  \"phone\": {\n    \"countryCode\": \"44\",\n    \"number\": \"1234567890\"\n  }\n}"

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

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

HttpResponse<String> response = Unirest.post("https://{{baseurl}}/customers")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"entityName\": \"Acme Corp\",\n  \"tradingName\": \"Acme\",\n  \"companyUuid\": \"a169f209-b362-4a01-add2-c7bd7f0be6cb\",\n  \"regionCode\": \"GBR\",\n  \"address\": {\n    \"line1\": \"10 High Street\",\n    \"line2\": \"\",\n    \"townCity\": \"London\",\n    \"country\": \"England\",\n    \"postcode\": \"SW1A 1AA\"\n  },\n  \"email\": \"billing@acme.com\",\n  \"contactName\": \"Jane Smith\",\n  \"phone\": {\n    \"countryCode\": \"44\",\n    \"number\": \"1234567890\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://{{baseurl}}/customers', [
  'body' => '{
  "entityName": "Acme Corp",
  "tradingName": "Acme",
  "companyUuid": "a169f209-b362-4a01-add2-c7bd7f0be6cb",
  "regionCode": "GBR",
  "address": {
    "line1": "10 High Street",
    "line2": "",
    "townCity": "London",
    "country": "England",
    "postcode": "SW1A 1AA"
  },
  "email": "billing@acme.com",
  "contactName": "Jane Smith",
  "phone": {
    "countryCode": "44",
    "number": "1234567890"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://{{baseurl}}/customers");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"entityName\": \"Acme Corp\",\n  \"tradingName\": \"Acme\",\n  \"companyUuid\": \"a169f209-b362-4a01-add2-c7bd7f0be6cb\",\n  \"regionCode\": \"GBR\",\n  \"address\": {\n    \"line1\": \"10 High Street\",\n    \"line2\": \"\",\n    \"townCity\": \"London\",\n    \"country\": \"England\",\n    \"postcode\": \"SW1A 1AA\"\n  },\n  \"email\": \"billing@acme.com\",\n  \"contactName\": \"Jane Smith\",\n  \"phone\": {\n    \"countryCode\": \"44\",\n    \"number\": \"1234567890\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "entityName": "Acme Corp",
  "tradingName": "Acme",
  "companyUuid": "a169f209-b362-4a01-add2-c7bd7f0be6cb",
  "regionCode": "GBR",
  "address": [
    "line1": "10 High Street",
    "line2": "",
    "townCity": "London",
    "country": "England",
    "postcode": "SW1A 1AA"
  ],
  "email": "billing@acme.com",
  "contactName": "Jane Smith",
  "phone": [
    "countryCode": "44",
    "number": "1234567890"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://{{baseurl}}/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()
```