Backpack · Arazzo Workflow

Backpack Cancel and Replace an Order

Version 1.0.0

Look up a resting order, cancel it, and place a replacement at a new price.

1 workflow 1 source API 1 provider
View Spec View on GitHub CryptoExchangeWalletsTradingPerpetualsSolanaWeb3DeFixNFTAnchorCoralCentralized ExchangeSelf-CustodyArazzoWorkflows

Provider

backpack

Workflows

cancel-replace-order
Cancel a resting order and replace it with a new limit order on the same side.
Reads the existing order, cancels it, and submits a replacement limit order on the same symbol and side at the supplied new price and quantity.
3 steps inputs: apiKey, newPrice, newQuantity, orderId, side, signature, symbol, timestamp, window outputs: cancelledOrderId, newOrderId, newStatus
1
getOrder
Read the resting order by id to confirm it is still on the book before attempting to cancel it.
2
cancelOrder
Cancel the resting order from the order book by its id.
3
placeReplacement
Submit the replacement limit order on the same symbol and side at the new price and quantity.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Backpack Cancel and Replace an Order
  summary: Look up a resting order, cancel it, and place a replacement at a new price.
  description: >-
    A common market-making maintenance flow on the Backpack Exchange. The
    workflow reads a resting order by id to capture its symbol and side, cancels
    it from the order book, and then submits a fresh limit order on the same side
    at a new price and quantity. Every step inlines its request — including the
    ED25519 signing headers required on authenticated calls — so the flow can be
    read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: orderApi
  url: ../openapi/backpack-order-api-openapi.yml
  type: openapi
workflows:
- workflowId: cancel-replace-order
  summary: Cancel a resting order and replace it with a new limit order on the same side.
  description: >-
    Reads the existing order, cancels it, and submits a replacement limit order
    on the same symbol and side at the supplied new price and quantity.
  inputs:
    type: object
    required:
    - symbol
    - orderId
    - side
    - newPrice
    - newQuantity
    - apiKey
    - signature
    - timestamp
    properties:
      symbol:
        type: string
        description: The market symbol the order exists on (e.g. SOL_USDC).
      orderId:
        type: string
        description: The id of the resting order to cancel and replace.
      side:
        type: string
        enum:
        - Bid
        - Ask
        description: Side for the replacement order; Bid to buy, Ask to sell.
      newPrice:
        type: string
        description: The new limit price as a decimal string.
      newQuantity:
        type: string
        description: The new order quantity in the base asset as a decimal string.
      apiKey:
        type: string
        description: Base64 encoded ED25519 verifying key for the X-API-KEY header.
      signature:
        type: string
        description: Base64 encoded ED25519 signature for the X-SIGNATURE header.
      timestamp:
        type: integer
        description: Unix time in milliseconds for the X-TIMESTAMP header.
      window:
        type: integer
        description: Request validity window in milliseconds for the X-WINDOW header (default 5000).
  steps:
  - stepId: getOrder
    description: >-
      Read the resting order by id to confirm it is still on the book before
      attempting to cancel it.
    operationId: get_order
    parameters:
    - name: X-API-KEY
      in: header
      value: $inputs.apiKey
    - name: X-SIGNATURE
      in: header
      value: $inputs.signature
    - name: X-TIMESTAMP
      in: header
      value: $inputs.timestamp
    - name: X-WINDOW
      in: header
      value: $inputs.window
    - name: orderId
      in: query
      value: $inputs.orderId
    - name: symbol
      in: query
      value: $inputs.symbol
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      existingStatus: $response.body#/status
      existingSymbol: $response.body#/symbol
  - stepId: cancelOrder
    description: >-
      Cancel the resting order from the order book by its id.
    operationId: cancel_order
    parameters:
    - name: X-API-KEY
      in: header
      value: $inputs.apiKey
    - name: X-SIGNATURE
      in: header
      value: $inputs.signature
    - name: X-TIMESTAMP
      in: header
      value: $inputs.timestamp
    - name: X-WINDOW
      in: header
      value: $inputs.window
    requestBody:
      contentType: application/json; charset=utf-8
      payload:
        symbol: $inputs.symbol
        orderId: $inputs.orderId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      cancelledStatus: $response.body#/status
      cancelledId: $response.body#/id
  - stepId: placeReplacement
    description: >-
      Submit the replacement limit order on the same symbol and side at the new
      price and quantity.
    operationId: execute_order
    parameters:
    - name: X-API-KEY
      in: header
      value: $inputs.apiKey
    - name: X-SIGNATURE
      in: header
      value: $inputs.signature
    - name: X-TIMESTAMP
      in: header
      value: $inputs.timestamp
    - name: X-WINDOW
      in: header
      value: $inputs.window
    requestBody:
      contentType: application/json; charset=utf-8
      payload:
        symbol: $inputs.symbol
        side: $inputs.side
        orderType: Limit
        price: $inputs.newPrice
        quantity: $inputs.newQuantity
        timeInForce: GTC
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      newOrderId: $response.body#/id
      newStatus: $response.body#/status
  outputs:
    cancelledOrderId: $steps.cancelOrder.outputs.cancelledId
    newOrderId: $steps.placeReplacement.outputs.newOrderId
    newStatus: $steps.placeReplacement.outputs.newStatus

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/backpack-cancel-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.