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

# Create order

> Creates a new order for crypto/fiat conversion using a previously created quote.

**Flow:**
1. First, call `POST /ramp/quote` to get pricing and create a quote.
2. Then, call this endpoint with the `quoteId` to execute the order.

The order inherits the blockchain, direction (onramp/offramp), and amounts from the
quote. Quotes expire after 2 minutes, so create the order promptly after getting the quote.

**Wallet resolution:** provide either `publicKey` or `cryptoWalletId` (or both). When
`cryptoWalletId` is provided (typical for embedded wallets), `publicKey`, `blockchain`,
`direction`, and amount fields are optional — they are derived from the quote and wallet record.

For onramps, the bank account must belong to your organization or a child organization.



## OpenAPI

````yaml /openapi.json post /ramp/order
openapi: 3.1.0
info:
  title: Etherfuse FX API
  description: Partner-facing ramp API for onramps, offramps, swaps, and KYC.
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://api.sand.etherfuse.com
    description: Sandbox
security:
  - ApiKeyAuth: []
tags:
  - name: Authentication
    description: >-
      Partner JWT authentication — exchange a JWT for an access token, or launch
      a user into the app.
  - name: Lookup
    description: >-
      Public reference data: exchange rates, stablebonds, bond costs, country
      codes.
  - name: Assets
    description: Rampable stablecoins and stablebonds available per blockchain.
  - name: Onboarding
    description: Hosted and programmatic customer onboarding.
  - name: Agreements
    description: Legal agreement acceptance during onboarding.
  - name: Bank Accounts
    description: Register and retrieve customer bank accounts.
  - name: Quotes
    description: Price quotes for onramps, offramps, and swaps.
  - name: Orders
    description: Create, track, and manage ramp orders.
  - name: Swaps
    description: Crypto-to-crypto swaps.
  - name: Sponsored
    description: Token approvals for sponsored (gasless) offramps.
  - name: Customers
    description: Customer (child-organization) records.
  - name: Wallets
    description: Register and manage customer wallets.
  - name: KYC
    description: Submit and check customer KYC status.
  - name: Webhooks
    description: Event notification subscriptions.
  - name: Organizations
    description: Organization identity, child orgs, and partner fees.
paths:
  /ramp/order:
    post:
      tags:
        - Orders
      summary: Create order
      description: >-
        Creates a new order for crypto/fiat conversion using a previously
        created quote.


        **Flow:**

        1. First, call `POST /ramp/quote` to get pricing and create a quote.

        2. Then, call this endpoint with the `quoteId` to execute the order.


        The order inherits the blockchain, direction (onramp/offramp), and
        amounts from the

        quote. Quotes expire after 2 minutes, so create the order promptly after
        getting the quote.


        **Wallet resolution:** provide either `publicKey` or `cryptoWalletId`
        (or both). When

        `cryptoWalletId` is provided (typical for embedded wallets),
        `publicKey`, `blockchain`,

        `direction`, and amount fields are optional — they are derived from the
        quote and wallet record.


        For onramps, the bank account must belong to your organization or a
        child organization.
      operationId: order
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderPayload'
        required: true
      responses:
        '200':
          description: The created order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponse'
        '400':
          description: Invalid request or missing/expired quote
        '409':
          description: >-
            A pending onramp order already exists for this bank account and
            amount
components:
  schemas:
    CreateOrderPayload:
      type: object
      required:
        - orderId
        - bankAccountId
      properties:
        bankAccountId:
          type: string
          format: uuid
        blockchain:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Blockchain'
              description: Optional when quote_id is provided - will be derived from quote
        cryptoWalletId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Optional wallet UUID — when provided, resolves the wallet by ID
            instead of public_key lookup
        direction:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Direction'
              description: Optional when quote_id is provided - will be derived from quote
        feePayer:
          type:
            - string
            - 'null'
          description: >-
            Fee payer G-wallet for C-wallet Stellar offramps. Contract wallets
            can't be tx source.
        fiatAmount:
          type:
            - string
            - 'null'
        memo:
          type:
            - string
            - 'null'
        orderId:
          type: string
          format: uuid
        publicKey:
          type:
            - string
            - 'null'
          description: >-
            Optional when crypto_wallet_id is provided — will be derived from
            the wallet record
        quoteId:
          type:
            - string
            - 'null'
          format: uuid
        tokenAmount:
          type:
            - string
            - 'null'
        useAnchor:
          type: boolean
          description: >-
            When true, returns anchor address + memo instead of pre-signed TX
            (SEP-24 anchor mode).

            Only valid for Stellar offramps.
      example:
        bankAccountId: b2c3d4e5-f6a7-8901-bcde-f12345678901
        orderId: 7b9c1e2d-3f4a-5b6c-7d8e-9f0a1b2c3d4e
        quoteId: 3f2a1b0c-9d8e-7f6a-5b4c-3d2e1f0a9b8c
        cryptoWalletId: 1b6e98a2-7c3d-4e5f-9a0b-1c2d3e4f5a6b
    CreateOrderResponse:
      oneOf:
        - type: object
          title: Offramp Response
          required:
            - offramp
          properties:
            offramp:
              $ref: '#/components/schemas/OfframpOrderDetails'
        - type: object
          title: Onramp Response
          required:
            - onramp
          properties:
            onramp:
              $ref: '#/components/schemas/OnrampOrderDetails'
    Blockchain:
      type: string
      description: |-
        Canonical blockchain enum for API serialization.
        Use this type for JSON APIs and WebSocket messages.
        For database storage, convert to `BlockchainType`.
      enum:
        - stellar
        - solana
        - base
        - polygon
        - monad
    Direction:
      type: string
      enum:
        - onramp
        - offramp
    OfframpOrderDetails:
      type: object
      required:
        - orderId
      properties:
        orderId:
          type: string
          format: uuid
        withdrawAnchorAccount:
          type:
            - string
            - 'null'
        withdrawMemo:
          type:
            - string
            - 'null'
        withdrawMemoType:
          type:
            - string
            - 'null'
      example:
        orderId: 7b9c1e2d-3f4a-5b6c-7d8e-9f0a1b2c3d4e
        withdrawAnchorAccount: GANCHOR7XYZQ635VDIGY6S4ZUF5L6TQ7AA4MWS7LEQDBLUSZXV7UPS4
        withdrawMemo: 3f2a1b0c9d8e
        withdrawMemoType: hash
    OnrampOrderDetails:
      type: object
      required:
        - orderId
        - depositClabe
        - depositAmount
        - depositBankName
        - depositAccountHolder
      properties:
        depositAccountHolder:
          type: string
          description: >-
            Account holder name for the deposit CLABE. Hardcoded to Etherfuse MX
            for now.
        depositAmount:
          type: string
        depositBankName:
          type: string
          description: Name of the bank that holds the deposit CLABE.
        depositClabe:
          type: string
        orderId:
          type: string
          format: uuid
      example:
        depositAccountHolder: Etherfuse MX
        depositAmount: '1000.00'
        depositBankName: Example Bank
        depositClabe: '646180157000000004'
        orderId: 7b9c1e2d-3f4a-5b6c-7d8e-9f0a1b2c3d4e
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API key sent in the Authorization header.

````