> ## 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 a new order

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

**Flow:**
1. First, call `/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, the wallet is resolved by UUID and `publicKey` becomes optional.

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




## OpenAPI

````yaml /openapi.yaml post /ramp/order
openapi: 3.1.0
info:
  title: FX API
  version: 1.0.0
  description: >
    API for managing FX operations including onboarding, quotes, orders, and
    customer management.

    This API provides endpoints for managing customers, bank accounts, crypto
    wallets, orders, and webhooks.
servers:
  - url: https://api.etherfuse.com
    description: Production API
  - url: https://api.sand.etherfuse.com
    description: Sandbox API (for testing)
security: []
tags:
  - name: Lookup
    description: Public endpoints for looking up stablebond and exchange rate data
  - name: Assets
    description: Get available assets for ramping
  - name: Onboarding
    description: Customer onboarding and KYC
  - name: Bank Accounts
    description: Manage customer bank accounts
  - name: Agreements
    description: Handle customer agreements and consents
  - name: Quotes
    description: Get quotes for conversions
  - name: Orders
    description: Create and manage orders
  - name: Swaps
    description: Create and manage swaps
  - name: Customers
    description: Manage customers
  - name: Crypto Wallets
    description: Manage crypto wallets
  - name: Webhooks
    description: Manage webhook subscriptions
  - name: Organizations
    description: Manage organizations and child organizations
paths:
  /ramp/order:
    post:
      tags:
        - Orders
      summary: Create a new order
      description: >
        Creates a new order for crypto/fiat conversion using a previously
        created quote.


        **Flow:**

        1. First, call `/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, the wallet is resolved by
        UUID and `publicKey` becomes optional.


        For onramps, the bank account must belong to your organization or a
        child organization.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderPayload'
      responses:
        '200':
          description: Order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            A pending onramp order already exists for this bank account and
            amount
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateOrderPayload:
      type: object
      required:
        - orderId
        - bankAccountId
        - quoteId
      properties:
        orderId:
          type: string
          format: uuid
          description: Client-generated order ID
        bankAccountId:
          type: string
          format: uuid
          description: Bank account ID for the fiat leg
        publicKey:
          type: string
          nullable: true
          description: >-
            Customer's crypto wallet address. Required if `cryptoWalletId` is
            not provided.
        cryptoWalletId:
          type: string
          format: uuid
          nullable: true
          description: >-
            UUID of a registered crypto wallet. If provided, `publicKey` is
            optional and will be resolved from the wallet record.
        quoteId:
          type: string
          format: uuid
          description: >-
            Quote ID from a previous /ramp/quote call. The order will use the
            blockchain, direction, and amounts from the quote.
        memo:
          type: string
          nullable: true
          description: Optional memo for the transaction
        useAnchor:
          type: boolean
          default: false
          description: >
            When `true`, the order uses **anchor mode** (Stellar only). Instead
            of returning a pre-signed `burnTransaction`,

            the response includes `withdrawAnchorAccount`, `withdrawMemo`, and
            `withdrawMemoType`. Your application builds

            and submits the payment transaction directly to the anchor account
            with the provided memo.


            Only valid for **Stellar offramp** orders. Requests with `useAnchor:
            true` on non-Stellar blockchains will be rejected.
      example:
        orderId: 123e4567-e89b-12d3-a456-426614174000
        bankAccountId: 123e4567-e89b-12d3-a456-426614174001
        publicKey: GDUKMGUGD3V6VXTU2RLAUM7A2FABLMHCPWTMDHKP7HHJ6FCZKEY4PVWL
        quoteId: 844393ca-be57-4817-a58a-5b60e2792c06
    CreateOrderResponse:
      type: object
      description: >
        Response when creating an order. The response is wrapped in either an
        "onramp" or "offramp" key

        depending on the order direction (derived from the quote).
      oneOf:
        - type: object
          title: Onramp Response
          properties:
            onramp:
              type: object
              properties:
                orderId:
                  type: string
                  format: uuid
                  description: Unique identifier for the order
                depositClabe:
                  type: string
                  description: CLABE number where customer should deposit MXN
                depositAmount:
                  type: number
                  format: decimal
                  description: Amount in MXN the customer should deposit
                depositBankName:
                  type: string
                  description: Bank that holds the deposit CLABE (e.g. "STP")
                depositAccountHolder:
                  type: string
                  description: >-
                    Account holder name for the deposit CLABE (e.g. "Etherfuse
                    MX")
        - type: object
          title: Offramp Response
          properties:
            offramp:
              type: object
              properties:
                orderId:
                  type: string
                  format: uuid
                  description: Unique identifier for the order
                withdrawAnchorAccount:
                  type: string
                  nullable: true
                  description: >-
                    Stellar anchor account address to send payment to (only
                    present when useAnchor is true)
                withdrawMemo:
                  type: string
                  nullable: true
                  description: >-
                    Base64-encoded hash memo to include in the payment
                    transaction (only present when useAnchor is true)
                withdrawMemoType:
                  type: string
                  nullable: true
                  description: >-
                    Memo type — always "hash" for anchor orders (only present
                    when useAnchor is true)
      examples:
        onramp:
          summary: Onramp order response
          value:
            onramp:
              orderId: 123e4567-e89b-12d3-a456-426614174000
              depositClabe: '646180157034567890'
              depositAmount: 1000
              depositBankName: STP
              depositAccountHolder: Etherfuse MX
        offramp:
          summary: Offramp order response
          value:
            offramp:
              orderId: 123e4567-e89b-12d3-a456-426614174000
        offramp_anchor:
          summary: Offramp anchor order response (Stellar only)
          value:
            offramp:
              orderId: 123e4567-e89b-12d3-a456-426614174000
              withdrawAnchorAccount: GABPM7AXXSE27X3NIN5IVSFCW5AWQLF3RFGUZCW3USNFRZCHLU6CC3SN
              withdrawMemo: RkFLRU1FTU8xMjM0NTY3ODkw...
              withdrawMemoType: hash
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
      example:
        error: Invalid request parameters
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key for authentication. Pass the key directly (e.g., `Authorization:
        your-api-key`). Do not use a `Bearer` prefix.

````