Edit customer
const url = 'https://api-admin.billz.ai/v1/client/123';const options = { method: 'PUT', headers: { 'platform-id': '7d4a4c38-dd84-4902-b744-0488b80a4c01', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"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 PUT \ --url https://api-admin.billz.ai/v1/client/123 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'platform-id: 7d4a4c38-dd84-4902-b744-0488b80a4c01' \ --data '{ "date_of_birth": "2022-05-14", "first_name": "John", "gender": 1, "last_name": "Doe", "phone_number": [ "+998000000000" ] }'Replaces the customer’s data entirely: a field missing from the body is cleared. Send all of the customer’s fields, including those that do not change.
phone_number replaces the list of phone numbers rather than adding to it. Numbers are stored as sent — use the international format with +.
The "success" response does not confirm that the customer was found: for a nonexistent id the response is the same.
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”Path Parameters
Section titled “Path Parameters”Taken from the path; the value from the body is ignored
Example
123Header Parameters
Section titled “Header Parameters”Platform identifier. A static value is used for integrations.
Request Bodyrequired
Section titled “Request Bodyrequired”object
All of the customer’s phone numbers; they replace the current list
Name
Last name
Gender as a number
Date of birth
Telegram chat_id
Example
{ "date_of_birth": "2022-05-14", "first_name": "John", "gender": 1, "last_name": "Doe", "phone_number": [ "+998000000000" ]}Responses
Section titled “Responses”Successful response
String "success"
Example
success