Atualizar cliente
curl --request PUT \
--url https://api.nasten.net/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "11912345678",
"tags": [
"vip",
"recorrente"
],
"notes": "Prefere contato por WhatsApp."
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone: '11912345678',
tags: ['vip', 'recorrente'],
notes: 'Prefere contato por WhatsApp.'
})
};
fetch('https://api.nasten.net/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nasten.net/v1/customers/{customerId}"
payload = {
"phone": "11912345678",
"tags": ["vip", "recorrente"],
"notes": "Prefere contato por WhatsApp."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nasten.net/v1/customers/{customerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'phone' => '11912345678',
'tags' => [
'vip',
'recorrente'
],
'notes' => 'Prefere contato por WhatsApp.'
]),
CURLOPT_HTTPHEADER => [
"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.nasten.net/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"phone\": \"11912345678\",\n \"tags\": [\n \"vip\",\n \"recorrente\"\n ],\n \"notes\": \"Prefere contato por WhatsApp.\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.nasten.net/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"11912345678\",\n \"tags\": [\n \"vip\",\n \"recorrente\"\n ],\n \"notes\": \"Prefere contato por WhatsApp.\"\n}")
.asString();{
"success": true,
"data": {
"id": "cmcliente000000000000001",
"companyId": "<string>",
"name": "Ana Souza",
"documentType": "CPF",
"document": "01234567890",
"email": "ana.souza@exemplo.com.br",
"phone": "11912345678",
"birthDate": "2023-11-07T05:31:56Z",
"mailMarketing": true,
"taxFree": true,
"tags": [
"<string>"
],
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"errors": [
{
"path": "customer.document",
"message": "Documento inválido"
}
]
}{
"success": false,
"message": "Token inválido ou expirado",
"code": "NST-401-rcp9"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"error": "Too Many Requests",
"retryAfterMs": 42000,
"limit": 1800,
"window": "1 minute"
}{
"success": false,
"message": "Internal server error",
"code": "NST-500-9e2b"
}Clientes
Atualizar cliente
Envie só o que muda: campo ausente mantém o valor. null em qualquer campo responde 400.
O documento, extraEmails e extraPhones não mudam por esta rota e são ignorados.
tags substitui a lista inteira. billingAddresses só acrescenta endereços que o cliente ainda não tem.
PUT
/
v1
/
customers
/
{customerId}
Atualizar cliente
curl --request PUT \
--url https://api.nasten.net/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "11912345678",
"tags": [
"vip",
"recorrente"
],
"notes": "Prefere contato por WhatsApp."
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone: '11912345678',
tags: ['vip', 'recorrente'],
notes: 'Prefere contato por WhatsApp.'
})
};
fetch('https://api.nasten.net/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nasten.net/v1/customers/{customerId}"
payload = {
"phone": "11912345678",
"tags": ["vip", "recorrente"],
"notes": "Prefere contato por WhatsApp."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nasten.net/v1/customers/{customerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'phone' => '11912345678',
'tags' => [
'vip',
'recorrente'
],
'notes' => 'Prefere contato por WhatsApp.'
]),
CURLOPT_HTTPHEADER => [
"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.nasten.net/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"phone\": \"11912345678\",\n \"tags\": [\n \"vip\",\n \"recorrente\"\n ],\n \"notes\": \"Prefere contato por WhatsApp.\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.nasten.net/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"11912345678\",\n \"tags\": [\n \"vip\",\n \"recorrente\"\n ],\n \"notes\": \"Prefere contato por WhatsApp.\"\n}")
.asString();{
"success": true,
"data": {
"id": "cmcliente000000000000001",
"companyId": "<string>",
"name": "Ana Souza",
"documentType": "CPF",
"document": "01234567890",
"email": "ana.souza@exemplo.com.br",
"phone": "11912345678",
"birthDate": "2023-11-07T05:31:56Z",
"mailMarketing": true,
"taxFree": true,
"tags": [
"<string>"
],
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"errors": [
{
"path": "customer.document",
"message": "Documento inválido"
}
]
}{
"success": false,
"message": "Token inválido ou expirado",
"code": "NST-401-rcp9"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"error": "Too Many Requests",
"retryAfterMs": 42000,
"limit": 1800,
"window": "1 minute"
}{
"success": false,
"message": "Internal server error",
"code": "NST-500-9e2b"
}Body
application/json

