Overview /
Customers & loyalty /
Create a customer
Create a customer
post
https://api.flactrum.com/v1/customers
| Required scope | customers.write |
| Success status | 201 |
| Returns | One Customer object |
Request body
| Field | Type | Description |
|---|---|---|
| name * | string | — |
| phone | string|null | Unique within the brand — two accounts for one person would split their balance. |
| string|null | Unique within the brand. | |
| password | string|null | For mobile-app login. Stored hashed; never returned. |
| is_active | boolean | — |
| note | string|null | — |
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | — |
| name | string | — |
| string|null | — | |
| phone | string|null | — |
| balance | number | Stored money. Read-only here; it changes only through the wallet endpoints or a sale. |
| points | integer | Loyalty points. Read-only here. |
| is_active | boolean | — |
| last_order_at | string|null | — |
| order_count | integer | — |
Examples
Recorded from the test suite — these are real requests and their real responses.
curl -X POST 'https://api.flactrum.com/v1/customers' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"name": "Elif Aydın",
"phone": "+905550000001",
"email": "elif@ornek.com"
}'
HTTP 201 · application/json
{
"data": {
"id": "01m43mxxbeycm9pkvz2w565f2y",
"name": "Elif Aydın",
"email": "elif@ornek.com",
"phone": "+905550000001",
"balance": 0,
"points": 0,
"is_active": true,
"note": null,
"email_verified_at": null,
"last_order_at": null,
"order_count": 0,
"created_at": "2026-10-04T14:26:17+00:00",
"updated_at": "2026-10-04T14:26:17+00:00"
}
}
curl -X POST 'https://api.flactrum.com/v1/customers' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"name": "Elif 2",
"phone": "+905550000001"
}'
HTTP 422 · application/json
{
"error": {
"code": "validation_failed",
"message": "The submitted data is invalid.",
"details": {
"fields": {
"phone": [
"Bu phone zaten kayıtlı."
]
}
}
}
}