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

# Build a deterministic close plan with decision points and estimates.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/{network}/close/plan
openapi: 3.0.0
info:
  title: LumenWipe API
  description: Programmatic close-out of Stellar accounts.
  version: 0.1.0
  contact: {}
servers:
  - url: https://api.lumenwipe.com
security: []
tags:
  - name: close
    description: Build and submit an account close-out
  - name: account
    description: Read account state and conversion paths
  - name: mediator
    description: Exchange-destination forwarding
  - name: health
    description: Service health
  - name: service
    description: Service index
  - name: admin
    description: Operator-only self-serve API key management
paths:
  /v1/{network}/close/plan:
    post:
      tags:
        - close
      summary: Build a deterministic close plan with decision points and estimates.
      operationId: CloseController_plan
      parameters:
        - name: network
          required: true
          in: path
          schema:
            enum:
              - testnet
              - mainnet
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClosePlanRequestDto'
      responses:
        '200':
          description: Plan with pending decision points, fee and freed-reserve estimate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanResponseDto'
        '400':
          description: Invalid network, source, destination, or JSON body.
        '401':
          description: Missing or invalid API key.
        '404':
          description: Source account not found.
        '429':
          description: Rate limit exceeded for this key.
      security:
        - api-key: []
components:
  schemas:
    ClosePlanRequestDto:
      type: object
      properties:
        source:
          type: string
          description: Account to close (G...).
          example: GABC...XYZ
        destination:
          type: string
          description: >-
            Destination for the recovered XLM (G...). Omit to preview without a
            destination.
          example: GDEF...UVW
        decisions:
          type: array
          description: >-
            Answers to the plan's decision points (per-asset dispositions,
            etc.).
          items:
            type: object
      required:
        - source
    PlanResponseDto:
      type: object
      properties:
        planHash:
          type: string
          description: >-
            Deterministic hash of this plan's content - unchanged inputs yield
            the same hash.
        status:
          type: string
          enum:
            - ready
            - needs_decisions
            - blocked
            - complete
        steps:
          type: array
          items:
            $ref: '#/components/schemas/PlannedStepDto'
        decisionPoints:
          type: array
          items:
            $ref: '#/components/schemas/DecisionPointDto'
        blockers:
          type: array
          items:
            $ref: '#/components/schemas/PlanResponseBlockerDto'
        estimate:
          $ref: '#/components/schemas/PlanEstimateDto'
        execution:
          $ref: '#/components/schemas/PlanExecutionDto'
      required:
        - planHash
        - status
        - steps
        - decisionPoints
        - blockers
        - estimate
        - execution
    PlannedStepDto:
      type: object
      properties:
        index:
          type: number
          description: Position in the plan's step list, from 0.
        type:
          type: string
          enum:
            - NORMALIZE_SIGNERS
            - REVOKE_SPONSORSHIP
            - REMOVE_DATA_ENTRIES
            - CANCEL_OFFERS
            - ADD_TRUSTLINE_FOR_CLAIM
            - CLAIM_BALANCES
            - EXIT_POSITIONS
            - HANDLE_ASSETS
            - REMOVE_TRUSTLINES
            - CLOSE_ACCOUNT
            - MERGE
        title:
          type: string
          description: Short, human-readable title for display.
        description:
          type: string
          description: Longer, human-readable description for display.
        operationCount:
          type: number
          description: Number of operations this step's transaction will contain.
        estimatedFeeLumens:
          type: string
          description: Estimated fee in XLM, before the step actually builds/submits.
          example: '0.0000100'
        txXdr:
          type: string
          description: >-
            Populated lazily at execution time - null until the step is actually
            built.
          nullable: true
        status:
          type: string
          enum:
            - pending
            - signing
            - submitted
            - confirmed
            - failed
            - skipped
        txHash:
          type: string
          description: Populated once submitted - null before then.
          nullable: true
        error:
          type: string
          description: Populated only if the step failed - null otherwise.
          nullable: true
        actualFeeLumens:
          type: string
          description: >-
            What the user's own account paid for this step, once confirmed -
            exactly "0" when a dedicated sponsor account covered the fee-bump
            instead. Absent until the step confirms.
        affectedAsset:
          type: string
          description: 'For HANDLE_ASSETS steps: the affected asset.'
        affectedContract:
          type: string
          description: 'For EXIT_POSITIONS steps: the pool, pair, or vault left.'
        fallbackToIssuer:
          type: boolean
          description: >-
            Set when no DEX path exists and the user confirmed sending to the
            issuer instead.
      required:
        - index
        - type
        - title
        - description
        - operationCount
        - estimatedFeeLumens
        - txXdr
        - status
        - txHash
        - error
    DecisionPointDto:
      type: object
      properties:
        id:
          type: string
          description: Stable id, e.g. "asset:USDC-GISSUER...".
        type:
          type: string
          enum:
            - asset_disposition
            - confirmation
            - choice
            - claimable_balance
        subject:
          type: object
          description: >-
            The subject of this decision - shape depends on `type` (e.g. an
            asset code/issuer/balance for asset_disposition, a claimable balance
            id for claimable_balance). Freeform by design: there is one
            decision-point contract per `type`, not one global shape.
          additionalProperties: true
        options:
          type: array
          items:
            $ref: '#/components/schemas/DecisionOptionDto'
        default:
          type: string
          description: The option id applied if the caller never answers this decision.
        required:
          type: boolean
          description: Whether an answer is mandatory before the plan can proceed.
      required:
        - id
        - type
        - subject
        - options
        - default
        - required
    PlanResponseBlockerDto:
      type: object
      properties:
        code:
          type: string
          description: Stable machine-readable code for this blocker.
        message:
          type: string
          description: Plain-language explanation.
        helpUrl:
          type: string
          description: A docs link with more detail.
      required:
        - code
        - message
    PlanEstimateDto:
      type: object
      properties:
        feeStroops:
          type: string
          description: Estimated total fee across every transaction, in stroops.
        freedReserveXlm:
          type: string
          description: Estimated XLM freed by removing subentries, in XLM.
      required:
        - feeStroops
        - freedReserveXlm
    PlanExecutionDto:
      type: object
      properties:
        estimatedTransactionCount:
          type: number
          description: Estimated number of transactions this close will take.
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/ExecutionTxBreakdownDto'
      required:
        - estimatedTransactionCount
        - transactions
    DecisionOptionDto:
      type: object
      properties:
        id:
          type: string
          description: >-
            One of a decision-type-specific set, e.g. "convert_to_xlm" |
            "return_to_issuer" | "transfer_to_account" | "acknowledged".
        recommended:
          type: boolean
          description: Whether this is the option the plan recommends.
        quote:
          $ref: '#/components/schemas/QuoteInfoDto'
        note:
          type: string
          description: Plain-language note about this option.
      required:
        - id
    ExecutionTxBreakdownDto:
      type: object
      properties:
        order:
          type: number
          description: Position among the transactions this plan will take to execute.
        covers:
          type: array
          items:
            type: string
            enum:
              - NORMALIZE_SIGNERS
              - REVOKE_SPONSORSHIP
              - REMOVE_DATA_ENTRIES
              - CANCEL_OFFERS
              - ADD_TRUSTLINE_FOR_CLAIM
              - CLAIM_BALANCES
              - EXIT_POSITIONS
              - HANDLE_ASSETS
              - REMOVE_TRUSTLINES
              - CLOSE_ACCOUNT
              - MERGE
        reason:
          type: string
          description: Why this transaction is split from the previous one, when it is.
          enum:
            - op_batch
            - defi_dependency
      required:
        - order
        - covers
    QuoteInfoDto:
      type: object
      properties:
        estimatedReceive:
          type: string
          description: Estimated amount received.
          example: '42.5000000'
        path:
          description: Intermediate assets the route swaps through, in order.
          type: array
          items:
            type: string
        source:
          type: string
          enum:
            - soroswap
            - sdex
        expiresAtLedger:
          type: number
          description: The ledger this quote is no longer valid past.
      required:
        - estimatedReceive
        - path
        - source
        - expiresAtLedger
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: opaque
      type: http
      description: Integrator API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.