Skip to main content
PATCH
/
v1
/
app
/
variable
/
{variable-id}
Update Variable
curl --request PATCH \
  --url https://api.centralcart.com.br/v1/app/variable/{variable-id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "type": "<string>",
  "required": true,
  "regex": "<string>",
  "applies_to": [
    123
  ],
  "options": [
    {
      "options[].name": "<string>",
      "options[].value": "<string>",
      "options[].price": 123
    }
  ]
}
'
{
  "id": 1,
  "store_id": 1,
  "name": "cor",
  "description": "Escolha a cor do VIP",
  "type": "SELECT",
  "required": true,
  "regex": null,
  "applies_to": null,
  "bracket_display": "{cor}",
  "display": "Cor",
  "created_at": "2024-01-31T16:03:28.000-03:00",
  "updated_at": "2024-01-31T16:05:15.000-03:00",
  "options": [
    {
      "id": 1,
      "name": "Vermelho",
      "value": "red",
      "price": null
    },
    {
      "id": 2,
      "name": "Azul",
      "value": "blue",
      "price": 10
    }
  ]
}
variable-id
number
required
O ID da variável a ser atualizada
name
string
Identificador único da variável. Apenas letras, números, - e _
description
string
Descrição exibida para o cliente
type
string
required
Tipo da variável: SELECT, NUMBER, TEXT ou ROBLOX
required
boolean
Se o preenchimento é obrigatório
regex
string
Expressão regular para validação
applies_to
number[]
IDs dos pacotes aos quais a variável de checkout se aplica
options
array
Opções disponíveis (obrigatório quando o tipo é SELECT, mínimo 2). Opções existentes são atualizadas por nome, novas opções são criadas, e opções removidas são desativadas
{
  "id": 1,
  "store_id": 1,
  "name": "cor",
  "description": "Escolha a cor do VIP",
  "type": "SELECT",
  "required": true,
  "regex": null,
  "applies_to": null,
  "bracket_display": "{cor}",
  "display": "Cor",
  "created_at": "2024-01-31T16:03:28.000-03:00",
  "updated_at": "2024-01-31T16:05:15.000-03:00",
  "options": [
    {
      "id": 1,
      "name": "Vermelho",
      "value": "red",
      "price": null
    },
    {
      "id": 2,
      "name": "Azul",
      "value": "blue",
      "price": 10
    }
  ]
}