Checkouts

Atualizar Checkout

PUT/v1/checkouts/:id
Base URL Produção:https://api.validapay.com.br
Base URL Sandbox:https://sandbox.validapay.com.br

Autenticação

bearerAuthorizationstring · header · obrigatório

Envie no header:

Authorization: Bearer {{token}}

Path Parameters

NameTypeRequiredDescription
idstringRequiredId

Atualiza as configurações de uma página de pagamento, como produtos ou formas de pagamento disponíveis.

Atualizar checkout

CampoObrig.Tipo
priceIdstring
discountsarray
trialDaysnumber
maxInstallmentsnumber
primaryColor/secondaryColor/fontColorstring (hex)
showProductImageboolean
applyBrandingToAllPricesboolean

Body

application/json

Content-Type:application/json
{
  "priceId": "price_yyy",
  "discounts": [],
  "maxInstallments": 6,
  "primaryColor": "#FF0000",
  "showProductImage": false,
  "applyBrandingToAllPrices": true
}

Schema

FieldTypeRequiredDescription
priceId
string-
-
discounts[0]
array-
-
maxInstallments
number-
-
primaryColor
string-
-
showProductImage
boolean-
-
applyBrandingToAllPrices
boolean-
-

Headers

NameTypeValueRequired
Content-Type-application/jsonOptional
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"
}