> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dfns.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel an unfilled 0fns order placement

> Craft and broadcast an on-chain cancelOrder to cancel a 0fns OrderBook order placement that was not filled, reclaiming its escrow. The escrowed input token is returned to the wallet that funded the order.

#### Authentication

✅ Organization User (`CustomerEmployee`)\
❌ Delegated User (`EndUser`)\
✅ Service Account

#### Required Permissions

`Allocations:Update`: Always required\
`Wallets:Transactions:Create`: Always required. The cancellation (cancelOrder) is broadcast from your wallet.\
`FeeSponsors:Use`: Required if `feeSponsorId` is specified and the sponsoree wallet belongs to an `EndUser` user kind.


## OpenAPI

````yaml /openapi.yaml post /allocations/cancel-0fns-order-placement
openapi: 3.1.0
info:
  version: 2.0.155
  title: Dfns
servers:
  - url: https://api.dfns.io
    description: Default - Europe
  - url: https://api.uae.dfns.io
    description: UAE
  - url: https://api.dfns.ninja
    description: <Deprecated> Staging
security: []
paths:
  /allocations/cancel-0fns-order-placement:
    post:
      tags:
        - Allocations
      summary: Cancel an unfilled 0fns order placement
      description: >-
        Craft and broadcast an on-chain cancelOrder to cancel a 0fns OrderBook
        order placement that was not filled, reclaiming its escrow. The escrowed
        input token is returned to the wallet that funded the order.
      operationId: cancel0fnsOrderPlacement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                allocationActionId:
                  type: string
                  minLength: 1
                  maxLength: 64
                  pattern: ^allctn-a-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                  description: >-
                    The 0fns allocation action whose unfilled OrderBook order
                    placement should be cancelled.
                  example: allctn-a-04p5n-gkkgd-5qk71nuev5n2ug1t
                externalId:
                  type: string
                  description: >-
                    An optional external identifier provided by the client to
                    ensure idempotency and prevent duplicate operations.
                feeSponsorId:
                  type: string
                  minLength: 1
                  maxLength: 64
                  pattern: ^fs-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                  description: >-
                    Id of the fee sponsor that will pay the network fees for
                    this allocation. When set, allocation transactions are
                    broadcast as sponsored user operations.
                  example: fs-5vqdl-gliqk-b4rfukqauov1sp7j
              required:
                - allocationActionId
              description: >-
                Cancel an unfilled 0fns OrderBook order placement and reclaim
                its escrow to the funding wallet.
              title: 0fns Order Placement Cancellation Request
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  transactionId:
                    type: string
                    description: Id of the broadcast on-chain cancelOrder transaction.
                required:
                  - transactionId
                description: The broadcast 0fns order-placement cancellation transaction.
      security:
        - authenticationToken: []
          userActionSignature: []
components:
  securitySchemes:
    authenticationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        **Bearer Token:** Used to authenticate API requests.

        More details how to generate the token: [Authentication
        flows](https://docs.dfns.co/api-reference/auth/login-flows)
    userActionSignature:
      type: apiKey
      in: header
      name: X-DFNS-USERACTION
      description: >-
        **User Action Signature:** Used to sign the change-inducing API
        requests.

        More details how to generate the token: [User Action Signing
        flows](https://docs.dfns.co/api-reference/auth/signing-flows)

````