Advanced: fees

Bind a calculation chain to a marketplace

Binds a calculation chain revision (calculation_chain_revision, the chain's current one by default) to one marketplace and purpose, replacing what you had bound there, and returns the resulting slot.

PUT /website-calculation-chain-bindings/{website_code}/{purpose}

Binds a calculation chain revision (calculation_chain_revision, the chain's current one by default) to one marketplace and purpose, replacing what you had bound there, and returns the resulting slot.

  • expected_sequence is the slot sequence you last read (0 for a slot never written): if the slot changed since, 409 and nothing changes.
  • Another chain must be your own, official or shared by another user (400 otherwise) and not deprecated (409).
  • Binding an earlier revision again requires everything it uses to still exist: 409 with details.missing (reason deleted) otherwise.
  • Re-binding what is already bound succeeds even if that chain has since been unshared.
  • 400 if the marketplace code is unknown.
  • Bind the built-in chain 0 to record that the purpose is free; remove the binding instead when the fee is unknown.

[!note] This sets your own binding, which only you see.

Usage

NameDescription
AuthenticationAPI key required
Credit costFree

Parameters

NameInTypeRequiredDescription
website_codepathstringYesMarketplace code of the binding.
purposepathstringYesWhat the bound chain prices on this marketplace: deposit, sale or withdraw. Values: deposit, sale, withdraw.

Request body

FieldTypeRequiredDescription
calculation_chain_idintegerYesID of the chain to bind: your own, official or shared by another user, and not deprecated.
calculation_chain_revisioninteger or nullNoRevision to bind; the chain's current one when omitted. Binding an earlier revision again requires everything it uses to still exist (409 conflict with details.missing otherwise).
expected_sequenceinteger or nullNoThe slot's sequence you last read (0 for a slot never written). If the slot changed since, the request is rejected with 409 conflict and nothing is saved. Omit it to skip the check.

Responses

StatusDescriptionSchema
200Successful ResponseEnvelope_WebsiteCalculationChainBindingSlotOut_
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
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

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.

Envelope_WebsiteCalculationChainBindingSlotOut_

FieldTypeRequiredDescription
dataWebsiteCalculationChainBindingSlotOutYesThe 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.

WebsiteCalculationChainBindingSlotOut

The calculation chain that applies to one marketplace and purpose.

FieldTypeRequiredDescription
purposestringYesPurpose: deposit, sale or withdraw. Values: deposit, sale, withdraw.
calculation_chain_idintegerYesID of the bound chain.
calculation_chain_revisionintegerYesThe bound revision of the chain: the one that applies.
calculation_chain_namestring or nullYesDisplay name of the bound chain in that revision, if set.
sourcestringYesuser if this is your own binding, platform if it is the platform default. Values: user, platform.
calculation_chain_is_officialbooleanYesWhether the bound chain is official.
calculation_chain_is_searchablebooleanYesWhether the bound chain is shared by its owner.
calculation_chain_owner_user_idstring or nullYesID of the bound chain's owner; null for a platform chain.
is_deprecatedbooleanYesWhether the bound chain is deprecated. Only bindings from before deprecation became final can show true; such a slot is available: false.
ref_countintegerYesHow many times the bound chain is bound or has been forked.
step_countintegerYesNumber of steps in the bound revision of the chain.
sequenceintegerYesYour slot's sequence: send it back as expected_sequence.
availablebooleanYesWhether the binding can be applied; see reason.
reasonstring or nullYesWhy the binding cannot be applied: deprecated (the chain is deprecated) or missing (the chain is gone); null when available. Values: deprecated, missing.

Download the public OpenAPI schema