Create a customer
Creates a new customer with optional contacts, billing address, aliases, and a required default currency.
curl --request POST \
--url https://api.alguna.io/customers \
--header 'Alguna-Version: <alguna-version>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "USD",
"name": "Acme Corp",
"aliases": [
"<string>"
],
"billing_address": {
"city": "San Francisco",
"country": "USA",
"line1": "123 Main St",
"postal_code": "94105",
"state": "CA",
"line2": "Suite 100"
},
"contacts": [
{
"email": "john@example.com",
"is_primary": true,
"email_preferences": [
"<string>"
],
"first_name": "John",
"id": "<string>",
"last_name": "Doe"
}
]
}
'import requests
url = "https://api.alguna.io/customers"
payload = {
"currency": "USD",
"name": "Acme Corp",
"aliases": ["<string>"],
"billing_address": {
"city": "San Francisco",
"country": "USA",
"line1": "123 Main St",
"postal_code": "94105",
"state": "CA",
"line2": "Suite 100"
},
"contacts": [
{
"email": "john@example.com",
"is_primary": True,
"email_preferences": ["<string>"],
"first_name": "John",
"id": "<string>",
"last_name": "Doe"
}
]
}
headers = {
"Alguna-Version": "<alguna-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Alguna-Version': '<alguna-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
currency: 'USD',
name: 'Acme Corp',
aliases: ['<string>'],
billing_address: {
city: 'San Francisco',
country: 'USA',
line1: '123 Main St',
postal_code: '94105',
state: 'CA',
line2: 'Suite 100'
},
contacts: [
{
email: 'john@example.com',
is_primary: true,
email_preferences: ['<string>'],
first_name: 'John',
id: '<string>',
last_name: 'Doe'
}
]
})
};
fetch('https://api.alguna.io/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.alguna.io/customers",
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([
'currency' => 'USD',
'name' => 'Acme Corp',
'aliases' => [
'<string>'
],
'billing_address' => [
'city' => 'San Francisco',
'country' => 'USA',
'line1' => '123 Main St',
'postal_code' => '94105',
'state' => 'CA',
'line2' => 'Suite 100'
],
'contacts' => [
[
'email' => 'john@example.com',
'is_primary' => true,
'email_preferences' => [
'<string>'
],
'first_name' => 'John',
'id' => '<string>',
'last_name' => 'Doe'
]
]
]),
CURLOPT_HTTPHEADER => [
"Alguna-Version: <alguna-version>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.alguna.io/customers"
payload := strings.NewReader("{\n \"currency\": \"USD\",\n \"name\": \"Acme Corp\",\n \"aliases\": [\n \"<string>\"\n ],\n \"billing_address\": {\n \"city\": \"San Francisco\",\n \"country\": \"USA\",\n \"line1\": \"123 Main St\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\",\n \"line2\": \"Suite 100\"\n },\n \"contacts\": [\n {\n \"email\": \"john@example.com\",\n \"is_primary\": true,\n \"email_preferences\": [\n \"<string>\"\n ],\n \"first_name\": \"John\",\n \"id\": \"<string>\",\n \"last_name\": \"Doe\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Alguna-Version", "<alguna-version>")
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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.alguna.io/customers")
.header("Alguna-Version", "<alguna-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\",\n \"name\": \"Acme Corp\",\n \"aliases\": [\n \"<string>\"\n ],\n \"billing_address\": {\n \"city\": \"San Francisco\",\n \"country\": \"USA\",\n \"line1\": \"123 Main St\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\",\n \"line2\": \"Suite 100\"\n },\n \"contacts\": [\n {\n \"email\": \"john@example.com\",\n \"is_primary\": true,\n \"email_preferences\": [\n \"<string>\"\n ],\n \"first_name\": \"John\",\n \"id\": \"<string>\",\n \"last_name\": \"Doe\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alguna.io/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Alguna-Version"] = '<alguna-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\",\n \"name\": \"Acme Corp\",\n \"aliases\": [\n \"<string>\"\n ],\n \"billing_address\": {\n \"city\": \"San Francisco\",\n \"country\": \"USA\",\n \"line1\": \"123 Main St\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\",\n \"line2\": \"Suite 100\"\n },\n \"contacts\": [\n {\n \"email\": \"john@example.com\",\n \"is_primary\": true,\n \"email_preferences\": [\n \"<string>\"\n ],\n \"first_name\": \"John\",\n \"id\": \"<string>\",\n \"last_name\": \"Doe\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-04-01T10:00:00Z",
"currency": "USD",
"id": "cust_abc123",
"name": "Acme Corp",
"updated_at": "2026-04-01T12:30:00Z",
"aliases": [
"<string>"
],
"billing_address": {
"city": "San Francisco",
"country": "USA",
"line1": "123 Main St",
"postal_code": "94105",
"state": "CA",
"line2": "Suite 100"
},
"contacts": [
{
"email": "john@example.com",
"id": "cont_abc123",
"is_primary": true,
"email_preferences": [
"<string>"
],
"first_name": "John",
"last_name": "Doe"
}
],
"tax_country": "DE",
"tax_id": "DE123456789",
"tax_rate": "0.20",
"tax_reason": "standard_rated",
"tax_status": "taxable",
"tax_type": "vat"
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}Authorizations
API key authentication. Pass your API key as a Bearer token.
Headers
2026-04-01 A unique string used to ensure the request is processed exactly once. If you retry a request with the same idempotency key within 24 hours, the original response is returned without re-executing the operation.
255"ik_a1b2c3d4e5f6"
Body
ISO 4217 currency code
"USD"
The name of the customer
"Acme Corp"
Alternative identifiers for the customer
Customer billing address
Show child attributes
Show child attributes
Customer contacts
Show child attributes
Show child attributes
Response
Success
Timestamp when the customer was created
"2026-04-01T10:00:00Z"
ISO 4217 currency code
"USD"
Unique identifier for the customer
"cust_abc123"
Customer name
"Acme Corp"
Timestamp when the customer was last updated
"2026-04-01T12:30:00Z"
Alternative identifiers for the customer
Customer billing address
Show child attributes
Show child attributes
Customer contacts
Show child attributes
Show child attributes
ISO 3166-1 alpha-2 country code used for tax determination
"DE"
Customer tax identification number
"DE123456789"
Tax rate applied to the customer, expressed as a decimal fraction (0.20 = 20%)
"0.20"
Reason determining how tax is applied to the customer
standard_rated, reverse_charge, not_collecting, customer_exempt, zero_rated, other "standard_rated"
Customer tax status
"taxable"
Type of tax applied to the customer
gst, hst, igst, jct, lease_tax, pst, qst, sales_tax, service_tax, vat "vat"
curl --request POST \
--url https://api.alguna.io/customers \
--header 'Alguna-Version: <alguna-version>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "USD",
"name": "Acme Corp",
"aliases": [
"<string>"
],
"billing_address": {
"city": "San Francisco",
"country": "USA",
"line1": "123 Main St",
"postal_code": "94105",
"state": "CA",
"line2": "Suite 100"
},
"contacts": [
{
"email": "john@example.com",
"is_primary": true,
"email_preferences": [
"<string>"
],
"first_name": "John",
"id": "<string>",
"last_name": "Doe"
}
]
}
'import requests
url = "https://api.alguna.io/customers"
payload = {
"currency": "USD",
"name": "Acme Corp",
"aliases": ["<string>"],
"billing_address": {
"city": "San Francisco",
"country": "USA",
"line1": "123 Main St",
"postal_code": "94105",
"state": "CA",
"line2": "Suite 100"
},
"contacts": [
{
"email": "john@example.com",
"is_primary": True,
"email_preferences": ["<string>"],
"first_name": "John",
"id": "<string>",
"last_name": "Doe"
}
]
}
headers = {
"Alguna-Version": "<alguna-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Alguna-Version': '<alguna-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
currency: 'USD',
name: 'Acme Corp',
aliases: ['<string>'],
billing_address: {
city: 'San Francisco',
country: 'USA',
line1: '123 Main St',
postal_code: '94105',
state: 'CA',
line2: 'Suite 100'
},
contacts: [
{
email: 'john@example.com',
is_primary: true,
email_preferences: ['<string>'],
first_name: 'John',
id: '<string>',
last_name: 'Doe'
}
]
})
};
fetch('https://api.alguna.io/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.alguna.io/customers",
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([
'currency' => 'USD',
'name' => 'Acme Corp',
'aliases' => [
'<string>'
],
'billing_address' => [
'city' => 'San Francisco',
'country' => 'USA',
'line1' => '123 Main St',
'postal_code' => '94105',
'state' => 'CA',
'line2' => 'Suite 100'
],
'contacts' => [
[
'email' => 'john@example.com',
'is_primary' => true,
'email_preferences' => [
'<string>'
],
'first_name' => 'John',
'id' => '<string>',
'last_name' => 'Doe'
]
]
]),
CURLOPT_HTTPHEADER => [
"Alguna-Version: <alguna-version>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.alguna.io/customers"
payload := strings.NewReader("{\n \"currency\": \"USD\",\n \"name\": \"Acme Corp\",\n \"aliases\": [\n \"<string>\"\n ],\n \"billing_address\": {\n \"city\": \"San Francisco\",\n \"country\": \"USA\",\n \"line1\": \"123 Main St\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\",\n \"line2\": \"Suite 100\"\n },\n \"contacts\": [\n {\n \"email\": \"john@example.com\",\n \"is_primary\": true,\n \"email_preferences\": [\n \"<string>\"\n ],\n \"first_name\": \"John\",\n \"id\": \"<string>\",\n \"last_name\": \"Doe\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Alguna-Version", "<alguna-version>")
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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.alguna.io/customers")
.header("Alguna-Version", "<alguna-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\",\n \"name\": \"Acme Corp\",\n \"aliases\": [\n \"<string>\"\n ],\n \"billing_address\": {\n \"city\": \"San Francisco\",\n \"country\": \"USA\",\n \"line1\": \"123 Main St\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\",\n \"line2\": \"Suite 100\"\n },\n \"contacts\": [\n {\n \"email\": \"john@example.com\",\n \"is_primary\": true,\n \"email_preferences\": [\n \"<string>\"\n ],\n \"first_name\": \"John\",\n \"id\": \"<string>\",\n \"last_name\": \"Doe\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alguna.io/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Alguna-Version"] = '<alguna-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\",\n \"name\": \"Acme Corp\",\n \"aliases\": [\n \"<string>\"\n ],\n \"billing_address\": {\n \"city\": \"San Francisco\",\n \"country\": \"USA\",\n \"line1\": \"123 Main St\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\",\n \"line2\": \"Suite 100\"\n },\n \"contacts\": [\n {\n \"email\": \"john@example.com\",\n \"is_primary\": true,\n \"email_preferences\": [\n \"<string>\"\n ],\n \"first_name\": \"John\",\n \"id\": \"<string>\",\n \"last_name\": \"Doe\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-04-01T10:00:00Z",
"currency": "USD",
"id": "cust_abc123",
"name": "Acme Corp",
"updated_at": "2026-04-01T12:30:00Z",
"aliases": [
"<string>"
],
"billing_address": {
"city": "San Francisco",
"country": "USA",
"line1": "123 Main St",
"postal_code": "94105",
"state": "CA",
"line2": "Suite 100"
},
"contacts": [
{
"email": "john@example.com",
"id": "cont_abc123",
"is_primary": true,
"email_preferences": [
"<string>"
],
"first_name": "John",
"last_name": "Doe"
}
],
"tax_country": "DE",
"tax_id": "DE123456789",
"tax_rate": "0.20",
"tax_reason": "standard_rated",
"tax_status": "taxable",
"tax_type": "vat"
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}