Atualizar um cliente
curl --request PUT \
--url https://api.ephra.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "mariana.alves@empresadela.com.br",
"phone": "+5521997766554",
"tags": [
"lancamento-setembro",
"cliente-recorrente",
"nota-cnpj"
]
}
'import requests
url = "https://api.ephra.io/v1/customers/{customerId}"
payload = {
"email": "mariana.alves@empresadela.com.br",
"phone": "+5521997766554",
"tags": ["lancamento-setembro", "cliente-recorrente", "nota-cnpj"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'mariana.alves@empresadela.com.br',
phone: '+5521997766554',
tags: ['lancamento-setembro', 'cliente-recorrente', 'nota-cnpj']
})
};
fetch('https://api.ephra.io/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ephra.io/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([
'email' => 'mariana.alves@empresadela.com.br',
'phone' => '+5521997766554',
'tags' => [
'lancamento-setembro',
'cliente-recorrente',
'nota-cnpj'
]
]),
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.ephra.io/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"email\": \"mariana.alves@empresadela.com.br\",\n \"phone\": \"+5521997766554\",\n \"tags\": [\n \"lancamento-setembro\",\n \"cliente-recorrente\",\n \"nota-cnpj\"\n ]\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.ephra.io/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"mariana.alves@empresadela.com.br\",\n \"phone\": \"+5521997766554\",\n \"tags\": [\n \"lancamento-setembro\",\n \"cliente-recorrente\",\n \"nota-cnpj\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/customers/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"mariana.alves@empresadela.com.br\",\n \"phone\": \"+5521997766554\",\n \"tags\": [\n \"lancamento-setembro\",\n \"cliente-recorrente\",\n \"nota-cnpj\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "cmtxc7d910004hlg1q8w2ker3",
"name": "Mariana Ribeiro Alves",
"email": "mariana.alves@empresadela.com.br",
"phone": "+5521998877665",
"document": "39053344705",
"documentType": "CPF",
"instagram": "@mariana.alves",
"birthDate": "1991-04-17T00:00:00.000Z",
"mailMarketing": true,
"taxFree": false,
"tags": [
"lancamento-setembro",
"cliente-recorrente"
],
"notes": "Pediu nota fiscal com o CNPJ da empresa dela a partir da próxima compra.",
"address": {
"street": "Rua Visconde de Pirajá",
"streetNumber": "414",
"complement": "sala 1108",
"neighborhood": "Ipanema",
"city": "Rio de Janeiro",
"state": "RJ",
"zipCode": "22410002"
},
"createdAt": "2026-08-14T11:20:33.000Z",
"updatedAt": "2026-09-09T16:41:02.000Z"
}
}{
"success": false,
"message": "Não foi possível concluir: uma regra de negócio recusou os dados enviados."
}{
"success": false,
"message": "Token inválido ou expirado"
}{
"success": false,
"message": "Recurso não encontrado"
}{
"success": false,
"message": "name: Nome é obrigatório"
}{
"success": false,
"message": "Muitas requisições. Tente novamente em breve."
}{
"success": false,
"message": "Erro interno do servidor"
}Vendas
Atualizar um cliente
Corrige os dados cadastrais informados de um cliente da empresa autenticada — e-mail, telefone, endereço de entrega, etiquetas — mantendo o histórico de compras. Os campos omitidos ficam como estão. O documento não é alterável. Responde 404 quando o cliente pertence a outra empresa.
PUT
/
v1
/
customers
/
{customerId}
Atualizar um cliente
curl --request PUT \
--url https://api.ephra.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "mariana.alves@empresadela.com.br",
"phone": "+5521997766554",
"tags": [
"lancamento-setembro",
"cliente-recorrente",
"nota-cnpj"
]
}
'import requests
url = "https://api.ephra.io/v1/customers/{customerId}"
payload = {
"email": "mariana.alves@empresadela.com.br",
"phone": "+5521997766554",
"tags": ["lancamento-setembro", "cliente-recorrente", "nota-cnpj"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'mariana.alves@empresadela.com.br',
phone: '+5521997766554',
tags: ['lancamento-setembro', 'cliente-recorrente', 'nota-cnpj']
})
};
fetch('https://api.ephra.io/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ephra.io/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([
'email' => 'mariana.alves@empresadela.com.br',
'phone' => '+5521997766554',
'tags' => [
'lancamento-setembro',
'cliente-recorrente',
'nota-cnpj'
]
]),
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.ephra.io/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"email\": \"mariana.alves@empresadela.com.br\",\n \"phone\": \"+5521997766554\",\n \"tags\": [\n \"lancamento-setembro\",\n \"cliente-recorrente\",\n \"nota-cnpj\"\n ]\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.ephra.io/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"mariana.alves@empresadela.com.br\",\n \"phone\": \"+5521997766554\",\n \"tags\": [\n \"lancamento-setembro\",\n \"cliente-recorrente\",\n \"nota-cnpj\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/customers/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"mariana.alves@empresadela.com.br\",\n \"phone\": \"+5521997766554\",\n \"tags\": [\n \"lancamento-setembro\",\n \"cliente-recorrente\",\n \"nota-cnpj\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "cmtxc7d910004hlg1q8w2ker3",
"name": "Mariana Ribeiro Alves",
"email": "mariana.alves@empresadela.com.br",
"phone": "+5521998877665",
"document": "39053344705",
"documentType": "CPF",
"instagram": "@mariana.alves",
"birthDate": "1991-04-17T00:00:00.000Z",
"mailMarketing": true,
"taxFree": false,
"tags": [
"lancamento-setembro",
"cliente-recorrente"
],
"notes": "Pediu nota fiscal com o CNPJ da empresa dela a partir da próxima compra.",
"address": {
"street": "Rua Visconde de Pirajá",
"streetNumber": "414",
"complement": "sala 1108",
"neighborhood": "Ipanema",
"city": "Rio de Janeiro",
"state": "RJ",
"zipCode": "22410002"
},
"createdAt": "2026-08-14T11:20:33.000Z",
"updatedAt": "2026-09-09T16:41:02.000Z"
}
}{
"success": false,
"message": "Não foi possível concluir: uma regra de negócio recusou os dados enviados."
}{
"success": false,
"message": "Token inválido ou expirado"
}{
"success": false,
"message": "Recurso não encontrado"
}{
"success": false,
"message": "name: Nome é obrigatório"
}{
"success": false,
"message": "Muitas requisições. Tente novamente em breve."
}{
"success": false,
"message": "Erro interno do servidor"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identificador do cliente.
Minimum string length:
1Body
application/json
Nome completo do cliente.
Required string length:
1 - 160E-mail principal do cliente.
Telefone do cliente, com DDI e DDD.
Minimum string length:
8Data de nascimento (ISO 8601).
Marque true quando o cliente aceitou receber marketing.
Marque true quando o cliente é isento de imposto.
Etiquetas livres para segmentar o cliente.
Maximum array length:
20Minimum string length:
1Anotações internas sobre o cliente.
Maximum string length:
1000Endereço de entrega do cliente.
Show child attributes
Show child attributes
⌘I
