Checkouts
Atualizar Checkout
PUT
/v1/checkouts/: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 configurações de uma página de pagamento, como produtos ou formas de pagamento disponíveis.
Atualizar checkout
| Campo | Obrig. | Tipo |
|---|---|---|
priceId | ❌ | string |
discounts | ❌ | array |
trialDays | ❌ | number |
maxInstallments | ❌ | number |
primaryColor/secondaryColor/fontColor | ❌ | string (hex) |
showProductImage | ❌ | boolean |
applyBrandingToAllPrices | ❌ | boolean |
Body
application/json
Content-Type:application/json
{
"priceId": "price_yyy",
"discounts": [],
"maxInstallments": 6,
"primaryColor": "#FF0000",
"showProductImage": false,
"applyBrandingToAllPrices": true
}Schema
| Field | Type | Required | Description |
|---|---|---|---|
priceId | string | - | - |
discounts[0] | array | - | - |
maxInstallments | number | - | - |
primaryColor | string | - | - |
showProductImage | boolean | - | - |
applyBrandingToAllPrices | boolean | - | - |
Headers
| Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | - | application/json | Optional |
const url = 'https://sandbox.validapay.com.br/v1/checkouts/:id';
const options = {
method: 'PUT',
headers: {
'Authorization': 'Bearer {{token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"priceId": "price_yyy",
"discounts": [],
"maxInstallments": 6,
"primaryColor": "#FF0000",
"showProductImage": false,
"applyBrandingToAllPrices": true
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Response Examples
200200
{
"id": "pl_xxx",
"priceId": "price_yyy"
}404404
{
"code": "CHECKOUT_NOT_FOUND"
}