Customer creation
POST
/v1/client
const url = 'https://api-admin.billz.ai/v1/client';const options = { method: 'POST', headers: { 'platform-id': '7d4a4c38-dd84-4902-b744-0488b80a4c01', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"chat_id":"some_chat_id","date_of_birth":"2022-05-14","first_name":"John","gender":1,"last_name":"Doe","phone_number":"+998000000000"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-admin.billz.ai/v1/client \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'platform-id: 7d4a4c38-dd84-4902-b744-0488b80a4c01' \ --data '{ "chat_id": "some_chat_id", "date_of_birth": "2022-05-14", "first_name": "John", "gender": 1, "last_name": "Doe", "phone_number": "+998000000000" }'Error codes: 400 — input validation error; 401, 403, 429, 500 — shared by all methods. Body formats and semantics: Response codes and errors.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”platform-id
string
Platform identifier. A static value is used for integrations.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
id
string
phone_number
Phone number; stored as the only element of the customer’s phone_numbers
string
first_name
Name
string
last_name
Last name
string
gender
Gender: 1 — male, 2 — female; any other value — not set
integer format: int32
date_of_birth
Format 2022-05-14
string
chat_id
Telegram chat_id
string
Example
{ "chat_id": "some_chat_id", "date_of_birth": "2022-05-14", "first_name": "John", "gender": 1, "last_name": "Doe", "phone_number": "+998000000000"}Responses
Section titled “Responses”Successful response
Media typeapplication/json
object
id
Identifier of the created customer
string format: uuid
Examplegenerated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}