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

# Create Swap

> Executes a swap from the account's wallet. Runs asynchronously; poll GET /swaps/{id} for status.



## OpenAPI

````yaml /openapi/api-v1-native.yml post /swaps
openapi: 3.1.0
info:
  title: Whop API
  description: >-
    Hand-written V1 endpoints. Merged into the GraphqlRestProxy-generated schema
    at build time.
  version: v1
servers:
  - url: https://{defaultHost}
    variables:
      defaultHost:
        default: api.whop.com/api/v1
security: []
paths:
  /swaps:
    post:
      tags:
        - Swaps
      summary: Create Swap
      description: >-
        Executes a swap from the account's wallet. Runs asynchronously; poll GET
        /swaps/{id} for status.
      operationId: createSwap
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                account_id:
                  type: string
                  description: Business or user account ID (biz_* / user_*).
                amount:
                  type: string
                  description: Source token amount.
                from_token:
                  type: string
                  description: >-
                    Source token contract address or ticker symbol, such as
                    "USDT".
                to_token:
                  type: string
                  description: >-
                    Destination token contract address or ticker symbol, such as
                    "XAUT".
                from_chain:
                  oneOf:
                    - type: string
                    - type: integer
                    - type: 'null'
                  description: >-
                    Source chain name or chain ID. Defaults to the source
                    token's chain when omitted.
                to_chain:
                  oneOf:
                    - type: string
                    - type: integer
                    - type: 'null'
                  description: >-
                    Destination chain name or chain ID. Defaults to the
                    destination token's chain when omitted.
                slippage_bps:
                  type:
                    - integer
                    - 'null'
                  description: Maximum slippage tolerance in basis points.
              required:
                - account_id
                - amount
                - from_token
                - to_token
        required: true
      responses:
        '201':
          description: swap created
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - swap
                  id:
                    type: string
                    description: Swap ID. Poll `GET /swaps/:id` for status.
                  account_id:
                    type: string
                    description: Account ID that owns the wallet used for the swap.
                  status:
                    type: string
                    description: Initial swap status.
                  to_chain:
                    type: string
                    description: Destination chain for the swap.
                  amount_out_expected:
                    type: string
                    description: Expected destination token amount.
                  amount_out_min:
                    type: string
                    description: Minimum destination amount after slippage.
                  rate:
                    type: string
                    description: Quoted exchange rate used to create the swap.
                required:
                  - object
                  - id
                  - account_id
                  - status
        '400':
          $ref: '#/components/responses/InvalidParameters'
          description: request is invalid
        '403':
          $ref: '#/components/responses/Forbidden'
          description: credential lacks the crypto-wallet scope
      security:
        - bearerAuth:
            - crypto_wallet:swap
components:
  responses:
    InvalidParameters:
      description: Invalid Parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V1ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V1ErrorResponse'
  schemas:
    V1ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable error message.
          required:
            - type
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: auth-scheme
      description: >-
        An account API key, account scoped JWT, app API key, or user OAuth
        token.

````