Advanced: fees

Update a convert operator

Changes the fields you send and leaves the rest untouched.

PUT /convert-operators/{op_id}

Changes the fields you send and leaves the rest untouched. A new name, mode or rate is saved as a new revision; is_searchable alone only changes sharing. Only the owner can update a convert operator.

  • expected_sequence (the sequence you last read) refuses the update with 409 if the record changed since.
  • The currency pair is fixed: sending from_currency_id or to_currency_id returns 422. Create a new convert operator for a different pair.
  • A fixed convert operator must keep a positive rate: setting mode to fixed without one, or removing the rate of a fixed one, returns 422.
  • 404: not found or not visible to you. 409: visible but not yours; fork it to get an editable copy.

[!warning] The change applies immediately to every calculation chain and group that uses this convert operator, including other users' if you have shared it.

Usage

NameDescription
AuthenticationAPI key required
Credit costFree

Parameters

NameInTypeRequiredDescription
op_idpathintegerYesID of the convert operator.

Request body

FieldTypeRequiredDescription
namestringNoNew display name. Default: ``.
from_currency_idinteger or nullNoNot updatable. Sending this field is rejected with 422; create a new convert operator for a different currency pair.
to_currency_idinteger or nullNoNot updatable. Sending this field is rejected with 422; create a new convert operator for a different currency pair.
modestringNoNew mode: auto or fixed. Values: auto, fixed. Default: auto.
ratenumber or string or nullNoNew fixed rate, as a positive exact decimal with at most 12 decimal places. A fixed convert operator must keep a rate.
is_searchablebooleanNoShare or stop sharing the convert operator. Unsharing hides it from search and new references; existing references keep working. Default: false.
expected_sequenceinteger or nullNoThe sequence you last read. If the record changed since, the request is rejected with 409 conflict (details.expected / details.actual) and nothing is saved. Omit it to skip the check.
reasonstringNoOptional note saved with the new revision, shown in its history. Default: ``.

Responses

StatusDescriptionSchema
200Successful ResponseEnvelope_ConvertOperatorOut_
400The request references a resource that does not exist, or carries an invalid cursorErrorEnvelope
401Authentication is missing or invalidErrorEnvelope
403The credential is valid but not allowed to call this operationErrorEnvelope
404The requested resource does not existErrorEnvelope
409The request conflicts with the current state of a resourceErrorEnvelope
422A parameter or the request body is invalidErrorEnvelope
429Too many requests to this endpoint; retry laterErrorEnvelope
503The service is temporarily unavailable; retry laterErrorEnvelope

Models

ConvertOperatorOut

A convert operator: converts the running amount from one currency to another.

FieldTypeRequiredDescription
kind"convert"YesRecord type: always convert.
idinteger or nullYesUnique ID of the convert operator.
namestringYesDisplay name.
fromCurrencyOutYesSource currency (fixed at creation).
toCurrencyOutYesTarget currency (fixed at creation).
modestringYesauto converts through both currencies' usd_rate; fixed multiplies by rate. Values: auto, fixed.
ratestring or nullYesUnits of the target currency per one unit of the source currency, as a decimal string; used in fixed mode.
owner_user_idstring or nullYesID of the owning user; null for platform-owned records, which include every official record.
is_officialbooleanYesWhether this is an official convert operator published by the platform. Official records are read-only for users.
is_searchablebooleanYesWhether the owner shares this convert operator, so other users can find, reference and fork it.
ref_countintegerYesHow many times this convert operator is referenced (by calculation chain steps and group memberships) or has been forked. Informational only.
forked_frominteger or nullYesID of the convert operator this one was forked from; null if it was created from scratch.
is_deletedbooleanYesWhether the convert operator is deleted. Deleted records are never returned again, so this is true only in a delete response.
revisioninteger or nullYesCurrent revision of the convert operator: 1 when created, one more with every saved change. null only for an inline record.
sequenceinteger or nullYesChange counter of the convert operator: rises with every saved revision and every change of sharing or lifecycle. Send it back as expected_sequence to detect concurrent changes.

CreditMeta

Credit accounting for a billable request.

FieldTypeRequiredDescription
costintegerYesCredits this request costs.
remainingintegerYesEstimated credit balance left after this request. A hint rather than a ledger: concurrent requests can make it slightly off.

CurrencyOut

A currency and its US dollar value.

FieldTypeRequiredDescription
idinteger or nullYesUnique ID of the currency.
codestringYesCurrency code, e.g. USD.
namestring or nullYesDisplay name.
kindstringYesCurrency kind, e.g. fiat.
usd_ratestringYesValue of one unit of this currency in US dollars, as a decimal string. Used by auto conversions.
owner_user_idstring or nullYesID of the owning user; null for platform currencies, which include every official currency.
is_officialbooleanYesWhether the currency belongs to the official catalog maintained by the platform.
ref_countintegerYesNumber of convert operators that use this currency.
is_deletedbooleanYesWhether the currency is deleted. Deleted currencies are never listed, so this is true only in a delete response.

Envelope_ConvertOperatorOut_

FieldTypeRequiredDescription
dataConvertOperatorOutYesThe endpoint payload.
metaMetaYesRequest metadata.

ErrorBody

Details of a failed request.

FieldTypeRequiredDescription
codestringYesStable machine-readable error code. Branch on this value, not on message.
messagestringYesHuman-readable explanation. The wording may change.
detailsobject or nullNoOptional structured context, such as the list of validation errors or, for credit_insufficient, the required and remaining credits.

ErrorEnvelope

Error response: the error in error plus request metadata in meta.

FieldTypeRequiredDescription
errorErrorBodyYesWhat went wrong.
metaMetaYesRequest metadata.

Meta

Request metadata included in every enveloped response.

FieldTypeRequiredDescription
request_idstringYesUnique identifier of this request, identical to the X-Request-ID response header. Quote it when contacting support.
billableboolean or nullNoWhether the request is billed in credits. Present only on metered endpoints; false means the request is free, for example because it costs nothing or your subscription covers it.
creditCreditMeta or nullNoCost of the request and your estimated remaining balance. Present only when billable is true.
pagePageMeta or nullNoPaging state. Present only on a response that lists a page.

PageMeta

Where a paged list stands after this page.

FieldTypeRequiredDescription
limitintegerYesPage size actually applied to this request.
has_nextbooleanYesWhether another page follows.
next_cursorstring or nullYesPass it back unchanged as cursor to get the next page; null once the list is complete.

Download the public OpenAPI schema