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

# Create Order

> Creates an order by accepting a quote. Wallet addresses are required only for token assets (eth-base/brlv, eth-mainnet/brlv, eth-base/wbrly). For fiat assets (fiat/brl, fiat/usd), no wallet addresses are needed. Use source-wallet-address for the source wallet and target-wallet-address for the destination wallet.



## OpenAPI

````yaml POST /api/v0/orders
openapi: 3.1.0
info:
  title: Crown API & Webhooks
  version: 1.0.0
  description: >-
    Open API 3 docs for Crown API


    Webhook events that Crown will POST to your configured endpoint URL. All
    webhooks expect a 200 OK response. Payloads use kebab-case for all keys to
    match the Crown API conventions.
servers:
  - url: https://app.crown-brlv.com
    description: Production server
security: []
paths:
  /api/v0/orders:
    post:
      summary: Create an order from a quote
      description: >-
        Creates an order by accepting a quote. Wallet addresses are required
        only for token assets (eth-base/brlv, eth-mainnet/brlv, eth-base/wbrly).
        For fiat assets (fiat/brl, fiat/usd), no wallet addresses are needed.
        Use source-wallet-address for the source wallet and
        target-wallet-address for the destination wallet.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                quote-id:
                  type: string
                  format: uuid
                  description: Unique identifier of the quote to accept
                  example: 550e8400-e29b-41d4-a716-446655440000
                source-wallet-address:
                  oneOf:
                    - type: string
                      description: >-
                        Ethereum wallet address for source tokens (required only
                        when source asset is a token like eth-mainnet/brlv,
                        eth-base/brlv or eth-base/wbrly)
                      example: '0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c'
                    - type: 'null'
                target-wallet-address:
                  oneOf:
                    - type: string
                      description: >-
                        Ethereum wallet address for receiving tokens. Resolved
                        server-side to an internal wallet, a whitelisted
                        external wallet, or a target wallet. For FX (BRL<->USDC)
                        orders, target wallets must also be FX-whitelisted for
                        the account.
                      example: '0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c'
                    - type: 'null'
                target-end-user-pix-key:
                  oneOf:
                    - type: string
                      description: >-
                        PIX key of a third-party end-user to receive BRL.
                        Allowed only for USDC->BRL FX orders. When set, BRL is
                        delivered directly from the Crown FX pool to this PIX
                        key; the API user's own bank account is not touched.
                      example: user@example.com
                    - type: 'null'
              additionalProperties: false
              required:
                - quote-id
      responses:
        '200':
          description: Order created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  order:
                    type: object
                    properties:
                      base-rate:
                        type: string
                        format: decimal
                        description: Base exchange rate between assets
                        example: '1.0000'
                      state-updated-at:
                        type: string
                        example: '2024-01-15T10:30:00Z'
                        format: date-time
                        description: >-
                          ISO 8601 timestamp when the order state was last
                          updated
                      fee-amount:
                        type: string
                        format: decimal
                        description: Fee charged for the order.
                        example: '0.50'
                      effective-rate:
                        type: string
                        format: decimal
                        description: Effective rate including fees
                        example: '0.9950'
                      state:
                        type: string
                        enum:
                          - created
                          - rolled-back
                          - completed
                          - processing
                        description: Current state of the order
                        example: created
                      target-asset:
                        type: string
                        enum:
                          - tempo/brlv
                          - eth-base/brlv
                          - eth-mainnet/brlv
                          - fiat/brl
                          - eth-base/usdt
                          - fiat/usd
                          - eth-mainnet/usdt
                          - eth-mainnet/usdc
                          - eth-base/wbrly
                          - eth-base/usdc
                          - eth-base/brly
                        description: The asset being converted to
                        example: eth-base/brlv
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier for the created order
                        example: 660e8400-e29b-41d4-a716-446655440001
                      quote-id:
                        type: string
                        format: uuid
                        description: Identifier of the quote this order was created from
                        example: 550e8400-e29b-41d4-a716-446655440000
                      fee-asset:
                        type: string
                        enum:
                          - tempo/brlv
                          - eth-base/brlv
                          - eth-mainnet/brlv
                          - fiat/brl
                          - eth-base/usdt
                          - fiat/usd
                          - eth-mainnet/usdt
                          - eth-mainnet/usdc
                          - eth-base/wbrly
                          - eth-base/usdc
                          - eth-base/brly
                        description: Asset in which the fee is denominated.
                        example: fiat/brl
                      source-asset:
                        type: string
                        enum:
                          - tempo/brlv
                          - eth-base/brlv
                          - eth-mainnet/brlv
                          - fiat/brl
                          - eth-base/usdt
                          - fiat/usd
                          - eth-mainnet/usdt
                          - eth-mainnet/usdc
                          - eth-base/wbrly
                          - eth-base/usdc
                          - eth-base/brly
                        description: The asset being converted from
                        example: fiat/brl
                      source-amount:
                        type: string
                        format: decimal
                        description: Amount of source asset to be converted
                        example: '100.50'
                      created-at:
                        type: string
                        example: '2024-01-15T10:30:00Z'
                        format: date-time
                        description: ISO 8601 timestamp when the order was created
                      target-amount:
                        type: string
                        format: decimal
                        description: Amount of target asset to be received
                        example: '99.75'
                    additionalProperties: false
                    required:
                      - base-rate
                      - state-updated-at
                      - effective-rate
                      - state
                      - target-asset
                      - id
                      - quote-id
                      - source-asset
                      - source-amount
                      - created-at
                      - target-amount
                additionalProperties: false
                required:
                  - order
        '400':
          description: Bad request - Invalid input parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type: string
                    additionalProperties: false
                    required:
                      - type
                      - message
                      - code
                    description: Bad request error details
                additionalProperties: false
                required:
                  - error
        '403':
          description: Forbidden - Access denied
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type: string
                    additionalProperties: false
                    required:
                      - type
                      - message
                      - code
                    description: Forbidden access error details
                additionalProperties: false
                required:
                  - error
        '404':
          description: Not found - Resource does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type: string
                    additionalProperties: false
                    required:
                      - type
                      - message
                      - code
                    description: Resource not found error details
                additionalProperties: false
                required:
                  - error
        '422':
          description: Unprocessable entity - Validation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type: string
                    additionalProperties: false
                    required:
                      - type
                      - message
                      - code
                    description: Validation error details
                additionalProperties: false
                required:
                  - error

````