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

# Preview an order's EIP-712 signing data

> Takes the same params as private/order and rebuilds the order Action without executing anything, returning the EIP-712 encoded_data, encoded_data_hashed, action_hash, typed_data_hash, domain_separator, action_typehash, module, owner and expected_signer, plus the decoded order action data. Byte-compare these against your local computation to find why a signature is rejected. Requires a logged-in session; no trade scope needed.



## OpenAPI

````yaml /openapi.json post /private/order_debug
openapi: 3.1.0
info:
  title: Derive v3 API
  version: 0.2.0
  description: JSON-RPC 2.0 methods, served over WebSocket and HTTP POST.
servers:
  - url: https://api.derive.xyz/v3
    description: Production (HTTP POST base)
  - url: https://testnet.api.derive.xyz/v3
    description: Testnet (HTTP POST base)
security: []
tags:
  - name: Subaccounts
    description: >-
      List, inspect, and label subaccounts, portfolios, positions, and
      collateral.
  - name: Session Keys
    description: Register, edit, and list delegated signing keys.
  - name: Account
    description: Wallet-level account information and settings.
  - name: Orderbook
    description: Place, replace, cancel, and query orders, trigger orders, and algos.
  - name: RFQ
    description: 'Request-for-quote: send RFQs, quote, and execute block trades.'
  - name: Vault Shareholders
    description: >-
      Deposit into and withdraw from vaults, and track shares, requests, and
      performance.
  - name: Vault Curators
    description: >-
      Create and operate curated vaults: settle deposit and withdrawal requests,
      and manage vault metadata.
  - name: History
    description: >-
      Per-account historical records: orders, trades, transfers, and
      settlements.
  - name: Market Maker Protection
    description: Configure, read, and reset market-maker protection.
  - name: Transfers & Withdrawals
    description: Move collateral between subaccounts, to other wallets, and on-chain.
  - name: System
    description: Rate limits and transaction lookups.
  - name: Market Data
    description: Instruments, currencies, tickers, and market-wide feeds.
  - name: Referrals
    description: Referral codes and program performance.
  - name: Other
    description: Uncategorized.
paths:
  /private/order_debug:
    post:
      tags:
        - Orderbook
      summary: Preview an order's EIP-712 signing data
      description: >-
        Takes the same params as private/order and rebuilds the order Action
        without executing anything, returning the EIP-712 encoded_data,
        encoded_data_hashed, action_hash, typed_data_hash, domain_separator,
        action_typehash, module, owner and expected_signer, plus the decoded
        order action data. Byte-compare these against your local computation to
        find why a signature is rejected. Requires a logged-in session; no trade
        scope needed.
      operationId: private_order_debug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDebugResponse'
        default:
          description: JSON-RPC error (see Error Codes)
