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

# Create a new order

> Creates a new order for token transactions across chains



## OpenAPI

````yaml https://mainnet.anyspend.com/openapi.json post /orders
openapi: 3.1.0
info:
  title: AnySpend API
  version: 1.0.0
  description: >-
    API for AnySpend - handles get quote, create order, check order status, and
    more.
servers:
  - url: https://mainnet.anyspend.com
    description: Production server
security: []
tags: []
paths:
  /orders:
    post:
      tags:
        - Orders
      summary: Create a new order
      description: Creates a new order for token transactions across chains
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
      responses:
        '200':
          description: Order created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Created order successfully
                  data:
                    $ref: '#/components/schemas/Order'
                  statusCode:
                    type: number
                    example: 200
                required:
                  - success
                  - message
                  - data
                  - statusCode
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Bad request
                  statusCode:
                    type: number
                    example: 400
                required:
                  - success
                  - message
                  - statusCode
components:
  schemas:
    OrderRequest:
      oneOf:
        - $ref: '#/components/schemas/SwapOrderRequest'
        - $ref: '#/components/schemas/X402SwapOrderRequest'
        - $ref: '#/components/schemas/HypeDuelOrderRequest'
        - $ref: '#/components/schemas/CustomOrderRequest'
        - $ref: '#/components/schemas/CustomExactInOrderRequest'
        - $ref: '#/components/schemas/MintNftOrderRequest'
        - $ref: '#/components/schemas/JoinTournamentOrderRequest'
        - $ref: '#/components/schemas/FundTournamentOrderRequest'
        - $ref: '#/components/schemas/DepositFirstOrderRequest'
    Order:
      oneOf:
        - $ref: '#/components/schemas/SwapOrder'
        - $ref: '#/components/schemas/X402SwapOrder'
        - $ref: '#/components/schemas/HypeDuelOrder'
        - $ref: '#/components/schemas/CustomOrder'
        - $ref: '#/components/schemas/CustomExactInOrder'
        - $ref: '#/components/schemas/MintNftOrder'
        - $ref: '#/components/schemas/JoinTournamentOrder'
        - $ref: '#/components/schemas/FundTournamentOrder'
        - $ref: '#/components/schemas/DepositFirstOrder'
    SwapOrderRequest:
      type: object
      description: Swap order request
      properties:
        type:
          type: string
          enum:
            - swap
          description: Order type
        recipientAddress:
          type: string
          description: Address to receive the destination tokens
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        srcChain:
          type: number
          description: Source chain ID
          example: 1
        dstChain:
          type: number
          description: Destination chain ID
          example: 8453
        srcTokenAddress:
          type: string
          description: Source token contract address
          example: '0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234'
        dstTokenAddress:
          type: string
          description: Destination token contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        srcAmount:
          type: string
          description: Amount of source tokens to swap
          example: '1000000'
        payload:
          $ref: '#/components/schemas/SwapPayload'
        metadata:
          $ref: '#/components/schemas/SwapMetadata'
        partnerId:
          type: string
          description: Optional partner identifier
        clientReferenceId:
          type: string
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        onramp:
          $ref: '#/components/schemas/Onramp'
        creatorAddress:
          type: string
          description: Optional address of the order creator
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        checkoutSessionId:
          type: string
          format: uuid
          description: >-
            Optional checkout session ID to link this order to. Session must
            exist and be open.
      required:
        - type
        - recipientAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - srcAmount
        - payload
        - metadata
    X402SwapOrderRequest:
      type: object
      description: X402 swap order request
      properties:
        type:
          type: string
          enum:
            - x402_swap
          description: Order type
        recipientAddress:
          type: string
          description: Address to receive the destination tokens
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        srcChain:
          type: number
          description: Source chain ID
          example: 8453
        dstChain:
          type: number
          description: Destination chain ID
          example: 8453
        srcTokenAddress:
          type: string
          description: Source token contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        dstTokenAddress:
          type: string
          description: Destination token contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        srcAmount:
          type: string
          description: Amount of source tokens to swap
          example: '1000000'
        payload:
          $ref: '#/components/schemas/SwapPayload'
        metadata:
          $ref: '#/components/schemas/SwapMetadata'
        partnerId:
          type: string
          description: Optional partner identifier
        clientReferenceId:
          type: string
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        onramp:
          $ref: '#/components/schemas/Onramp'
        creatorAddress:
          type: string
          description: Optional address of the order creator
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        checkoutSessionId:
          type: string
          format: uuid
          description: >-
            Optional checkout session ID to link this order to. Session must
            exist and be open.
      required:
        - type
        - recipientAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - srcAmount
        - payload
        - metadata
    HypeDuelOrderRequest:
      type: object
      description: HypeDuel order request
      properties:
        type:
          type: string
          enum:
            - hype_duel
          description: Order type
        recipientAddress:
          type: string
          description: Address to receive the destination tokens
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        srcChain:
          type: number
          description: Source chain ID
          example: 1
        dstChain:
          type: number
          description: Destination chain ID
          example: 8453
        srcTokenAddress:
          type: string
          description: Source token contract address
          example: '0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234'
        dstTokenAddress:
          type: string
          description: Destination token contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        srcAmount:
          type: string
          description: Amount of source tokens for HypeDuel
          example: '1000000'
        payload:
          $ref: '#/components/schemas/HypeDuelPayload'
        metadata:
          $ref: '#/components/schemas/HypeDuelMetadata'
        partnerId:
          type: string
          description: Optional partner identifier
        clientReferenceId:
          type: string
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        onramp:
          $ref: '#/components/schemas/Onramp'
        creatorAddress:
          type: string
          description: Optional address of the order creator
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        checkoutSessionId:
          type: string
          format: uuid
          description: >-
            Optional checkout session ID to link this order to. Session must
            exist and be open.
      required:
        - type
        - recipientAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - srcAmount
        - payload
        - metadata
    CustomOrderRequest:
      type: object
      description: Custom order request
      properties:
        type:
          type: string
          enum:
            - custom
          description: Order type
        recipientAddress:
          type: string
          description: Address to receive any tokens or execute transaction
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        srcChain:
          type: number
          description: Source chain ID for payment
          example: 1
        dstChain:
          type: number
          description: Destination chain ID where custom execution will occur
          example: 8453
        srcTokenAddress:
          type: string
          description: Payment token contract address
          example: '0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234'
        dstTokenAddress:
          type: string
          description: Token to be used in custom execution
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        srcAmount:
          type: string
          description: Payment amount
          example: '1000000'
        payload:
          $ref: '#/components/schemas/CustomPayload'
        metadata:
          $ref: '#/components/schemas/CustomMetadata'
        partnerId:
          type: string
          description: Optional partner identifier
        clientReferenceId:
          type: string
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        onramp:
          $ref: '#/components/schemas/Onramp'
        creatorAddress:
          type: string
          description: Optional address of the order creator
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        checkoutSessionId:
          type: string
          format: uuid
          description: >-
            Optional checkout session ID to link this order to. Session must
            exist and be open.
      required:
        - type
        - recipientAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - srcAmount
        - payload
        - metadata
    CustomExactInOrderRequest:
      type: object
      description: Custom exact in order request
      properties:
        type:
          type: string
          enum:
            - custom_exact_in
          description: Order type
        recipientAddress:
          type: string
          description: Address to receive the destination tokens
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        srcChain:
          type: number
          description: Source chain ID for payment
          example: 1
        dstChain:
          type: number
          description: Destination chain ID where execution will occur
          example: 8453
        srcTokenAddress:
          type: string
          description: Payment token contract address
          example: '0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234'
        dstTokenAddress:
          type: string
          description: Destination token contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        srcAmount:
          type: string
          description: Payment amount
          example: '1000000'
        payload:
          $ref: '#/components/schemas/CustomExactInPayload'
        metadata:
          $ref: '#/components/schemas/CustomMetadata'
        partnerId:
          type: string
          description: Optional partner identifier
        clientReferenceId:
          type: string
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        onramp:
          $ref: '#/components/schemas/Onramp'
        creatorAddress:
          type: string
          description: Optional address of the order creator
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        checkoutSessionId:
          type: string
          format: uuid
          description: >-
            Optional checkout session ID to link this order to. Session must
            exist and be open.
      required:
        - type
        - recipientAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - srcAmount
        - payload
        - metadata
    MintNftOrderRequest:
      type: object
      description: Mint NFT order request
      properties:
        type:
          type: string
          enum:
            - mint_nft
          description: Order type
        recipientAddress:
          type: string
          description: Address to receive the NFT
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        srcChain:
          type: number
          description: Source chain ID for payment
          example: 1
        dstChain:
          type: number
          description: Destination chain ID where NFT exists
          example: 8453
        srcTokenAddress:
          type: string
          description: Payment token contract address
          example: '0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234'
        dstTokenAddress:
          type: string
          description: NFT contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        srcAmount:
          type: string
          description: Payment amount
          example: '1000000'
        payload:
          $ref: '#/components/schemas/MintNftPayload'
        metadata:
          $ref: '#/components/schemas/MintNftMetadata'
        partnerId:
          type: string
          description: Optional partner identifier
        clientReferenceId:
          type: string
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        onramp:
          $ref: '#/components/schemas/Onramp'
        creatorAddress:
          type: string
          description: Optional address of the order creator
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        checkoutSessionId:
          type: string
          format: uuid
          description: >-
            Optional checkout session ID to link this order to. Session must
            exist and be open.
      required:
        - type
        - recipientAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - srcAmount
        - payload
        - metadata
    JoinTournamentOrderRequest:
      type: object
      description: Join tournament order request
      properties:
        type:
          type: string
          enum:
            - join_tournament
          description: Order type
        recipientAddress:
          type: string
          description: Participant's address
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        srcChain:
          type: number
          description: Source chain ID for payment
          example: 1
        dstChain:
          type: number
          description: Destination chain for tournament contract
          example: 8453
        srcTokenAddress:
          type: string
          description: Payment token contract address
          example: '0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234'
        dstTokenAddress:
          type: string
          description: Tournament contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        srcAmount:
          type: string
          description: Entry fee amount
          example: '1000000'
        payload:
          $ref: '#/components/schemas/JoinTournamentPayload'
        metadata:
          $ref: '#/components/schemas/TournamentMetadata'
        partnerId:
          type: string
          description: Optional partner identifier
        clientReferenceId:
          type: string
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        onramp:
          $ref: '#/components/schemas/Onramp'
        creatorAddress:
          type: string
          description: Optional address of the order creator
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        checkoutSessionId:
          type: string
          format: uuid
          description: >-
            Optional checkout session ID to link this order to. Session must
            exist and be open.
      required:
        - type
        - recipientAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - srcAmount
        - payload
        - metadata
    FundTournamentOrderRequest:
      type: object
      description: Fund tournament order request
      properties:
        type:
          type: string
          enum:
            - fund_tournament
          description: Order type
        recipientAddress:
          type: string
          description: Funder's address
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        srcChain:
          type: number
          description: Source chain ID for payment
          example: 1
        dstChain:
          type: number
          description: Destination chain for tournament contract
          example: 8453
        srcTokenAddress:
          type: string
          description: Payment token contract address
          example: '0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234'
        dstTokenAddress:
          type: string
          description: Tournament contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        srcAmount:
          type: string
          description: Funding amount
          example: '1000000'
        payload:
          $ref: '#/components/schemas/FundTournamentPayload'
        metadata:
          $ref: '#/components/schemas/TournamentMetadata'
        partnerId:
          type: string
          description: Optional partner identifier
        clientReferenceId:
          type: string
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        onramp:
          $ref: '#/components/schemas/Onramp'
        creatorAddress:
          type: string
          description: Optional address of the order creator
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        checkoutSessionId:
          type: string
          format: uuid
          description: >-
            Optional checkout session ID to link this order to. Session must
            exist and be open.
      required:
        - type
        - recipientAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - srcAmount
        - payload
        - metadata
    DepositFirstOrderRequest:
      type: object
      description: >-
        Deposit-first order request. The srcAmount is determined after deposit
        is detected, so it is not required at creation time. This flow does not
        support onramp - users deposit crypto directly.
      properties:
        type:
          type: string
          enum:
            - deposit_first
          description: Order type for deposit-first flow
        recipientAddress:
          type: string
          description: Address to receive the destination tokens after swap
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        srcChain:
          type: number
          description: Source chain ID where deposit will be made
          example: 8453
        dstChain:
          type: number
          description: Destination chain ID for the swap
          example: 8453
        srcTokenAddress:
          type: string
          description: Token contract address that will be deposited
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        dstTokenAddress:
          type: string
          description: Token contract address to receive after swap
          example: '0x0000000000000000000000000000000000000000'
        payload:
          $ref: '#/components/schemas/DepositFirstPayload'
        metadata:
          $ref: '#/components/schemas/DepositFirstMetadata'
        partnerId:
          type: string
          description: Optional partner identifier
        clientReferenceId:
          type: string
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]+$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        creatorAddress:
          type: string
          description: Optional address of the order creator
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        checkoutSessionId:
          type: string
          format: uuid
          description: >-
            Optional checkout session ID to link this order to. Session must
            exist and be open.
      required:
        - type
        - recipientAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - payload
        - metadata
    SwapOrder:
      allOf:
        - $ref: '#/components/schemas/BaseOrder'
        - type: object
          properties:
            type:
              type: string
              enum:
                - swap
              description: Order type
            payload:
              $ref: '#/components/schemas/SwapPayload'
            metadata:
              $ref: '#/components/schemas/SwapMetadata'
          required:
            - type
            - payload
            - metadata
    X402SwapOrder:
      allOf:
        - $ref: '#/components/schemas/BaseOrder'
        - type: object
          properties:
            type:
              type: string
              enum:
                - x402_swap
              description: Order type
            payload:
              $ref: '#/components/schemas/X402SwapPayload'
            metadata:
              $ref: '#/components/schemas/X402SwapMetadata'
          required:
            - type
            - payload
            - metadata
    HypeDuelOrder:
      allOf:
        - $ref: '#/components/schemas/BaseOrder'
        - type: object
          properties:
            type:
              type: string
              enum:
                - hype_duel
              description: Order type
            payload:
              $ref: '#/components/schemas/HypeDuelPayload'
            metadata:
              $ref: '#/components/schemas/HypeDuelMetadata'
          required:
            - type
            - payload
            - metadata
    CustomOrder:
      allOf:
        - $ref: '#/components/schemas/BaseOrder'
        - type: object
          properties:
            type:
              type: string
              enum:
                - custom
              description: Order type
            payload:
              $ref: '#/components/schemas/CustomPayload'
            metadata:
              $ref: '#/components/schemas/CustomMetadata'
          required:
            - type
            - payload
            - metadata
    CustomExactInOrder:
      allOf:
        - $ref: '#/components/schemas/BaseOrder'
        - type: object
          properties:
            type:
              type: string
              enum:
                - custom_exact_in
              description: Order type
            payload:
              $ref: '#/components/schemas/CustomExactInPayload'
            metadata:
              $ref: '#/components/schemas/CustomMetadata'
          required:
            - type
            - payload
            - metadata
    MintNftOrder:
      allOf:
        - $ref: '#/components/schemas/BaseOrder'
        - type: object
          properties:
            type:
              type: string
              enum:
                - mint_nft
              description: Order type
            payload:
              $ref: '#/components/schemas/MintNftPayload'
            metadata:
              $ref: '#/components/schemas/MintNftMetadata'
          required:
            - type
            - payload
            - metadata
    JoinTournamentOrder:
      allOf:
        - $ref: '#/components/schemas/BaseOrder'
        - type: object
          properties:
            type:
              type: string
              enum:
                - join_tournament
              description: Order type
            payload:
              $ref: '#/components/schemas/JoinTournamentPayload'
            metadata:
              $ref: '#/components/schemas/TournamentMetadata'
          required:
            - type
            - payload
            - metadata
    FundTournamentOrder:
      allOf:
        - $ref: '#/components/schemas/BaseOrder'
        - type: object
          properties:
            type:
              type: string
              enum:
                - fund_tournament
              description: Order type
            payload:
              $ref: '#/components/schemas/FundTournamentPayload'
            metadata:
              $ref: '#/components/schemas/TournamentMetadata'
          required:
            - type
            - payload
            - metadata
    DepositFirstOrder:
      allOf:
        - $ref: '#/components/schemas/BaseOrder'
        - type: object
          properties:
            type:
              type: string
              enum:
                - deposit_first
              description: >-
                Order type for deposit-first flow where amount is determined
                after deposit
            payload:
              $ref: '#/components/schemas/DepositFirstPayload'
            metadata:
              $ref: '#/components/schemas/DepositFirstMetadata'
          required:
            - type
            - payload
            - metadata
    SwapPayload:
      type: object
      description: Swap-specific payload
      properties:
        expectedDstAmount:
          type: string
          description: Expected amount of destination tokens
          example: '990000'
      required:
        - expectedDstAmount
    SwapMetadata:
      type: object
      description: Swap metadata for display purposes
      properties:
        srcToken:
          $ref: '#/components/schemas/Token'
        dstToken:
          $ref: '#/components/schemas/Token'
      required:
        - srcToken
        - dstToken
    Onramp:
      type: object
      description: Optional onramp configuration
      properties:
        vendor:
          type: string
          enum:
            - coinbase
            - stripe
            - stripe-web2
            - none
          description: Onramp vendor
        paymentMethod:
          type: string
          description: Payment method for onramp
          example: ''
        country:
          type: string
          description: Country code for the user
          example: SG
        redirectUrl:
          type: string
          description: URL to redirect after payment
          example: https://www.anyspend.com
    HypeDuelPayload:
      type: object
      description: HypeDuel-specific payload
      properties:
        expectedDstAmount:
          type: string
          description: Expected amount of destination tokens
          example: '990000'
      required:
        - expectedDstAmount
    HypeDuelMetadata:
      type: object
      description: HypeDuel metadata for display purposes
      properties:
        srcToken:
          $ref: '#/components/schemas/Token'
        dstToken:
          $ref: '#/components/schemas/Token'
      required:
        - srcToken
        - dstToken
    CustomPayload:
      type: object
      description: Custom execution payload
      properties:
        data:
          type: string
          description: Encoded transaction data
          example: 0x1234567890abcdef...
        to:
          type: string
          description: Target contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        spenderAddress:
          type: string
          description: Optional spender address for token approval
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        amount:
          type: string
          description: Amount for the custom operation
          example: '1000000'
      required:
        - data
        - to
        - amount
    CustomMetadata:
      type: object
      description: Custom metadata for display purposes
      properties:
        srcToken:
          $ref: '#/components/schemas/Token'
        dstToken:
          $ref: '#/components/schemas/Token'
        action:
          type: string
          description: Optional custom action identifier
          example: claim-reward
      required:
        - srcToken
        - dstToken
    CustomExactInPayload:
      type: object
      description: Custom exact in execution payload
      properties:
        amount:
          type: string
          description: Amount used when executing the destination function
          example: '1000000000000000000'
        expectedDstAmount:
          type: string
          description: Expected amount of destination tokens
          example: '1000000000000000000'
        functionAbi:
          type: string
          description: JSON stringified ABI that includes the destination function
        functionName:
          type: string
          description: Destination function name
          example: stake
        functionArgs:
          type: array
          description: Destination function arguments (template variables allowed)
          items:
            type: string
        to:
          type: string
          description: Destination contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        spenderAddress:
          type: string
          description: Optional spender address for token approval
          example: '0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1'
        value:
          type: string
          description: Native token value to send with the transaction (in wei)
          example: '1000000000000000000'
        action:
          type: string
          description: Optional action identifier used for display purposes
          example: stake B3
      required:
        - amount
        - expectedDstAmount
        - functionAbi
        - functionName
        - functionArgs
        - to
    MintNftPayload:
      type: object
      description: NFT minting payload
      properties:
        contractAddress:
          type: string
          description: NFT contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        tokenId:
          type: number
          nullable: true
          description: Token ID (for ERC1155, null for ERC721)
          example: 1
        contractType:
          type: string
          enum:
            - erc721
            - erc1155
          description: Type of NFT contract
          example: erc721
        nftPrice:
          type: string
          description: Price to mint the NFT
          example: '1000000'
      required:
        - contractAddress
        - tokenId
        - contractType
        - nftPrice
    MintNftMetadata:
      type: object
      description: NFT metadata
      properties:
        srcToken:
          $ref: '#/components/schemas/Token'
        dstToken:
          $ref: '#/components/schemas/Token'
        nft:
          $ref: '#/components/schemas/NFT'
      required:
        - srcToken
        - dstToken
        - nft
    JoinTournamentPayload:
      type: object
      description: Tournament joining payload
      properties:
        contractAddress:
          type: string
          description: Tournament contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        entryPrice:
          type: string
          description: Tournament entry price
          example: '1000000'
      required:
        - contractAddress
        - entryPrice
    TournamentMetadata:
      type: object
      description: Tournament metadata
      properties:
        srcToken:
          $ref: '#/components/schemas/Token'
        dstToken:
          $ref: '#/components/schemas/Token'
        tournament:
          $ref: '#/components/schemas/Tournament'
      required:
        - srcToken
        - dstToken
        - tournament
    FundTournamentPayload:
      type: object
      description: Tournament funding payload
      properties:
        contractAddress:
          type: string
          description: Tournament contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        fundAmount:
          type: string
          description: Amount to fund the tournament
          example: '1000000'
      required:
        - contractAddress
        - fundAmount
    DepositFirstPayload:
      type: object
      description: >-
        DepositFirst payload - empty at creation time, details determined after
        deposit is detected
    DepositFirstMetadata:
      type: object
      description: DepositFirst metadata for display purposes
      properties:
        srcToken:
          $ref: '#/components/schemas/Token'
          description: Token accepted for deposit
        dstToken:
          $ref: '#/components/schemas/Token'
          description: Token to swap to after deposit
      required:
        - srcToken
        - dstToken
    BaseOrder:
      type: object
      description: Base order fields
      properties:
        id:
          type: string
          format: uuid
          description: Unique order identifier
          example: 5392f7a7-d472-4d6b-9848-bd07117fb82d
        recipientAddress:
          type: string
          description: Address to receive tokens/NFT/etc
          example: '0xb34facb90a200251318e8841c05102366f2158cf'
        globalAddress:
          type: string
          description: Global wallet address handling the order
          example: '0xa640beaa78eeb64bb269f2baf8202b9a7316e123'
        srcChain:
          type: number
          description: Source chain ID
          example: 8453
        dstChain:
          type: number
          description: Destination chain ID
          example: 8453
        srcTokenAddress:
          type: string
          description: Source token contract address
          example: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
        dstTokenAddress:
          type: string
          description: Destination token contract address
          example: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
        srcAmount:
          type: string
          description: Source amount
          example: '93354000'
        status:
          type: string
          description: Current order status
          enum:
            - scanning_deposit_transaction
            - waiting_stripe_payment
            - expired
            - sending_token_from_vault
            - quoting_after_deposit
            - relay
            - executing
            - executed
            - refunding
            - refunded
            - failure
          example: executed
        errorDetails:
          type: string
          nullable: true
          description: Error details if order failed
        createdAt:
          type: number
          description: Creation timestamp
          example: 1752505794679
        expiredAt:
          type: number
          description: Expiration timestamp
          example: 1752506694679
        filledAt:
          type: number
          nullable: true
          description: Timestamp when the order was filled/executed
        receivedDepositAt:
          type: number
          nullable: true
          description: Timestamp when the deposit was received
        creatorAddress:
          type: string
          nullable: true
          description: Optional creator address
          example: '0xb34facb90a200251318e8841c05102366f2158cf'
        partnerId:
          type: string
          nullable: true
          description: Optional partner identifier
        clientReferenceId:
          type: string
          nullable: true
          maxLength: 255
          pattern: ^[a-zA-Z0-9_-]*$
          description: >-
            Optional client reference identifier for tracking purposes
            (alphanumeric, hyphens, and underscores only, max 255 chars)
        onrampMetadata:
          allOf:
            - $ref: '#/components/schemas/OnrampMetadata'
          nullable: true
          description: Onramp configuration if used
        oneClickBuyUrl:
          type: string
          nullable: true
          description: Quick purchase URL if available
        stripePaymentIntentId:
          type: string
          nullable: true
          description: Stripe payment intent ID if using Stripe
          example: pi_3Rko0sJnoDg53PsP0PDLsHkR
        settlement:
          type: object
          nullable: true
          description: Settlement information for executed orders
          properties:
            actualDstAmount:
              type: string
              description: >-
                Actual received amount after execution (only for swap/hypeduel
                orders). Optional - only present for swap/hypeduel orders.
              example: '990000'
            relay:
              type: object
              description: >-
                Complete relay API response data. Contains transaction details,
                state changes, fees, and execution status. Optional - can be
                backfilled by querying Relay API /requests/v2 endpoint.
              example:
                status: success
                metadata:
                  currencyOut:
                    amount: '990000'
        fee:
          allOf:
            - $ref: '#/components/schemas/Fee'
          nullable: true
          description: Fee structure for the order including Stripe and AnySpend fees
      required:
        - id
        - type
        - recipientAddress
        - globalAddress
        - srcChain
        - dstChain
        - srcTokenAddress
        - dstTokenAddress
        - srcAmount
        - status
        - errorDetails
        - createdAt
        - expiredAt
        - filledAt
        - receivedDepositAt
        - creatorAddress
        - partnerId
        - onrampMetadata
        - oneClickBuyUrl
        - stripePaymentIntentId
        - settlement
        - payload
        - metadata
    X402SwapPayload:
      type: object
      description: X402 swap-specific payload
      properties:
        expectedDstAmount:
          type: string
          description: Expected amount of destination tokens
          example: '990000'
      required:
        - expectedDstAmount
    X402SwapMetadata:
      type: object
      description: X402 swap metadata for display purposes
      properties:
        srcToken:
          $ref: '#/components/schemas/Token'
        dstToken:
          $ref: '#/components/schemas/Token'
      required:
        - srcToken
        - dstToken
    Token:
      type: object
      description: Token details
      properties:
        chainId:
          type: number
          description: Token chain ID
          example: 8453
        address:
          type: string
          description: Token contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        symbol:
          type: string
          description: Token symbol
          example: USDC
        name:
          type: string
          description: Token name
          example: USD Coin
        decimals:
          type: number
          description: Token decimals
          example: 6
        metadata:
          type: object
          properties:
            logoURI:
              type: string
              description: Token logo URI
              example: https://polygonscan.com/token/images/usdc_32.png
      required:
        - chainId
        - address
        - symbol
        - name
        - decimals
        - metadata
    NFT:
      oneOf:
        - $ref: '#/components/schemas/ERC721NFT'
        - $ref: '#/components/schemas/ERC1155NFT'
    Tournament:
      type: object
      description: Tournament details
      properties:
        slug:
          type: string
          description: Tournament slug identifier
          example: summer-championship-2024
        name:
          type: string
          description: Tournament name
          example: Summer Championship 2024
        description:
          type: string
          description: Tournament description
          example: The biggest tournament of the summer
        imageUrl:
          type: string
          description: Tournament image URL
          example: https://example.com/tournament.png
      required:
        - slug
        - name
        - description
        - imageUrl
    OnrampMetadata:
      type: object
      description: Onramp configuration
      properties:
        country:
          type: string
          description: Country code
          example: US
        vendor:
          type: string
          enum:
            - coinbase
            - stripe
            - stripe-web2
            - none
          description: Onramp vendor used
          example: stripe-web2
        paymentMethod:
          type: string
          description: Payment method used
          example: ''
        redirectUrl:
          type: string
          description: Redirect URL after payment
          example: https://www.anyspend.com
        stripeAmountInCents:
          type: number
          description: Stripe payment amount in cents
          example: 9900
        ipAddress:
          type: string
          format: ipv4
          description: >-
            Optional IP address for location detection. Required for Stripe
            onramp requests in production and omitted from standard order
            responses.
          example: 192.168.1.1
        fingerprint:
          type: object
          description: Optional fingerprint data for fraud detection
          properties:
            requestId:
              type: string
              description: Fingerprint request ID
              example: fp_req_12345
            visitorId:
              type: string
              description: Fingerprint visitor ID
              example: fp_visitor_67890
          required:
            - requestId
            - visitorId
      required:
        - country
        - vendor
        - paymentMethod
        - redirectUrl
    Fee:
      oneOf:
        - type: object
          description: Standard crypto fee structure (non-Stripe transactions)
          properties:
            type:
              type: string
              enum:
                - standard_fee
              description: Fee type identifier
            feeVersion:
              type: number
              description: Fee version number
              example: 1
            tokenToCheckBalance:
              type: string
              description: >-
                Token contract address used to check balance for whale discount
                (B3 token)
              example: '0xb3b32f9f8827d4634fe7d973fa1034ec9fddb3b3'
            recipientBalance:
              type: string
              description: Recipient's B3 token balance
              example: '302843673392800000000000'
            anyspendFeeBps:
              type: number
              description: AnySpend base fee in basis points before discounts
              example: 80
            anyspendWhaleDiscountBps:
              type: number
              description: Whale discount in basis points based on B3 balance
              example: 5000
            anyspendPartnerDiscountBps:
              type: number
              description: Partner discount in basis points (deprecated, always 0)
              example: 0
            finalFeeBps:
              type: number
              description: Final fee in basis points after all discounts applied
              example: 40
          required:
            - type
            - feeVersion
            - tokenToCheckBalance
            - recipientBalance
            - anyspendFeeBps
            - anyspendWhaleDiscountBps
            - anyspendPartnerDiscountBps
            - finalFeeBps
        - type: object
          description: Stripe Web2 fee structure including both Stripe and AnySpend fees
          properties:
            type:
              type: string
              enum:
                - stripeweb2_fee
              description: Fee type identifier
            feeVersion:
              type: number
              description: Fee version number
              example: 1
            tokenToCheckBalance:
              type: string
              description: >-
                Token contract address used to check balance for whale discount
                (B3 token)
              example: '0xb3b32f9f8827d4634fe7d973fa1034ec9fddb3b3'
            recipientBalance:
              type: string
              description: Recipient's B3 token balance
              example: '302843673392800000000000'
            stripeFeeBps:
              type: number
              description: Stripe fee percentage in basis points (5.4%)
              example: 540
            stripeFeeUsd:
              type: number
              description: Stripe fixed fee in USD
              example: 0.3
            anyspendFeeBps:
              type: number
              description: AnySpend base fee in basis points before discounts
              example: 80
            anyspendFeeUsd:
              type: number
              description: AnySpend fixed fee in USD before discounts
              example: 0
            anyspendWhaleDiscountBps:
              type: number
              description: Whale discount in basis points based on B3 balance
              example: 5000
            anyspendPartnerDiscountBps:
              type: number
              description: Partner discount in basis points (deprecated, always 0)
              example: 0
            finalFeeBps:
              type: number
              description: >-
                Final combined fee percentage in basis points after all
                discounts
              example: 580
            finalFeeUsd:
              type: number
              description: Final combined fixed fee in USD after all discounts
              example: 0.3
            originalAmount:
              type: string
              description: Original amount before fees in USDC units (6 decimals)
              example: '10000000'
            finalAmount:
              type: string
              description: Final amount after applying all fees in USDC units (6 decimals)
              example: '9120000'
          required:
            - type
            - feeVersion
            - tokenToCheckBalance
            - recipientBalance
            - stripeFeeBps
            - stripeFeeUsd
            - anyspendFeeBps
            - anyspendFeeUsd
            - anyspendWhaleDiscountBps
            - anyspendPartnerDiscountBps
            - finalFeeBps
            - finalFeeUsd
            - originalAmount
            - finalAmount
      discriminator:
        propertyName: type
    ERC721NFT:
      type: object
      description: ERC721 NFT
      properties:
        type:
          type: string
          enum:
            - erc721
          description: NFT type
        contractAddress:
          type: string
          description: NFT contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        name:
          type: string
          description: NFT name
          example: Cool NFT
        description:
          type: string
          description: NFT description
          example: A very cool NFT
        imageUrl:
          type: string
          description: NFT image URL
          example: https://example.com/nft.png
      required:
        - type
        - contractAddress
        - name
        - description
        - imageUrl
    ERC1155NFT:
      type: object
      description: ERC1155 NFT
      properties:
        type:
          type: string
          enum:
            - erc1155
          description: NFT type
        contractAddress:
          type: string
          description: NFT contract address
          example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
        name:
          type: string
          description: NFT name
          example: Cool NFT
        description:
          type: string
          description: NFT description
          example: A very cool NFT
        imageUrl:
          type: string
          description: NFT image URL
          example: https://example.com/nft.png
        tokenId:
          type: number
          description: Token ID for ERC1155
          example: 1
      required:
        - type
        - contractAddress
        - name
        - description
        - imageUrl
        - tokenId

````