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

# Execute Swap quote

> Executes a given swap quote. Refer to our Recipes section for more detailed examples.



## OpenAPI

````yaml POST /v4/swap/execute_quote
openapi: 3.0.0
info:
  title: Ramps & Swaps
  version: 1.0.0
servers:
  - url: https://api.moonpay.com
security: []
tags:
  - name: Account details
    description: >-
      Get your account details, including the verification status and the
      current fees.
  - name: On-ramp
    description: Get quotes and transaction details for buying cryptocurrencies.
  - name: Off-ramp
    description: Get quotes and transaction details for selling cryptocurrencies.
  - name: Swaps
    description: Get quotes and transaction details for swapping cryptocurrencies.
  - name: Data
    description: >-
      Get currently supported countries, currencies, and payment methods. Also
      check the customers's IP address restrictions.
  - name: DefiToken
    description: Retrieve token data and token lists for DeFi assets.
paths:
  /v4/swap/execute_quote:
    post:
      tags:
        - Swaps
      summary: Execute Swap quote
      description: >-
        Executes a given swap quote. Refer to our Recipes section for more
        detailed examples.
      operationId: executeSwapQuote
      parameters:
        - name: authorization
          in: header
          schema:
            type: string
          example: '***'
          description: >-
            A valid customer authentication token in the format 'Bearer [auth
            token]'.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              properties:
                signature:
                  type: string
                  example: '***'
                  description: >-
                    Signature from the <a
                    href="/reference/get_v4-swap-pair-quote">GET quote</a>
                    response.
                externalTransactionId:
                  type: string
                  example: 6ec52bc3-236a-4570-a9e0-743e14818619
                  description: >-
                    A valid Swap transaction ID from your backend. You can use
                    this to associate your transaction with our transaction.
                walletAddresses:
                  type: object
                  properties:
                    destinationWalletAddress:
                      type: string
                      example: 7.55070758245981e+47
                      description: >-
                        The address where the quote currency is going to be sent
                        to.
                    destinationWalletAddressTag:
                      type: string
                      example: tag
                      description: The tag for `destinationWalletAddress`
                    refundWalletAddress:
                      type: string
                      example: 7.55070758245981e+47
                      description: >-
                        The address where we will refund the crypto back to, in
                        case the Swap transaction cannot be completed.
                    refundWalletAddressTag:
                      type: string
                      example: tag
                      description: The tag for `refundWalletAddress`.
                  required:
                    - destinationWalletAddress
                    - refundWalletAddress
              required:
                - signature
                - walletAddresses
      responses:
        '200':
          description: Successful response — Swap Transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutedSwapQuote'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    ExecutedSwapQuote:
      type: object
      properties:
        baseCurrency:
          $ref: '#/components/schemas/CryptoCurrency'
          description: Details about the cryptocurrency the customer wants to swap.
        quoteCurrency:
          $ref: '#/components/schemas/CryptoCurrency'
          type: string
          description: Details about the cryptocurrency the customer will receive.
        baseCurrencyAmount:
          type: string
          example: '1.123'
          description: >-
            A positive string number representing how much crypto the user wants
            to swap.
        quoteCurrencyAmount:
          type: string
          example: '0.0056'
          description: >-
            A positive string number representing the amount of cryptocurrency
            the customer will receive. Set when the swap is executed.
        extraFeeAmount:
          type: string
          example: '0.0000005'
          description: >-
            A positive number string representing your extra fee for the
            transaction. It is added to baseCurrencyAmount, feeAmount and
            networkFeeAmount when the swap is executed.
        networkFeeAmount:
          type: string
          example: '0.00039'
          description: >-
            A positive number string representing the network fee for the
            transaction. It is added to baseCurrencyAmount, feeAmount and
            extraFeeAmount when the swap is executed.
        feeAmount:
          type: string
          example: '0.0002'
          description: A positive number representing the fee for the transaction.
        transactionId:
          type: string
          example: 3ea41bef-cfd7-445c-91cc-853f417d4f1e
          description: A valid Swap transaction ID.
        status:
          type: string
          example: completed
          description: >-
            The transaction's status. Possible values are `completed`, `failed`,
            `waitingForDepositAddressGeneration`, `waitingForDeposit`,
            `executingSwap`, `reQuoteRequired`, `screeningWalletAddress`,
            `frozen`.
          enum:
            - completed
            - failed
            - waitingForDepositAddressGeneration
            - waitingForDeposit
            - executingSwap
            - reQuoteRequired
            - screeningWalletAddress
            - frozen
    Error:
      type: object
      properties:
        message:
          type: string
          description: A descriptive error message.
        type:
          type: string
          description: An error type.
    CryptoCurrency:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the currency.
          example: aaefa32f-161b-42c8-8115-debcbf3d6a2d
        createdAt:
          type: string
          description: >-
            Time at which the object was created. Returned as an ISO 8601
            string.
          example: '2019-05-17T18:24:45.206Z'
        updatedAt:
          type: string
          description: >-
            Time at which the object was last updated. Returned as an ISO 8601
            string.
          example: '2019-05-17T18:24:45.206Z'
        type:
          type: string
          enum:
            - crypto
          description: Always `crypto`
          example: crypto
        name:
          type: string
          description: The currency's name.
          example: USD Coin (ERC-20)
        code:
          type: string
          description: The currency's code.
          example: usdc
        precision:
          type: number
          description: The currency's precision (number of digits after decimal point).
          example: 2
        minBuyAmount:
          type: number
          nullable: true
          description: Represents the minimum amount of cryptocurrency you can buy.
          example: 30
        maxBuyAmount:
          type: number
          nullable: true
          description: Represents the maximum amount of cryptocurrency you can buy.
          example: 1000
        minSellAmount:
          type: number
          nullable: true
          description: The minimum amount of cryptocurrency you can sell.
          example: 15
        maxSellAmount:
          type: number
          nullable: true
          description: The maximum amount of cryptocurrency you can sell.
          example: 100000
        addressRegex:
          type: string
          description: >-
            A regular expression which you can test against your end user's
            wallet addresses.
          example: ^(0x)[0-9A-Fa-f]{40}$
        testnetAddressRegex:
          type: string
          description: >-
            A regular expression which you can test against your end user's
            testnet wallet addresses.
          example: ^(0x)[0-9A-Fa-f]{40}$
        supportsAddressTag:
          type: boolean
          description: Whether the currency supports address tags.
          example: false
        addressTagRegex:
          type: string
          nullable: true
          description: >-
            A regular expression which you can test against a wallet address
            tag. Defined only if the currency supports address tags.
          example: null
        supportsTestMode:
          type: boolean
          description: Whether the currency supports test mode.
          example: true
        isSuspended:
          type: boolean
          description: >-
            Whether purchases for this currency are suspended. If the currency
            is suspended, exchange rates may not be available and it is not
            possible to create a transaction with this currency.
          example: false
        isSupportedInUs:
          type: boolean
          description: Whether purchases for this currency are supported in the US.
          example: true
        isSellSupported:
          type: boolean
          description: Whether sales for this currency are supported.
          example: true
        notAllowedUSStates:
          type: array
          items:
            type: string
            enum:
              - AL
              - AK
              - AZ
              - AR
              - AS
              - CA
              - CO
              - CT
              - DC
              - DE
              - FL
              - GA
              - GU
              - HI
              - ID
              - IL
              - IN
              - IA
              - KS
              - KY
              - LA
              - MA
              - MD
              - ME
              - MI
              - MN
              - MO
              - MP
              - MS
              - MT
              - NE
              - NH
              - NV
              - NH
              - NJ
              - NM
              - NY
              - NC
              - ND
              - OH
              - OK
              - OR
              - PA
              - PR
              - RI
              - SC
              - SD
              - TN
              - TX
              - TT
              - UT
              - VT
              - VA
              - VI
              - WA
              - WV
              - WI
              - WY
          description: >-
            A list with all the US states for this currency that are not
            supported.
          example:
            - LA
            - VI
        notAllowedCountries:
          type: array
          items:
            type: string
          description: >-
            A list with all the ISO 3166-1 alpha-2 country codes for this
            currency that are not supported.
          example:
            - CA
        metadata:
          type: object
          description: Additional metadata for the currency.
          properties:
            contractAddress:
              type: string
              nullable: true
              description: >-
                Unique contract address where the token smart contract is
                hosted.
              example: 0
            chainId:
              type: string
              nullable: true
              description: ID used to identify different EVM compatible chains.
              example: '1'
            networkCode:
              type: string
              description: Name of the cryptocurrency
              example: ethereum
  securitySchemes:
    apiKey:
      type: apiKey
      name: apiKey
      in: query

````