Produtos
Atualizar Produto
PUT
/v1/products/: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 as informações de um produto, como nome, descrição ou preço.
Atualizar produto
Mesmos campos de POST (todos opcionais). Para atualizar preço existente, inclua priceId no item de prices[].
Body
application/json
Content-Type:application/json
{
"name": "Plano Premium Plus",
"prices": [
{
"priceId": "price_xxx",
"amount": 109.9
},
{
"title": "Trimestral",
"amount": 279.0,
"recurrenceType": "QUARTERLY"
}
]
}Schema
| Field | Type | Required | Description |
|---|---|---|---|
name | string | - | - |
prices[2] | array | - | - |
Headers
| Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | - | application/json | Optional |
const url = 'https://sandbox.validapay.com.br/v1/products/:id';
const options = {
method: 'PUT',
headers: {
'Authorization': 'Bearer {{token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Plano Premium Plus",
"prices": [
{
"priceId": "price_xxx",
"amount": 109.9
},
{
"title": "Trimestral",
"amount": 279.0,
"recurrenceType": "QUARTERLY"
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Response Examples
200200
{
"productId": "prod_xxx",
"name": "Plano Premium Plus",
"newPrices": [
{
"priceId": "price_yyy"
}
]
}404404
{
"code": "PRODUCT_NOT_FOUND"
}