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_sequenceis the slotsequenceyou 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(reasondeleted) 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
0to 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
| Name | Description |
|---|---|
| Authentication | API key required |
| Credit cost | Free |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
website_code | path | string | Yes | Marketplace code of the binding. |
purpose | path | string | Yes | What the bound chain prices on this marketplace: deposit, sale or withdraw. Values: deposit, sale, withdraw. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
calculation_chain_id | integer | Yes | ID of the chain to bind: your own, official or shared by another user, and not deprecated. |
calculation_chain_revision | integer or null | No | Revision 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_sequence | integer or null | No | The 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
| Status | Description | Schema |
|---|---|---|
200 | Successful Response | Envelope_WebsiteCalculationChainBindingSlotOut_ |
400 | The request references a resource that does not exist, or carries an invalid cursor | ErrorEnvelope |
401 | Authentication is missing or invalid | ErrorEnvelope |
403 | The credential is valid but not allowed to call this operation | ErrorEnvelope |
409 | The request conflicts with the current state of a resource | ErrorEnvelope |
422 | A parameter or the request body is invalid | ErrorEnvelope |
429 | Too many requests to this endpoint; retry later | ErrorEnvelope |
503 | The service is temporarily unavailable; retry later | ErrorEnvelope |
Models
CreditMeta
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. |
Envelope_WebsiteCalculationChainBindingSlotOut_
| Field | Type | Required | Description |
|---|---|---|---|
data | WebsiteCalculationChainBindingSlotOut | Yes | The endpoint payload. |
meta | Meta | Yes | Request metadata. |
ErrorBody
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. |
ErrorEnvelope
Error response: the error in error plus request metadata in meta.
Meta
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. |
PageMeta
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. |
WebsiteCalculationChainBindingSlotOut
The calculation chain that applies to one marketplace and purpose.
| Field | Type | Required | Description |
|---|---|---|---|
purpose | string | Yes | Purpose: 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 of the chain: the one that applies. |
calculation_chain_name | string or null | Yes | Display name of the bound chain in that revision, if set. |
source | string | Yes | user if this is your own binding, platform if it is the platform default. Values: user, platform. |
calculation_chain_is_official | boolean | Yes | Whether the bound chain is official. |
calculation_chain_is_searchable | boolean | Yes | Whether the bound chain is shared by its owner. |
calculation_chain_owner_user_id | string or null | Yes | ID of the bound chain's owner; null for a platform chain. |
is_deprecated | boolean | Yes | Whether the bound chain is deprecated. Only bindings from before deprecation became final can show true; such a slot is available: false. |
ref_count | integer | Yes | How many times the bound chain is bound or has been forked. |
step_count | integer | Yes | Number of steps in the bound revision of the chain. |
sequence | integer | Yes | Your slot's sequence: send it back as expected_sequence. |
available | boolean | Yes | Whether the binding can be applied; see reason. |
reason | string or null | Yes | Why the binding cannot be applied: deprecated (the chain is deprecated) or missing (the chain is gone); null when available. Values: deprecated, missing. |