components:
  schemas:
    CreateOrderRequest:
      description: '`private/order` params.'
      type: object
      required:
        - amount
        - direction
        - instrument_name
        - limit_price
        - max_fee
        - nonce
        - signature
        - signature_expiry_sec
        - signer
        - subaccount_id
      properties:
        algo_duration_sec:
          default: null
          type:
            - integer
            - 'null'
          format: int32
        algo_num_slices:
          default: null
          type:
            - integer
            - 'null'
          format: int32
        algo_type:
          default: null
          anyOf:
            - $ref: '#/components/schemas/AlgoType'
            - type: 'null'
        amount:
          description: >-
            Order amount in units of the base, as a decimal string (e.g.
            `"1.5"`) or a JSON number.
          type: string
          format: decimal
        client:
          default: null
          type:
            - string
            - 'null'
        direction:
          $ref: '#/components/schemas/Direction'
        extra_fee:
          description: >-
            Optional extra fee per unit of volume, as a decimal string or JSON
            number. Defaults to zero.
          default: null
          type:
            - string
            - 'null'
          format: decimal
        instrument_name:
          type: string
        is_atomic_signing:
          default: null
          type:
            - boolean
            - 'null'
        label:
          default: null
          type:
            - string
            - 'null'
        limit_price:
          description: >-
            Limit price in quote currency, as a decimal string (e.g. `"3100.5"`)
            or a JSON number.
          type: string
          format: decimal
        max_fee:
          description: >-
            Max fee per unit of volume in quote currency, as a decimal string or
            a JSON number.
          type: string
          format: decimal
        mmp:
          default: null
          type:
            - boolean
            - 'null'
        nonce:
          type: string
        order_type:
          $ref: '#/components/schemas/OrderType'
          default: limit
        reduce_only:
          default: null
          type:
            - boolean
            - 'null'
        referral_code:
          default: null
          type:
            - string
            - 'null'
        reject_post_only:
          default: null
          type:
            - boolean
            - 'null'
        reject_timestamp:
          default: null
          type:
            - integer
            - 'null'
          format: int64
        signature:
          type: string
        signature_expiry_sec:
          type: integer
          format: int64
        signer:
          type: string
        subaccount_id:
          type: integer
          format: int64
        time_in_force:
          $ref: '#/components/schemas/TimeInForce'
          default: gtc
        trigger_price:
          description: >-
            Trigger price as a decimal string or JSON number; omit for
            non-trigger orders.
          default: null
          type:
            - string
            - 'null'
          format: decimal
        trigger_price_type:
          default: null
          anyOf:
            - $ref: '#/components/schemas/TriggerPriceType'
            - type: 'null'
        trigger_type:
          default: null
          anyOf:
            - $ref: '#/components/schemas/TriggerType'
            - type: 'null'
    OrderDebugResponse:
      description: >-
        Debug-route payload for one rebuilt action: the EIP-712 hashes plus the
        action input fields.
      type: object
      required:
        - action_hash
        - action_typehash
        - domain_separator
        - encoded_data
        - encoded_data_hashed
        - expected_signer
        - input_data
        - module
        - owner
        - typed_data_hash
      properties:
        action_hash:
          description: >-
            EIP-712 struct hash of the `Action`:
            `keccak256(abi.encode(action_typehash, …, encoded_data_hashed, …))`.
          type: string
        action_typehash:
          description: >-
            `ACTION_TYPEHASH` — keccak of the `Action` struct type string;
            invariant across deployments.
          type: string
        domain_separator:
          description: >-
            EIP-712 domain separator of the Matching contract for this
            deployment.
          type: string
        encoded_data:
          description: >-
            ABI-encoded, module-specific action payload (the `data` bytes),
            0x-hex.
          type: string
        encoded_data_hashed:
          description: '`keccak256(encoded_data)` — the value packed into the struct hash.'
          type: string
        expected_signer:
          description: The signer the signature is checked against.
          type: string
        input_data:
          $ref: '#/components/schemas/OrderActionInputData'
          description: >-
            The rebuilt `Action` envelope and its decoded module-specific
            `data`.
        module:
          description: Per-action module contract address bound into the signed struct.
          type: string
        owner:
          description: Wallet that owns the subaccount the action applies to.
          type: string
        recovered_signer:
          description: >-
            null on the debug routes (no signature is checked there); on a
            signature-mismatch error this is the address actually recovered.
          type:
            - string
            - 'null'
        typed_data_hash:
          description: >-
            Final EIP-712 digest the client signs: `keccak256(0x1901 ||
            domain_separator || action_hash)`.
          type: string
    AlgoType:
      type: string
      enum:
        - twap
    Direction:
      type: string
      enum:
        - buy
        - sell
    OrderType:
      type: string
      enum:
        - limit
        - market
    TimeInForce:
      type: string
      enum:
        - gtc
        - post_only
        - fok
        - ioc
    TriggerPriceType:
      type: string
      enum:
        - mark
        - index
    TriggerType:
      type: string
      enum:
        - stoploss
        - takeprofit
    OrderActionInputData:
      description: >-
        The `Action` envelope a debug route rebuilt from the request inputs,
        plus its decoded action data — i.e. what the signature commits to.
      type: object
      required:
        - data
        - expiry
        - module
        - nonce
        - owner
        - signer
        - subaccount_id
      properties:
        data:
          $ref: '#/components/schemas/OrderActionDataResponse'
        expiry:
          type: integer
          format: uint64
          minimum: 0
        module:
          type: string
        nonce:
          type: integer
          format: uint64
          minimum: 0
        owner:
          type: string
        signer:
          type: string
        subaccount_id:
          type: integer
          format: uint64
          minimum: 0
    OrderActionDataResponse:
      type: object
      required:
        - asset_address
        - asset_sub_id
        - desired_amount
        - is_bid
        - limit_price
        - recipient_id
        - worst_fee
      properties:
        asset_address:
          type: string
        asset_sub_id:
          type: string
        desired_amount:
          description: >-
            Decimal string of the human value (e.g. `"1.5"`), up to 12
            fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        is_bid:
          type: boolean
        limit_price:
          description: >-
            Decimal string of the human value (e.g. `"1.5"`), up to 12
            fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        recipient_id:
          type: integer
          format: uint64
          minimum: 0
        worst_fee:
          description: >-
            Non-negative decimal string of the human value (e.g. `"1.5"`), up to
            12 fractional digits; a string or JSON number is accepted
          type: string
          format: decimal

````

## Related topics

- [Preview EIP-712 signing data for a quote](/api-reference/rfq/preview-eip-712-signing-data-for-a-quote.md)
- [Preview EIP-712 signing data for a quote execution](/api-reference/rfq/preview-eip-712-signing-data-for-a-quote-execution.md)
- [Preview EIP-712 encoding for a withdrawal](/api-reference/transfers-&-withdrawals/preview-eip-712-encoding-for-a-withdrawal.md)
