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

# Accept a swap

> Accept a swap request to execute the cryptocurrency exchange.




## OpenAPI

````yaml https://production.hifi.com/api/v2/openapi.json post /v2/wallets/swaps/{swapId}/accept
openapi: 3.0.0
info:
  title: Hifi API
  version: 2.0.0
  description: API documentation for Hifi
servers:
  - url: https://production.hifibridge.com
    description: Production server
  - url: https://sandbox.hifibridge.com
    description: Sandbox server
security:
  - bearerAuth: []
tags:
  - name: Common
    description: Common endpoints
  - name: User
    description: User endpoints
  - name: Kyc
    description: Kyc endpoints
  - name: Wallet
    description: Wallet endpoints
  - name: Account
    description: Account endpoints
  - name: External Account
    description: External Account endpoints for managing beneficiary bank accounts
  - name: Fiat Account
    description: Fiat Account endpoints
  - name: Virtual Account
    description: Virtual Account endpoints
  - name: Onramp
    description: Onramp endpoints
  - name: Offramp
    description: Offramp endpoints
  - name: Orchestration Address
    description: >-
      Orchestration Address endpoints — persistent on-chain wallets that
      automatically off-ramp incoming stablecoin deposits to a USD bank account
  - name: Crypto Transfer
    description: Crypto Transfer endpoints
  - name: Cross-Chain Bridge
    description: Cross-Chain Bridge endpoints
  - name: Token Swap
    description: Token Swap endpoints
  - name: Canton Offers
    description: Canton Offers endpoints
  - name: Transfer Rules
    description: Transfer approval rules and configuration
  - name: Transfer Approvals
    description: Transfer approval workflow and admin actions
  - name: File
    description: File endpoints
  - name: Reporting
    description: Reporting and metrics endpoints
paths:
  /v2/wallets/swaps/{swapId}/accept:
    post:
      tags:
        - Token Swap
      summary: Accept a swap
      description: |
        Accept a swap request to execute the cryptocurrency exchange.
      parameters:
        - $ref: '#/components/parameters/SwapTransferIDPathParameter'
      responses:
        '200':
          $ref: '#/components/responses/WalletSwapResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '404':
          $ref: '#/components/responses/NotFoundResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  parameters:
    SwapTransferIDPathParameter:
      name: swapId
      in: path
      schema:
        type: string
      description: Swap transfer record ID.
      required: true
  responses:
    WalletSwapResponse:
      description: Success
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletSwapObject'
    UnauthorizedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
    NotFoundResponse:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              error:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
    InternalServerErrorResponse:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InternalServerError'
  schemas:
    WalletSwapObject:
      type: object
      properties:
        transferType:
          type: string
          example: WALLET.SWAP
        transferDetails:
          $ref: '#/components/schemas/WalletSwapDetailsObject'
    Unauthorized:
      type: object
      properties:
        code:
          type: integer
          description: Error code
        error:
          type: string
          description: Error type
        errorDetails:
          type: string
          description: Detailed error message
    InternalServerError:
      type: object
      properties:
        code:
          type: integer
          description: Error code
        error:
          type: string
          description: Error type
        errorDetails:
          type: string
          description: Detailed error message
    WalletSwapDetailsObject:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: dc923cc1-d74b-58f6-9fe4-9e9c6eb8dc37
        requestId:
          type: string
          format: uuid
          example: 1ab3e6e0-4839-4dbe-89c3-b06d9645ae86
        status:
          type: string
          enum:
            - OPEN_QUOTE
            - CREATED
            - PENDING
            - COMPLETED
            - QUOTE_FAILED
            - FAILED
          example: COMPLETED
        createdAt:
          type: string
          format: date-time
          example: '2025-08-20T03:55:29.437108+00:00'
        updatedAt:
          type: string
          format: date-time
          example: '2025-08-20T04:08:10.837+00:00'
        source:
          $ref: '#/components/schemas/WalletSwapSourceObject'
        destination:
          $ref: '#/components/schemas/WalletSwapDestinationObject'
        error:
          type: string
          nullable: true
          example: null
        errorDetails:
          type: string
          nullable: true
          example: null
        quoteInformation:
          $ref: '#/components/schemas/WalletSwapQuoteInformationObject'
    WalletSwapSourceObject:
      type: object
      properties:
        currency:
          type: string
          enum:
            - usdc
            - usdt
            - usdg
            - pyusd
            - pyusd0
          example: usdc
        amount:
          type: number
          example: 10
        chain:
          type: string
          enum:
            - POLYGON
            - ETHEREUM
            - SOLANA
            - FLOW_EVM
        userId:
          type: string
          format: uuid
          example: 05179f69-1988-4b46-a847-dd4eea0984d6
    WalletSwapDestinationObject:
      type: object
      properties:
        currency:
          type: string
          enum:
            - usdc
            - usdt
            - usdg
            - pyusd
            - pyusd0
          example: usdt
        userId:
          type: string
          format: uuid
          example: 05179f69-1988-4b46-a847-dd4eea0984d6
        externalWalletId:
          type: string
          format: uuid
          nullable: true
          example: null
        amount:
          type: number
          nullable: true
          example: null
        chain:
          type: string
          enum:
            - POLYGON
            - ETHEREUM
            - SOLANA
            - FLOW_EVM
          example: POLYGON
        walletAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          example: '0xe5727a4B1d93A26D6A7Adfaae145EFa41ED7f204'
    WalletSwapQuoteInformationObject:
      type: object
      properties:
        sendGross:
          $ref: '#/components/schemas/WalletSwapAmountObject'
        sendNet:
          $ref: '#/components/schemas/WalletSwapAmountObject'
        receiveGross:
          $ref: '#/components/schemas/WalletSwapAmountObject'
        receiveNet:
          $ref: '#/components/schemas/WalletSwapAmountObject'
        rate:
          type: string
          example: '1'
        expiresAt:
          type: string
          format: date-time
          example: '2025-08-20T03:55:59.539+00:00'
    WalletSwapAmountObject:
      type: object
      properties:
        amount:
          type: string
          example: '10'
        currency:
          type: string
          example: usdc
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````