Batch create customers
curl --request POST \
--url https://commet.co/api/v1/customers/batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customers": [
{
"billingEmail": "jsmith@example.com",
"id": "<string>",
"externalId": "<string>",
"fullName": "<string>",
"taxDocument": "<string>",
"businessTaxId": "<string>",
"timezone": "UTC",
"metadata": {}
}
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customers: [
{
billingEmail: 'jsmith@example.com',
id: '<string>',
externalId: '<string>',
fullName: '<string>',
taxDocument: '<string>',
businessTaxId: '<string>',
timezone: 'UTC',
metadata: {}
}
]
})
};
fetch('https://commet.co/api/v1/customers/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/customers/batch"
payload = { "customers": [
{
"billingEmail": "jsmith@example.com",
"id": "<string>",
"externalId": "<string>",
"fullName": "<string>",
"taxDocument": "<string>",
"businessTaxId": "<string>",
"timezone": "UTC",
"metadata": {}
}
] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/customers/batch"
payload := strings.NewReader("{\n \"customers\": [\n {\n \"billingEmail\": \"jsmith@example.com\",\n \"id\": \"<string>\",\n \"externalId\": \"<string>\",\n \"fullName\": \"<string>\",\n \"taxDocument\": \"<string>\",\n \"businessTaxId\": \"<string>\",\n \"timezone\": \"UTC\",\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://commet.co/api/v1/customers/batch")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customers\": [\n {\n \"billingEmail\": \"jsmith@example.com\",\n \"id\": \"<string>\",\n \"externalId\": \"<string>\",\n \"fullName\": \"<string>\",\n \"taxDocument\": \"<string>\",\n \"businessTaxId\": \"<string>\",\n \"timezone\": \"UTC\",\n \"metadata\": {}\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/customers/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customers' => [
[
'billingEmail' => 'jsmith@example.com',
'id' => '<string>',
'externalId' => '<string>',
'fullName' => '<string>',
'taxDocument' => '<string>',
'businessTaxId' => '<string>',
'timezone' => 'UTC',
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"successful": [
{
"id": "<string>",
"externalId": "<string>",
"billingEmail": "<string>"
}
],
"failed": [
{
"index": 0,
"error": "<string>",
"data": {
"billingEmail": "<string>",
"id": "<string>",
"externalId": "<string>",
"fullName": "<string>",
"taxDocument": "<string>",
"businessTaxId": "<string>",
"timezone": "<string>",
"metadata": {},
"address": {
"line1": "<string>",
"city": "<string>",
"postalCode": "<string>",
"country": "<string>",
"line2": "<string>",
"state": "<string>",
"region": "<string>"
}
}
}
]
}
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}Customers
Batch create customers
Create up to 100 customers in a single request. With planGroupId, each customer without an open subscription starts on that group’s starting plan (see planGroupId), and the entry of a deleted customer fails with customer_deleted.
POST
/
customers
/
batch
Batch create customers
curl --request POST \
--url https://commet.co/api/v1/customers/batch \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customers": [
{
"billingEmail": "jsmith@example.com",
"id": "<string>",
"externalId": "<string>",
"fullName": "<string>",
"taxDocument": "<string>",
"businessTaxId": "<string>",
"timezone": "UTC",
"metadata": {}
}
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customers: [
{
billingEmail: 'jsmith@example.com',
id: '<string>',
externalId: '<string>',
fullName: '<string>',
taxDocument: '<string>',
businessTaxId: '<string>',
timezone: 'UTC',
metadata: {}
}
]
})
};
fetch('https://commet.co/api/v1/customers/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/customers/batch"
payload = { "customers": [
{
"billingEmail": "jsmith@example.com",
"id": "<string>",
"externalId": "<string>",
"fullName": "<string>",
"taxDocument": "<string>",
"businessTaxId": "<string>",
"timezone": "UTC",
"metadata": {}
}
] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/customers/batch"
payload := strings.NewReader("{\n \"customers\": [\n {\n \"billingEmail\": \"jsmith@example.com\",\n \"id\": \"<string>\",\n \"externalId\": \"<string>\",\n \"fullName\": \"<string>\",\n \"taxDocument\": \"<string>\",\n \"businessTaxId\": \"<string>\",\n \"timezone\": \"UTC\",\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://commet.co/api/v1/customers/batch")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customers\": [\n {\n \"billingEmail\": \"jsmith@example.com\",\n \"id\": \"<string>\",\n \"externalId\": \"<string>\",\n \"fullName\": \"<string>\",\n \"taxDocument\": \"<string>\",\n \"businessTaxId\": \"<string>\",\n \"timezone\": \"UTC\",\n \"metadata\": {}\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/customers/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customers' => [
[
'billingEmail' => 'jsmith@example.com',
'id' => '<string>',
'externalId' => '<string>',
'fullName' => '<string>',
'taxDocument' => '<string>',
'businessTaxId' => '<string>',
'timezone' => 'UTC',
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"successful": [
{
"id": "<string>",
"externalId": "<string>",
"billingEmail": "<string>"
}
],
"failed": [
{
"index": 0,
"error": "<string>",
"data": {
"billingEmail": "<string>",
"id": "<string>",
"externalId": "<string>",
"fullName": "<string>",
"taxDocument": "<string>",
"businessTaxId": "<string>",
"timezone": "<string>",
"metadata": {},
"address": {
"line1": "<string>",
"city": "<string>",
"postalCode": "<string>",
"country": "<string>",
"line2": "<string>",
"state": "<string>",
"region": "<string>"
}
}
}
]
}
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}This reference describes API version
2026-05-18. Send Commet-Version: 2026-05-18 with your request.Headers
Body
application/json
Plan group whose starting plan the customer starts on when it has no open subscription: its signup trial, a trial without a payment method, when the group has one and the customer never had that plan, otherwise its default plan. A customer who already had the signup trial plan in a group without a default plan starts on none. Without it, no plan is assigned.
Minimum string length:
1Was this page helpful?