Kraken · Arazzo Workflow

Kraken Cancel and Replace a Spot Order

Version 1.0.0

Inspect an order, cancel it, then place a replacement order.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub CryptocurrencyExchangeTradingMarket DataSpot TradingFuturesDerivativesStakingEarnNFTWebSocketFIXCustodyOTCPrime BrokerageEmbedAuthenticationPublic APIsArazzoWorkflows

Provider

kraken

Workflows

cancel-and-replace-order
Cancel a resting spot order and submit a replacement.
Reads the target order, cancels it, branches on a confirmed cancellation, and places a new order with the supplied replacement terms.
3 steps inputs: nonce, ordertype, otp, pair, price, txid, type, volume outputs: cancelledCount, replacementTxid
1
inspectOrder
Query the existing order to confirm its current terms before cancelling. Private Spot endpoints are signed and accept application/x-www-form-urlencoded bodies.
2
cancel
Cancel the order by transaction id. The result count reflects how many orders were cancelled.
3
replace
Place the replacement order with the new terms once the original has been confirmed cancelled.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Kraken Cancel and Replace a Spot Order
  summary: Inspect an order, cancel it, then place a replacement order.
  description: >-
    A reprice flow for the Kraken Spot REST API for cases where an in-place
    amendment is not appropriate. It queries the existing order, cancels it, and
    on a confirmed cancellation submits a fresh order with new terms. Every step
    spells out its request inline so the flow can be read and executed without
    opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: accountDataApi
  url: ../openapi/kraken-account-data-api-openapi.yml
  type: openapi
- name: tradingApi
  url: ../openapi/kraken-trading-api-openapi.yml
  type: openapi
workflows:
- workflowId: cancel-and-replace-order
  summary: Cancel a resting spot order and submit a replacement.
  description: >-
    Reads the target order, cancels it, branches on a confirmed cancellation,
    and places a new order with the supplied replacement terms.
  inputs:
    type: object
    required:
    - nonce
    - txid
    - pair
    - type
    - ordertype
    - volume
    properties:
      nonce:
        type: string
        description: Ever-increasing nonce for the signed request.
      otp:
        type: string
        description: One-time password if two-factor is enabled on the API key.
      txid:
        type: string
        description: The transaction id of the order to cancel.
      pair:
        type: string
        description: The asset pair for the replacement order (e.g. XBTUSD).
      type:
        type: string
        description: Direction of the replacement order, buy or sell.
      ordertype:
        type: string
        description: Type of the replacement order (market, limit, etc.).
      volume:
        type: string
        description: Volume of the replacement order in base-asset terms.
      price:
        type: string
        description: Limit price for the replacement order.
  steps:
  - stepId: inspectOrder
    description: >-
      Query the existing order to confirm its current terms before cancelling.
      Private Spot endpoints are signed and accept application/x-www-form-urlencoded
      bodies.
    operationId: queryOrdersInfo
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        nonce: $inputs.nonce
        otp: $inputs.otp
        txid: $inputs.txid
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      orders: $response.body#/result
  - stepId: cancel
    description: >-
      Cancel the order by transaction id. The result count reflects how many
      orders were cancelled.
    operationId: cancelOrder
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        nonce: $inputs.nonce
        otp: $inputs.otp
        txid: $inputs.txid
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      count: $response.body#/result/count
    onSuccess:
    - name: cancelled
      type: goto
      stepId: replace
      criteria:
      - context: $response.body
        condition: $.result.count > 0
        type: jsonpath
    - name: nothingCancelled
      type: end
      criteria:
      - context: $response.body
        condition: $.result.count == 0
        type: jsonpath
  - stepId: replace
    description: >-
      Place the replacement order with the new terms once the original has been
      confirmed cancelled.
    operationId: addOrder
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        nonce: $inputs.nonce
        otp: $inputs.otp
        pair: $inputs.pair
        type: $inputs.type
        ordertype: $inputs.ordertype
        volume: $inputs.volume
        price: $inputs.price
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      txid: $response.body#/result/txid
      descr: $response.body#/result/descr
  outputs:
    cancelledCount: $steps.cancel.outputs.count
    replacementTxid: $steps.replace.outputs.txid

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/kraken-cancel-and-replace-order-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.