POST
https://api.alatwa.com/customer
Headers
| Name | Type | | Description |
| Authorization |
string |
required |
API Key akun Alat WA Anda |
| Content-Type |
string |
required |
application/json |
Body Parameters
| Name | Type | | Description |
| generate_prefix_number |
string |
required |
Generate nomor dengan prefix 62 ("true"/"false") |
| filter_duplicate |
string |
required |
Filter nomor duplikat ("true"/"false") |
| group |
string |
required |
Nama group customer |
| customers |
array |
required |
Array objek customer: {phone*, name, opt1-opt7} |
Code Examples
curl -X POST https://api.alatwa.com/customer \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"generate_prefix_number": "true",
"filter_duplicate": "true",
"group": "Pelanggan Baru",
"customers": [
{
"phone": "08111111111",
"name": "John Doe"
}
]
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.alatwa.com/customer');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
const response = await fetch('https://api.alatwa.com/customer', {
method: 'POST',
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"generate_prefix_number": "true",
"filter_duplicate": "true",
"group": "Pelanggan Baru",
"customers": [
{
"phone": "08111111111",
"name": "John Doe"
}
]
})
});
import requests
response = requests.post(
'https://api.alatwa.com/customer',
headers={
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"generate_prefix_number": "true",
"filter_duplicate": "true",
"group": "Pelanggan Baru",
"customers": [
{
"phone": "08111111111",
"name": "John Doe"
}
]
}
)
Response
200 Success
{
"status": "ok",
"message": "Success",
"total_customer": "1",
"group": "Pelanggan Baru"
}
Response Fields
| Field | Type | Description |
| status |
string |
"ok" atau "error" |
| message |
string |
Pesan status |
| total_customer |
string |
Total customer yang dibuat |
| group |
string |
Nama group |