# Update preferences

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


[Idempotency Supported](/docs/api/idempotency)

[Asynchronous](/docs/api/async_response/async-response-object)

Updates one or more preferences and returns their resulting values.

**Note:** Changes are published when the update completes. The API does not create drafts.

#### Updating multiple preferences[](#updating-multiple-preferences)

You can update multiple preferences in a single request when they need to change together. The updates are applied atomically. If any entry fails validation, none of the changes take effect.

A synchronous request can include up to 25 entries. An [asynchronous request](/docs/api/async_response) can include up to 100 entries. Send `Prefer: respond-async`, `chargebee-request-id`, and `chargebee-async-callback-url`. See [Required headers](/docs/api/async_response#required-headers). Each variant entry counts toward this limit separately from its base entry.

You can update a preference and the preferences that depend on it in the same request. Applicability is checked against the configuration that would result from the complete update, not against the configuration before the update.

Before writing any changes, the API validates each entry:

-   The `value` against the preference's `value_schema`
-   The preference's `applicability` conditions against the resulting configuration
-   For variants, the `value` against the same `value_schema` and the `criteria` against the preference's `criteria_schema`

#### Variant entries[](#variant-entries)

**Warning:** The entries you send for an `id` replace its complete variant set. Include every variant that should remain.

An existing level is updated. Any stored level above the highest level in the request is deleted.

To remove all variants, send only the base preference entry.

An entry without `level` and `criteria` updates the base value. An entry with both fields is a variant of that preference `id`.

A variant must include both `level` and `criteria`; sending only one is rejected. You can include the same `id` multiple times in a request: once for the base entry and once for each variant. A request that updates variants must include that id's base entry. A variant-only request is rejected.

To update an existing variant, use the same preference `id` and `level`. Include both `value` and `criteria` each time, even if only one has changed.

You can also update `allow_override_in_interface` when the preference definition has `overridable_in_interface` set to `true`. `allow_override_in_api` is read-only.

To add a new variant, use the next level after the current highest level. Levels must be `1`, `2`, `3`, and so on, with no gaps. Include every lower level in the same request.

Sending the same `id` and `level` combination twice in one request, or the base entry for the same `id` twice, is rejected.

To keep the current override setting unchanged, omit `allow_override_in_interface`. Other fields in the entry can still change. If the preference has not been stored before, its initial override setting comes from the preference definitions.

## Sample Request

### Default

#### Chargebee CLI

```bash
chargebee preference upsert \
    -d 'preferences[id][0]=subscription_reactivation.in_term_reactivation_option' \
    -d 'preferences[value][0]=allow_reactivation' \
    -d 'preferences[allow_override_in_interface][0]=true' \
    -d 'preferences[id][1]=subscription_reactivation.in_term_reactivation_option' \
    -d 'preferences[value][1]=allow_only_on_payment_collection' \
    -d 'preferences[level][1]=1' \
    -d 'preferences[allow_override_in_interface][1]=false' \
    -d 'preferences[criteria][1]=[{"operand": "request_source", "operator": "in", "values": ["api"]}]' \
    -d 'preferences[id][2]=unbilled_charges.invoicing_options.add_charge' \
    -d 'preferences[value][2]=later' \
    -d 'preferences[allow_override_in_interface][2]=true'
```

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/preferences \
     -u {site_api_key}:\
     -d "preferences[id][0]"="subscription_reactivation.in_term_reactivation_option" \
     -d "preferences[value][0]"="allow_reactivation" \
     -d "preferences[allow_override_in_interface][0]"="true" \
     -d "preferences[id][1]"="subscription_reactivation.in_term_reactivation_option" \
     -d "preferences[value][1]"="allow_only_on_payment_collection" \
     -d "preferences[level][1]"=1 \
     -d "preferences[allow_override_in_interface][1]"="false" \
     -d "preferences[criteria][1]"='[{"operand": "request_source", "operator": "in", "values": ["api"]}]' \
     -d "preferences[id][2]"="unbilled_charges.invoicing_options.add_charge" \
     -d "preferences[value][2]"="later" \
     -d "preferences[allow_override_in_interface][2]"="true"
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;
using Newtonsoft.Json.Linq;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Preference.Upsert()
		.PreferenceId(0, "subscription_reactivation.in_term_reactivation_option")
		.PreferenceValue(0, "allow_reactivation")
		.PreferenceAllowOverrideInInterface(0, true)
		.PreferenceId(1, "subscription_reactivation.in_term_reactivation_option")
		.PreferenceValue(1, "allow_only_on_payment_collection")
		.PreferenceLevel(1, 1)
		.PreferenceAllowOverrideInInterface(1, false)
		.PreferenceCriteria(1, new JArray { new JObject {
  ["operand"] = "request_source",
  ["operator"] = "in",
  ["values"] = new JArray { "api" }
} })
		.PreferenceId(2, "unbilled_charges.invoicing_options.add_charge")
		.PreferenceValue(2, "later")
		.PreferenceAllowOverrideInInterface(2, true)
		.Request();

Preference preference = result.Preference;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    preferenceAction "github.com/chargebee/chargebee-go/v3/actions/preference"
    "github.com/chargebee/chargebee-go/v3/models/preference"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := preferenceAction.Upsert(&preference.UpsertRequestParams{
        Preferences : []*preference.UpsertPreferenceParams{
            {
                Id : "subscription_reactivation.in_term_reactivation_option",
                Value : "allow_reactivation",
                AllowOverrideInInterface : chargebee.Bool(true),
            },
            {
                Id : "subscription_reactivation.in_term_reactivation_option",
                Value : "allow_only_on_payment_collection",
                Level : chargebee.Int32(1),
                AllowOverrideInInterface : chargebee.Bool(false),
                Criteria : []interface{}{
    map[string]interface{}{
        "operand" : "request_source",
        "operator" : "in",
        "values" : []interface{}{
            "api",
        },
    },
},
            },
            {
                Id : "unbilled_charges.invoicing_options.add_charge",
                Value : "later",
                AllowOverrideInInterface : chargebee.Bool(true),
            },
        },
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        List := res.List
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.PreferenceUpsertRequest{
    Preferences : []*chargebee.PreferenceUpsertPreference{
        {
            Id : "subscription_reactivation.in_term_reactivation_option",
            Value : "allow_reactivation",
            AllowOverrideInInterface : chargebee.Bool(true),
        },
        {
            Id : "subscription_reactivation.in_term_reactivation_option",
            Value : "allow_only_on_payment_collection",
            Level : chargebee.Int32(1),
            AllowOverrideInInterface : chargebee.Bool(false),
            Criteria : []interface{}{
map[string]interface{}{
    "operand" : "request_source",
    "operator" : "in",
    "values" : []interface{}{
        "api",
    },
},
},
        },
        {
            Id : "unbilled_charges.invoicing_options.add_charge",
            Value : "later",
            AllowOverrideInInterface : chargebee.Bool(true),
        },
    },
}
  res, err := client.Preference.Upsert(req)
      if err != nil {
        fmt.Println(err)
    } else {
        List := res.List
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;
import java.util.List;
import com.chargebee.org.json.JSONArray;
import com.chargebee.org.json.JSONObject;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = Preference.upsert()
            .preferenceId(0, "subscription_reactivation.in_term_reactivation_option")
            .preferenceValue(0, "allow_reactivation")
            .preferenceAllowOverrideInInterface(0, true)
            .preferenceId(1, "subscription_reactivation.in_term_reactivation_option")
            .preferenceValue(1, "allow_only_on_payment_collection")
            .preferenceLevel(1, 1)
            .preferenceAllowOverrideInInterface(1, false)
            .preferenceCriteria(1, new JSONArray("[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"))
            .preferenceId(2, "unbilled_charges.invoicing_options.add_charge")
            .preferenceValue(2, "later")
            .preferenceAllowOverrideInInterface(2, true)
            .request();

    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.preference.params.PreferenceUpsertParams;
import com.chargebee.v4.models.preference.responses.PreferenceUpsertResponse;
import java.util.List;

public class PreferenceUpsert {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        PreferenceUpsertParams.PreferencesParams preference0 =
            PreferenceUpsertParams.PreferencesParams.builder()
                .id("subscription_reactivation.in_term_reactivation_option")
                .value("allow_reactivation")
                .allowOverrideInInterface(true)
                .build();

        PreferenceUpsertParams.PreferencesParams preference1 =
            PreferenceUpsertParams.PreferencesParams.builder()
                .id("subscription_reactivation.in_term_reactivation_option")
                .value("allow_only_on_payment_collection")
                .level(1)
                .allowOverrideInInterface(false)
                .criteria(List.of("[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"))
                .build();

        PreferenceUpsertParams.PreferencesParams preference2 =
            PreferenceUpsertParams.PreferencesParams.builder()
                .id("unbilled_charges.invoicing_options.add_charge")
                .value("later")
                .allowOverrideInInterface(true)
                .build();

        List<PreferenceUpsertParams.PreferencesParams> preferencesList =
            List.of(preference0, preference1, preference2);

        PreferenceUpsertParams params = PreferenceUpsertParams.builder()
            .preferences(preferencesList)
            .build();

        PreferenceUpsertResponse response = client.preferences().upsert(params);

    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.preference.upsert({
        preferences: [
            {
                id: "subscription_reactivation.in_term_reactivation_option",
                value: "allow_reactivation",
                allow_override_in_interface: true
            },
            {
                id: "subscription_reactivation.in_term_reactivation_option",
                value: "allow_only_on_payment_collection",
                level: 1,
                allow_override_in_interface: false,
                criteria: "[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"
            },
            {
                id: "unbilled_charges.invoicing_options.add_charge",
                value: "later",
                allow_override_in_interface: true
            }
        ]
    });

    console.log(result);
    const list = result.list;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->preference()->upsert([
    "preferences" => [
        [
            "id" => "subscription_reactivation.in_term_reactivation_option",
            "value" => "allow_reactivation",
            "allow_override_in_interface" => true
        ],
        [
            "id" => "subscription_reactivation.in_term_reactivation_option",
            "value" => "allow_only_on_payment_collection",
            "level" => 1,
            "allow_override_in_interface" => false,
            "criteria" => "[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"
        ],
        [
            "id" => "unbilled_charges.invoicing_options.add_charge",
            "value" => "later",
            "allow_override_in_interface" => true
        ]
    ]
]);
$list = $result->list;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Preference.upsert(
    cb_client.Preference.UpsertParams(
        preferences=[
            cb_client.Preference.UpsertPreferenceParams(
              id="subscription_reactivation.in_term_reactivation_option",
              value="allow_reactivation",
              allow_override_in_interface=True
            ),
            cb_client.Preference.UpsertPreferenceParams(
              id="subscription_reactivation.in_term_reactivation_option",
              value="allow_only_on_payment_collection",
              level=1,
              allow_override_in_interface=False,
              criteria='[{"operand": "request_source", "operator": "in", "values": ["api"]}]'
            ),
            cb_client.Preference.UpsertPreferenceParams(
              id="unbilled_charges.invoicing_options.add_charge",
              value="later",
              allow_override_in_interface=True
            )
        ]
    )
)
entries = response.list
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::Preference.upsert({
  :preferences => [
    {
      :id => "subscription_reactivation.in_term_reactivation_option",
      :value => "allow_reactivation",
      :allow_override_in_interface => "true"
    },
    {
      :id => "subscription_reactivation.in_term_reactivation_option",
      :value => "allow_only_on_payment_collection",
      :level => 1,
      :allow_override_in_interface => "false",
      :criteria => "[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"
    },
    {
      :id => "unbilled_charges.invoicing_options.add_charge",
      :value => "later",
      :allow_override_in_interface => "true"
    }
  ]
})

list = result.list
```

### with a variant

#### Chargebee CLI

```bash
chargebee preference upsert \
    -d 'preferences[id][0]=subscription_reactivation.in_term_reactivation_option' \
    -d 'preferences[value][0]=allow_reactivation' \
    -d 'preferences[allow_override_in_interface][0]=true' \
    -d 'preferences[id][1]=subscription_reactivation.in_term_reactivation_option' \
    -d 'preferences[value][1]=allow_only_on_payment_collection' \
    -d 'preferences[level][1]=1' \
    -d 'preferences[allow_override_in_interface][1]=false' \
    -d 'preferences[criteria][1]=[{"operand": "request_source", "operator": "in", "values": ["api"]}]'
```

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/preferences \
     -u {site_api_key}:\
     -d "preferences[id][0]"="subscription_reactivation.in_term_reactivation_option" \
     -d "preferences[value][0]"="allow_reactivation" \
     -d "preferences[allow_override_in_interface][0]"="true" \
     -d "preferences[id][1]"="subscription_reactivation.in_term_reactivation_option" \
     -d "preferences[value][1]"="allow_only_on_payment_collection" \
     -d "preferences[level][1]"=1 \
     -d "preferences[allow_override_in_interface][1]"="false" \
     -d "preferences[criteria][1]"='[{"operand": "request_source", "operator": "in", "values": ["api"]}]'
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;
using Newtonsoft.Json.Linq;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Preference.Upsert()
		.PreferenceId(0, "subscription_reactivation.in_term_reactivation_option")
		.PreferenceValue(0, "allow_reactivation")
		.PreferenceAllowOverrideInInterface(0, true)
		.PreferenceId(1, "subscription_reactivation.in_term_reactivation_option")
		.PreferenceValue(1, "allow_only_on_payment_collection")
		.PreferenceLevel(1, 1)
		.PreferenceAllowOverrideInInterface(1, false)
		.PreferenceCriteria(1, new JArray { new JObject {
  ["operand"] = "request_source",
  ["operator"] = "in",
  ["values"] = new JArray { "api" }
} })
		.Request();

Preference preference = result.Preference;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    preferenceAction "github.com/chargebee/chargebee-go/v3/actions/preference"
    "github.com/chargebee/chargebee-go/v3/models/preference"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := preferenceAction.Upsert(&preference.UpsertRequestParams{
        Preferences : []*preference.UpsertPreferenceParams{
            {
                Id : "subscription_reactivation.in_term_reactivation_option",
                Value : "allow_reactivation",
                AllowOverrideInInterface : chargebee.Bool(true),
            },
            {
                Id : "subscription_reactivation.in_term_reactivation_option",
                Value : "allow_only_on_payment_collection",
                Level : chargebee.Int32(1),
                AllowOverrideInInterface : chargebee.Bool(false),
                Criteria : []interface{}{
    map[string]interface{}{
        "operand" : "request_source",
        "operator" : "in",
        "values" : []interface{}{
            "api",
        },
    },
},
            },
        },
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        List := res.List
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.PreferenceUpsertRequest{
    Preferences : []*chargebee.PreferenceUpsertPreference{
        {
            Id : "subscription_reactivation.in_term_reactivation_option",
            Value : "allow_reactivation",
            AllowOverrideInInterface : chargebee.Bool(true),
        },
        {
            Id : "subscription_reactivation.in_term_reactivation_option",
            Value : "allow_only_on_payment_collection",
            Level : chargebee.Int32(1),
            AllowOverrideInInterface : chargebee.Bool(false),
            Criteria : []interface{}{
map[string]interface{}{
    "operand" : "request_source",
    "operator" : "in",
    "values" : []interface{}{
        "api",
    },
},
},
        },
    },
}
  res, err := client.Preference.Upsert(req)
      if err != nil {
        fmt.Println(err)
    } else {
        List := res.List
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;
import java.util.List;
import com.chargebee.org.json.JSONArray;
import com.chargebee.org.json.JSONObject;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = Preference.upsert()
            .preferenceId(0, "subscription_reactivation.in_term_reactivation_option")
            .preferenceValue(0, "allow_reactivation")
            .preferenceAllowOverrideInInterface(0, true)
            .preferenceId(1, "subscription_reactivation.in_term_reactivation_option")
            .preferenceValue(1, "allow_only_on_payment_collection")
            .preferenceLevel(1, 1)
            .preferenceAllowOverrideInInterface(1, false)
            .preferenceCriteria(1, new JSONArray("[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"))
            .request();

    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.preference.params.PreferenceUpsertParams;
import com.chargebee.v4.models.preference.responses.PreferenceUpsertResponse;
import java.util.List;

public class PreferenceUpsert {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        PreferenceUpsertParams.PreferencesParams preference0 =
            PreferenceUpsertParams.PreferencesParams.builder()
                .id("subscription_reactivation.in_term_reactivation_option")
                .value("allow_reactivation")
                .allowOverrideInInterface(true)
                .build();

        PreferenceUpsertParams.PreferencesParams preference1 =
            PreferenceUpsertParams.PreferencesParams.builder()
                .id("subscription_reactivation.in_term_reactivation_option")
                .value("allow_only_on_payment_collection")
                .level(1)
                .allowOverrideInInterface(false)
                .criteria(List.of("[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"))
                .build();

        List<PreferenceUpsertParams.PreferencesParams> preferencesList =
            List.of(preference0, preference1);

        PreferenceUpsertParams params = PreferenceUpsertParams.builder()
            .preferences(preferencesList)
            .build();

        PreferenceUpsertResponse response = client.preferences().upsert(params);

    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.preference.upsert({
        preferences: [
            {
                id: "subscription_reactivation.in_term_reactivation_option",
                value: "allow_reactivation",
                allow_override_in_interface: true
            },
            {
                id: "subscription_reactivation.in_term_reactivation_option",
                value: "allow_only_on_payment_collection",
                level: 1,
                allow_override_in_interface: false,
                criteria: "[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"
            }
        ]
    });

    console.log(result);
    const list = result.list;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->preference()->upsert([
    "preferences" => [
        [
            "id" => "subscription_reactivation.in_term_reactivation_option",
            "value" => "allow_reactivation",
            "allow_override_in_interface" => true
        ],
        [
            "id" => "subscription_reactivation.in_term_reactivation_option",
            "value" => "allow_only_on_payment_collection",
            "level" => 1,
            "allow_override_in_interface" => false,
            "criteria" => "[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"
        ]
    ]
]);
$list = $result->list;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Preference.upsert(
    cb_client.Preference.UpsertParams(
        preferences=[
            cb_client.Preference.UpsertPreferenceParams(
              id="subscription_reactivation.in_term_reactivation_option",
              value="allow_reactivation",
              allow_override_in_interface=True
            ),
            cb_client.Preference.UpsertPreferenceParams(
              id="subscription_reactivation.in_term_reactivation_option",
              value="allow_only_on_payment_collection",
              level=1,
              allow_override_in_interface=False,
              criteria='[{"operand": "request_source", "operator": "in", "values": ["api"]}]'
            )
        ]
    )
)
entries = response.list
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::Preference.upsert({
  :preferences => [
    {
      :id => "subscription_reactivation.in_term_reactivation_option",
      :value => "allow_reactivation",
      :allow_override_in_interface => "true"
    },
    {
      :id => "subscription_reactivation.in_term_reactivation_option",
      :value => "allow_only_on_payment_collection",
      :level => 1,
      :allow_override_in_interface => "false",
      :criteria => "[{\"operand\": \"request_source\", \"operator\": \"in\", \"values\": [\"api\"]}]"
    }
  ]
})

list = result.list
```

## Sample Response

```json
{
  "list": [
    {
      "preference": {
        "id": "subscription_reactivation.in_term_reactivation_option",
        "preference_group": "subscription_reactivation",
        "value": "allow_reactivation",
        "allow_override_in_interface": true,
        "modified_at": 1787543613,
        "object": "preference"
      }
    },
    {..}
  ]
}
```

## URL Format

**POST** https://[site].chargebee.com/api/v2/preferences

## Input Parameters

- `preferences` (optional, array)
  Parameters for preferences. Each entry updates one preference. This parameter is required; omitting it, or sending an empty array, is rejected. A synchronous call accepts at most 25 entries. An asynchronous call accepts at most 100. Each variant counts as its own entry. Entries are applied together, so if any entry fails validation none of the changes take effect. Only preferences whose definition has `access_mode` set to `read_write` can be updated.
  - `id` (required, string, max chars=150)
    Identifies the preference to change, in the form `<preference_group>.<name>`, for example `subscription_reactivation.in_term_reactivation_option`. Take the id from [List preference definitions](/docs/api/preference_definitions/list-preference-definitions). Send one id per entry.
  - `value` (required, string, max chars=65k)
    The new value, sent as a string. Encode each type as follows:
    
    -   boolean: `"true"` or `"false"`
    -   numeric: `"7"`
    -   list: `"[\"a\"]"` (an array encoded as a string)
  - `allow_override_in_interface` (optional, boolean)
    Whether this preference's value may be overridden for a single operation from the Chargebee interface. Accepted only for preferences whose definition reports `overridable_in_interface`; sending it for any other preference is rejected. Omit it to leave the current override setting unchanged. Other fields in that entry may still change.
  - `level` (optional, integer)
    The variant's priority. Higher levels are evaluated first. A request that matches both level `2` and level `1` uses level `2`. The base preference omits this field, and variant levels start at `1`. See [Preference variants](/docs/api/preferences#preference-variants).
  - `criteria` (optional, array)
    JSON array of criteria for a variant. Send it together with `level`. Each element has `operand`, `operator`, and `values`. The operands and operators a preference accepts are listed as `criteria_schema` in [List preference definitions](/docs/api/preference_definitions/list-preference-definitions). Supply exactly one `values` entry for the `is` operator, and one or more for `in`.

## Returns

- `preference` (Preference object)
  Resource object representing preference
