Advanced: fees
Update a calculation chain
Changes the fields you send and leaves the rest untouched.
PUT /calculation-chains/{calculation_chain_id}
Changes the fields you send and leaves the rest untouched. A new name, steps, input_auto or output_auto is saved as a new revision; is_searchable alone only changes sharing. Only the owner can update a chain.
expected_sequence (the sequence you last read) refuses the update with 409 if the chain changed since.steps replaces the whole step list. Newly referenced operators must be available to you (400 with details.missing); operators the chain already used stay valid even if their owner has since stopped sharing them. The new step list is checked like a new chain (422 with details.issues).- A new revision changes no marketplace slot: each slot keeps the revision it is bound to.
apply_to binds slots to the new revision in the same request, all or nothing (409 on a stale slot sequence); applied lists them. - 404: not found or not visible to you. 409: visible but not yours (fork it to get an editable copy), deprecated, or the built-in no-fee chain
0, which nobody can change.
| Name | Description |
|---|
| Authentication | API key required |
| Credit cost | Free |
| Name | In | Type | Required | Description |
|---|
calculation_chain_id | path | integer | Yes | ID of the calculation chain. |
| Field | Type | Required | Description |
|---|
name | string or null | No | New display name. |
is_searchable | boolean | No | Share or stop sharing the chain. Unsharing removes it from search and blocks new bindings and forks; existing bindings keep working. Default: false. |
steps | array of FeeStepRef or ConvertStepRef or ConvertOperatorGroupStepRef | No | New step list; replaces the current steps entirely. |
input_auto | boolean | No | Convert a price quoted in another currency into the chain's start_currency before the first step. Default: true. |
output_auto | boolean | No | Convert the result into the viewer's home currency after the last step. Default: true. |
apply_to | array of ApplyToSlot | No | Marketplace slots to bind to the saved revision in the same request. Either the revision is saved and every slot bound, or nothing changes. |
expected_sequence | integer or null | No | The 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. |
reason | string | No | Optional note saved with the new revision, shown in its history. Default: ``. |
A marketplace slot the save bound to the chain.
| Field | Type | Required | Description |
|---|
website_code | string | Yes | Marketplace code. |
purpose | string | Yes | Purpose slot: deposit, sale or withdraw. Values: deposit, sale, withdraw. |
calculation_chain_id | integer | Yes | ID of the bound chain. |
calculation_chain_revision | integer | Yes | The bound revision. |
sequence | integer | Yes | The slot's new sequence. |
A marketplace slot to bind to the chain being saved.
| Field | Type | Required | Description |
|---|
website_code | string | Yes | Marketplace code, e.g. steam. |
purpose | string | Yes | Purpose slot: deposit, sale or withdraw. Values: deposit, sale, withdraw. |
expected_sequence | integer or null | No | The slot's sequence you last read (0 for a slot never written); a mismatch rejects the whole request with 409 conflict. Omit it to skip the check. |
A saved calculation chain, plus the slots the request bound to it.
| Field | Type | Required | Description |
|---|
id | integer or null | Yes | Unique ID of the calculation chain. |
name | string or null | Yes | Display name, if set. |
start_currency | string or null | Yes | Currency the chain expects its input in, derived from its first step that fixes one (a conversion's source, or the currency of an add/sub fee); null when no step does, i.e. the chain applies to any currency. |
owner_user_id | string or null | Yes | ID of the owning user; null for platform-owned records, which include every official record. |
is_official | boolean | Yes | Whether this is an official chain published by the platform. Official records are read-only for users. |
is_searchable | boolean | Yes | Whether the owner shares this chain, so other users can find, reference and fork it. |
ref_count | integer | Yes | How many times this chain is referenced (by marketplace bindings) or has been forked. Informational only. |
forked_from | integer or null | Yes | ID of the chain this one was forked from; null if it was created from scratch. |
is_deprecated | boolean | Yes | Whether the chain is deprecated, which is final: it stays readable and can be forked, but can no longer be changed or bound. |
is_deleted | boolean | Yes | Whether the chain is deleted. Chains are never deleted any more; only very old ones can show true. |
revision | integer or null | Yes | Revision shown: the chain's current one when opened by ID, the requested one under /revisions/{revision}. |
sequence | integer or null | Yes | Change counter of the chain: rises with every saved revision and every change of sharing or lifecycle. Send it back as expected_sequence to detect concurrent changes. |
input_auto | boolean | Yes | Whether a price in another currency is first converted into start_currency; otherwise this chain does not cover it. |
output_auto | boolean | Yes | Whether the result is converted into the viewer's home currency after the last step. |
steps | array of FeeOperatorOut or ConvertOperatorOut or ConvertOperatorGroupOut | Yes | Steps in execution order, each the full operator it applies, discriminated by kind. |
applied | array of AppliedSlotOut | Yes | Slots bound by apply_to; empty without it. |
A convert operator group: alternative conversions for the same currency pair, combined by a rule.
| Field | Type | Required | Description |
|---|
kind | "convert_operator_group" | Yes | Record type: always convert_operator_group. |
id | integer or null | Yes | Unique ID of the group. |
name | string | Yes | Display name. |
rule | string | Yes | How the result is picked from the members that convert successfully: min, max or avg. Values: min, max, avg. |
members | array of ConvertOperatorOut | Yes | The member convert operators, in order, fully expanded. |
owner_user_id | string or null | Yes | ID of the owning user; null for platform-owned records, which include every official record. |
is_official | boolean | Yes | Whether this is an official group published by the platform. Official records are read-only for users. |
is_searchable | boolean | Yes | Whether the owner shares this group, so other users can find, reference and fork it. |
ref_count | integer | Yes | How many times this group is referenced (by calculation chain steps) or has been forked. Informational only. |
forked_from | integer or null | Yes | ID of the group this one was forked from; null if it was created from scratch. |
is_deleted | boolean | Yes | Whether the group is deleted. Deleted records are never returned again, so this is true only in a delete response. |
revision | integer or null | Yes | Current revision of the group: 1 when created, one more with every saved change. null only for an inline record. |
sequence | integer or null | Yes | Change counter of the group: rises with every saved revision and every change of sharing or lifecycle. Send it back as expected_sequence to detect concurrent changes. |
A chain step that applies a convert operator group.
| Field | Type | Required | Description |
|---|
kind | "convert_operator_group" | Yes | Step type: convert_operator_group. |
convert_operator_group_id | integer | Yes | ID of the convert operator group to apply (your own, official or shared by another user). |
A convert operator: converts the running amount from one currency to another.
| Field | Type | Required | Description |
|---|
kind | "convert" | Yes | Record type: always convert. |
id | integer or null | Yes | Unique ID of the convert operator. |
name | string | Yes | Display name. |
from | CurrencyOut | Yes | Source currency (fixed at creation). |
to | CurrencyOut | Yes | Target currency (fixed at creation). |
mode | string | Yes | auto converts through both currencies' usd_rate; fixed multiplies by rate. Values: auto, fixed. |
rate | string or null | Yes | Units of the target currency per one unit of the source currency, as a decimal string; used in fixed mode. |
owner_user_id | string or null | Yes | ID of the owning user; null for platform-owned records, which include every official record. |
is_official | boolean | Yes | Whether this is an official convert operator published by the platform. Official records are read-only for users. |
is_searchable | boolean | Yes | Whether the owner shares this convert operator, so other users can find, reference and fork it. |
ref_count | integer | Yes | How many times this convert operator is referenced (by calculation chain steps and group memberships) or has been forked. Informational only. |
forked_from | integer or null | Yes | ID of the convert operator this one was forked from; null if it was created from scratch. |
is_deleted | boolean | Yes | Whether the convert operator is deleted. Deleted records are never returned again, so this is true only in a delete response. |
revision | integer or null | Yes | Current revision of the convert operator: 1 when created, one more with every saved change. null only for an inline record. |
sequence | integer or null | Yes | Change 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. |
A chain step that applies a convert operator.
| Field | Type | Required | Description |
|---|
kind | "convert" | Yes | Step type: convert. |
convert_operator_id | integer | Yes | ID of the convert operator to apply (your own, official or shared by another user). |
Credit accounting for a billable request.
| Field | Type | Required | Description |
|---|
cost | integer | Yes | Credits this request costs. |
remaining | integer | Yes | Estimated credit balance left after this request. A hint rather than a ledger: concurrent requests can make it slightly off. |
A currency and its US dollar value.
| Field | Type | Required | Description |
|---|
id | integer or null | Yes | Unique ID of the currency. |
code | string | Yes | Currency code, e.g. USD. |
name | string or null | Yes | Display name. |
kind | string | Yes | Currency kind, e.g. fiat. |
usd_rate | string | Yes | Value of one unit of this currency in US dollars, as a decimal string. Used by auto conversions. |
owner_user_id | string or null | Yes | ID of the owning user; null for platform currencies, which include every official currency. |
is_official | boolean | Yes | Whether the currency belongs to the official catalog maintained by the platform. |
ref_count | integer | Yes | Number of convert operators that use this currency. |
is_deleted | boolean | Yes | Whether the currency is deleted. Deleted currencies are never listed, so this is true only in a delete response. |
Details of a failed request.
| Field | Type | Required | Description |
|---|
code | string | Yes | Stable machine-readable error code. Branch on this value, not on message. |
message | string | Yes | Human-readable explanation. The wording may change. |
details | object or null | No | Optional structured context, such as the list of validation errors or, for credit_insufficient, the required and remaining credits. |
Error response: the error in error plus request metadata in meta.
| Field | Type | Required | Description |
|---|
error | ErrorBody | Yes | What went wrong. |
meta | Meta | Yes | Request metadata. |
A fee operator: one arithmetic step applied to the running amount.
| Field | Type | Required | Description |
|---|
kind | "fee" | Yes | Record type: always fee. |
id | integer or null | Yes | Unique ID of the fee operator. |
name | string | Yes | Display name. |
operator | string | Yes | Arithmetic applied to the running amount: add, sub, mul or div. Values: add, sub, mul, div. |
value | string | Yes | Operand of the arithmetic, as a decimal string. |
currency_code | string or null | Yes | Currency of the amount for add and sub; null for mul and div. |
owner_user_id | string or null | Yes | ID of the owning user; null for platform-owned records, which include every official record. |
is_official | boolean | Yes | Whether this is an official fee operator published by the platform. Official records are read-only for users. |
is_searchable | boolean | Yes | Whether the owner shares this fee operator, so other users can find, reference and fork it. |
ref_count | integer | Yes | How many times this fee operator is referenced (by calculation chain steps) or has been forked. Informational only. |
forked_from | integer or null | Yes | ID of the fee operator this one was forked from; null if it was created from scratch. |
is_deleted | boolean | Yes | Whether the fee operator is deleted. Deleted records are never returned again, so this is true only in a delete response. |
revision | integer or null | Yes | Current revision of the fee operator: 1 when created, one more with every saved change. null only for an inline record. |
sequence | integer or null | Yes | Change counter of the fee operator: rises with every saved revision and every change of sharing or lifecycle. Send it back as expected_sequence to detect concurrent changes. |
A chain step that applies a fee operator.
| Field | Type | Required | Description |
|---|
kind | "fee" | Yes | Step type: fee. |
fee_operator_id | integer | Yes | ID of the fee operator to apply (your own, official or shared by another user). |
Request metadata included in every enveloped response.
| Field | Type | Required | Description |
|---|
request_id | string | Yes | Unique identifier of this request, identical to the X-Request-ID response header. Quote it when contacting support. |
billable | boolean or null | No | Whether 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. |
credit | CreditMeta or null | No | Cost of the request and your estimated remaining balance. Present only when billable is true. |
page | PageMeta or null | No | Paging state. Present only on a response that lists a page. |
Where a paged list stands after this page.
| Field | Type | Required | Description |
|---|
limit | integer | Yes | Page size actually applied to this request. |
has_next | boolean | Yes | Whether another page follows. |
next_cursor | string or null | Yes | Pass it back unchanged as cursor to get the next page; null once the list is complete. |
Download the public OpenAPI schema