Atualizar cliente
curl --request PATCH \
--url https://api.upag.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": {},
"phone": {},
"address": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: {}, phone: {}, address: {}})
};
fetch('https://api.upag.io/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/customers/{customerId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: {}, phone: {}, address: {}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Clientes
Atualizar cliente
Atualiza dados parciais do cliente
PATCH
https://api.upag.io
/
v1
/
customers
/
{customerId}
Atualizar cliente
curl --request PATCH \
--url https://api.upag.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": {},
"phone": {},
"address": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: {}, phone: {}, address: {}})
};
fetch('https://api.upag.io/v1/customers/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/customers/{customerId}';
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', email: {}, phone: {}, address: {}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Atualiza parcialmente o cliente: campos omitidos ficam como estão. O documento não pode ser alterado; crie outro cliente.
Permissão:
customer.write. Apenas chave secreta (sk_…).
Os exemplos usam o sandbox (
https://api.upag.dev/v1). Em produção use https://api.upag.io/v1 com sk_live_….Endpoint
curl -X PATCH https://api.upag.dev/v1/customers/8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83 \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"email": "maria.souza@example.com",
"address": { "complement": "Apto 42" }
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const customer = await upag.customers.update('8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83', {
email: 'maria.souza@example.com',
address: { complement: 'Apto 42' },
});
Parâmetros
string (uuid)
required
ID do cliente.
string
Nome (mínimo 1 caractere).
string | null
E-mail válido, ou
null para limpar.object | null
Objeto completo (
countryCode, areaCode, number), que substitui o anterior; ou null para limpar.object | null
Campos do endereço a alterar (
street, number, complement, neighborhood, city, state, country, zip), mesclados campo a campo; ou null para limpar todo o endereço.Resposta
200 OK com o cliente atualizado.
Response
{
"id": "8c1f0a26-5d3b-4f1e-9c72-1a4e6b9d0f83",
"name": "Maria Souza",
"email": "maria.souza@example.com",
"document": { "number": "12345678909", "type": "cpf" },
"phone": { "countryCode": "55", "areaCode": "11", "number": "999998888" },
"address": {
"street": "Avenida Paulista",
"number": "1578",
"complement": "Apto 42",
"neighborhood": "Bela Vista",
"city": "São Paulo",
"state": "SP",
"country": "BR",
"zip": "01310200"
},
"createdAt": "2026-07-27T18:04:11.482Z",
"updatedAt": "2026-07-27T18:30:00.000Z"
}
Erros
| Status | Mensagem | Causa |
|---|---|---|
404 | Customer not found | Cliente inexistente, excluído ou de outra conta |
422 | VALIDATION_FAILED | Corpo inválido |