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
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 can include up to 100 entries. Send Prefer: respond-async, chargebee-request-id, and chargebee-async-callback-url. See 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
valueagainst the preference'svalue_schema - The preference's
applicabilityconditions against the resulting configuration - For variants, the
valueagainst the samevalue_schemaand thecriteriaagainst the preference'scriteria_schema
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
Sample Result[JSON]
URL Format
Input Parameters
Returns
Resource object representing preference