Clientes
Atualizar Cliente
PUT
/v1/customers/:idBase URL Produção:
https://api.validapay.com.brBase URL Sandbox:
https://sandbox.validapay.com.brAutenticação
bearerAuthorizationstring · header · obrigatório
Envie no header:
Authorization: Bearer {{token}}Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Required | Id |
Atualiza os dados cadastrais de um cliente, como endereço, telefone ou e-mail.
Atualizar cliente
| Campo | Obrig. | Tipo |
|---|---|---|
name | ❌ | string |
email | ❌ | string |
phone | ❌ | string |
document | ❌ | string |
Body
application/json
Content-Type:application/json
{
"name": "João Silva Atualizado",
"email": "novo@email.com",
"phone": "+5511988887777"
}Schema
| Field | Type | Required | Description |
|---|---|---|---|
name | string | - | - |
email | string | - | - |
phone | string | - | - |
Headers
| Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | - | application/json | Optional |
const url = 'https://sandbox.validapay.com.br/v1/customers/:id';
const options = {
method: 'PUT',
headers: {
'Authorization': 'Bearer {{token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "João Silva Atualizado",
"email": "novo@email.com",
"phone": "+5511988887777"
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Response Examples
200200
{
"customer": {
"customerId": "cus_xxx",
"name": "João Silva Atualizado"
}
}400400
{
"code": "DOCUMENT_ALREADY_EXISTS"
}404404
{
"code": "CUSTOMER_NOT_FOUND"
}